|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Ivan Farabella. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Ivan Farabella, Amelia Livingston, Jujian Zhang, Kevin Buzzard |
| 5 | +-/ |
| 6 | +import Mathlib.Tactic |
| 7 | +import Mathlib.NumberTheory.NumberField.Basic |
| 8 | +import Mathlib.NumberTheory.NumberField.Discriminant |
| 9 | +import Mathlib.RingTheory.IntegralRestrict |
| 10 | +import Mathlib.RingTheory.Ideal.QuotientOperations |
| 11 | +import Mathlib.NumberTheory.RamificationInertia |
| 12 | + |
| 13 | +/-! |
| 14 | +
|
| 15 | +# DO NOT FIX THIS FILE IF IT BREAKS. |
| 16 | +
|
| 17 | +It is work in progress. If it breaks just move the #exit up to |
| 18 | +just before it breaks. Frobenius elements need a complete refactor |
| 19 | +so keeping this code up to date is a waste of time. |
| 20 | +
|
| 21 | +# IsFrobenius |
| 22 | +
|
| 23 | +Let `K` be a number field with integers `A` and let `L/K` be an algebraic extension. |
| 24 | +If `g : L ≃ₐ[K] L` and `P` is a maximal ideal of `A`, then `IsFrobenius g P` is the |
| 25 | +predicate claiming that there's a valuation `v` on `L` extending the `P`-adic valuation on `K`, |
| 26 | +such that `g` fixes `v` and the induced action on the residue field of `v` is `x ↦ x^q`, with |
| 27 | +`q` the size of `A ⧸ P`. |
| 28 | +
|
| 29 | +-/ |
| 30 | + |
| 31 | +open NumberField |
| 32 | + |
| 33 | +set_option maxHeartbeats 4000000 |
| 34 | + |
| 35 | +namespace CompatibleFamily |
| 36 | + |
| 37 | +variable {p : ℕ}[Fact (p.Prime)] |
| 38 | + |
| 39 | +noncomputable section FrobeniusFinite |
| 40 | + |
| 41 | +/-This section defines `IsFrobeniusFinite`, a predicate on Frobenius elements of `L ≃ₐ[K] L` |
| 42 | +where `L/K` is finite dimensional-/ |
| 43 | + |
| 44 | +variable (A K L B : Type) [CommRing A] [CommRing B] [Algebra A B] [Field K] [Field L] |
| 45 | + [Algebra A K] [IsFractionRing A K] [Algebra B L] |
| 46 | + [Algebra K L] [Algebra A L] [IsScalarTower A B L] [IsScalarTower A K L] |
| 47 | + [IsIntegralClosure B A L] [FiniteDimensional K L] |
| 48 | + |
| 49 | +variable {A B} |
| 50 | + |
| 51 | +/-- An ideal `Q` of `B`, is invariant under a `A`-algebra equivalence from `B` to `B` iff |
| 52 | +its image is itself-/ |
| 53 | +def IsInvariant (f : (B ≃ₐ[A] B)) (Q : Ideal B) : Prop := (Q = Q.comap (f.symm : B →+* B)) |
| 54 | + |
| 55 | +lemma comap_symm (f : (B ≃ₐ[A] B)) (Q : Ideal B) : (Q.comap (f.symm : B →+* B) = Q.map f) := |
| 56 | + Ideal.comap_symm _ _ |
| 57 | + |
| 58 | +variable (B) |
| 59 | + |
| 60 | +/-- When `L` is finite dimensional over `K`, a `K`-algebra equivalence from `L` to `L` is |
| 61 | +Frobenius for a maximal ideal downstairs if there exists a invariant maximal ideal upstairs above it |
| 62 | +that induces a Frobenius map on the residue field `B ⧸ Q`. -/ |
| 63 | +def IsFrobeniusFinite (g : (L ≃ₐ[K] L)) (P : Ideal A) [Ideal.IsMaximal P] : Prop := |
| 64 | + ∃ (Q : Ideal B) (h : IsInvariant ((galRestrict A K L B) g) Q), (Ideal.IsMaximal Q) ∧ |
| 65 | + ((Ideal.map (algebraMap A B) P) ≤ Q) ∧ |
| 66 | + (((Ideal.quotientEquivAlg Q Q ((galRestrict A K L B) g) |
| 67 | + (by erw [← comap_symm]; exact h)) : (B ⧸ Q) → (B ⧸ Q)) = |
| 68 | + fun x => x ^ (Nat.card (A ⧸ P))) |
| 69 | + |
| 70 | +end FrobeniusFinite |
| 71 | + |
| 72 | +section IsFrobenius |
| 73 | +/-This section defines `IsFrobenius'` and `IsFrobenius`, propositions for Frobenius elements |
| 74 | +of `L ≃ₐ[K] L` when the extension `L/K` isn't necessarily finite. See `IsFrobeniusAgrees.lean` |
| 75 | +for an attempt at proving `IsFrobenius'` agrees with `IsFrobeniusFinite` when `K` and `L` are |
| 76 | +number fields-/ |
| 77 | + |
| 78 | +variable (A K L B : Type ) [CommRing A] [CommRing B] [Algebra A B] [Field K] [Field L] |
| 79 | + [Algebra A K] [IsFractionRing A K] [Algebra B L] |
| 80 | + [Algebra K L] [Algebra A L] [IsScalarTower A B L] [IsScalarTower A K L] |
| 81 | + [IsIntegralClosure B A L] -- not necessarily finite dimensional |
| 82 | + |
| 83 | +open NumberField |
| 84 | + |
| 85 | +lemma AlgEquiv_restrict_to_domain_equals_id (h1 : Normal K L) : |
| 86 | + AlgEquiv.restrictNormalHom (F := K) L = MonoidHom.id _ := by |
| 87 | + ext a l |
| 88 | + simpa only [Algebra.id.map_eq_id, RingHom.id_apply, AlgHom.coe_coe] using |
| 89 | + AlgHom.restrictNormal_commutes (E := L) (F := K) (K₁ := L) (K₂ := L) a l |
| 90 | + |
| 91 | +lemma AlgEquiv_restrict_to_domain_fix (h1 : Normal K L) (g : (L ≃ₐ[K] L)) : |
| 92 | + AlgEquiv.restrictNormalHom (F := K) L g = g := by |
| 93 | + rw [AlgEquiv_restrict_to_domain_equals_id K L h1] |
| 94 | + rfl |
| 95 | + |
| 96 | +/--Takes an ideal upstairs and brings it downstairs in a AKLB setup-/ |
| 97 | +def ToDownstairs (Q : Ideal B) : Ideal A := Q.comap (algebraMap A B) |
| 98 | + |
| 99 | +/-Depreciation note: eventually we want to state these in full generality, removing as many |
| 100 | +instances of `NumberField` as possible. It seems like the following setup will be useful: |
| 101 | +variable (A K L B : Type ) [CommRing A] [CommRing B] [Algebra A B] [Field K] [Field L] |
| 102 | + [Algebra A K] [IsFractionRing A K] [Algebra B L] |
| 103 | + [Algebra K L] [Algebra A L] [IsScalarTower A B L] [IsScalarTower A K L] |
| 104 | + [IsIntegralClosure B A L] (not : ¬ (IsField A)) [Nontrivial A] [Ring.DimensionLEOne A] |
| 105 | + [∀ (P : Ideal A) [P.IsMaximal], Fintype (A ⧸ P)] [Infinite A] |
| 106 | +the local case of `Fintype_Quot_of_IsMaximal` has been formalised by |
| 107 | +María Inés de Frutos Fernández and Filippo A. E. Nuccio at |
| 108 | +https://github.com/mariainesdff/LocalClassFieldTheory/blob/master/LocalClassFieldTheory/DiscreteValuationRing/ResidueField.lean -/ |
| 109 | + |
| 110 | +variable {A} |
| 111 | + |
| 112 | +lemma IsMaximal_not_eq_bot [NumberField K] (Q : Ideal (𝓞 K)) [Ideal.IsMaximal Q] : Q ≠ ⊥ := |
| 113 | + Ring.ne_bot_of_isMaximal_of_not_isField inferInstance (RingOfIntegers.not_isField K) |
| 114 | + |
| 115 | +lemma NumberField_Ideal_IsPrime_iff_IsMaximal [NumberField K] |
| 116 | + (Q : Ideal (𝓞 K)) (h1: Q ≠ ⊥) : Ideal.IsPrime Q ↔ Ideal.IsMaximal Q := by |
| 117 | + constructor |
| 118 | + · intro h |
| 119 | + exact Ideal.IsPrime.isMaximal h h1 |
| 120 | + · intro h |
| 121 | + exact Ideal.IsMaximal.isPrime h |
| 122 | + |
| 123 | +instance Fintype_Quot_of_IsMaximal [NumberField K] (P : Ideal (𝓞 K)) [Ideal.IsMaximal P] : Fintype ((𝓞 K) ⧸ P) := by |
| 124 | + sorry |
| 125 | + |
| 126 | +-- all broken from here but no longer sure this is the right level of generality |
| 127 | +#exit |
| 128 | + |
| 129 | +lemma ring_of_integers_not_Fintype [NumberField K] : ¬ (Finite (𝓞 K)) := Infinite.not_finite |
| 130 | + |
| 131 | +lemma ne_bot_algebraMap_comap_ne_bot' (Q : Ideal B) [Ideal.IsMaximal Q] [Fintype (B ⧸ Q)] |
| 132 | + [Infinite A] : |
| 133 | + Ideal.comap (algebraMap A B) Q ≠ ⊥ := by |
| 134 | + by_contra hQ |
| 135 | + have h2 : Ideal.comap (algebraMap A B) Q ≤ Ideal.comap (algebraMap A B) Q := |
| 136 | + Eq.le rfl |
| 137 | + let f := Ideal.quotientMap Q (algebraMap A B) h2 |
| 138 | + have hf : Function.Injective (Ideal.quotientMap Q (algebraMap A B) h2) := |
| 139 | + @Ideal.quotientMap_injective A B _ _ Q (algebraMap A B) |
| 140 | + have h3 : Fintype (A ⧸ Ideal.comap (algebraMap A B) Q) := Fintype.ofInjective f hf |
| 141 | + rw [hQ] at h3 |
| 142 | + have h4 : Fintype A := |
| 143 | + @Fintype.ofEquiv _ (A ⧸ ⊥) h3 (@QuotientAddGroup.quotientBot A _).toEquiv |
| 144 | + exact Fintype.false h4 |
| 145 | + |
| 146 | +lemma ne_bot_algebraMap_comap_ne_bot [NumberField K] [NumberField L] |
| 147 | + (Q : Ideal (𝓞 L)) [Ideal.IsMaximal Q] : Ideal.comap (algebraMap (𝓞 K) (𝓞 L)) Q ≠ ⊥ := by |
| 148 | + exact ne_bot_algebraMap_comap_ne_bot' (↥(𝓞 L)) Q |
| 149 | + |
| 150 | +lemma IsMaximal_comap_IsMaximal' [NumberField K] [NumberField L] |
| 151 | + (Q : Ideal (𝓞 L)) [Ideal.IsMaximal Q] : |
| 152 | + Ideal.IsMaximal (Q.comap (algebraMap (𝓞 K) (𝓞 L))) := by |
| 153 | + rw [← NumberField_Ideal_IsPrime_iff_IsMaximal] at * |
| 154 | + · exact Ideal.IsPrime.comap (algebraMap ↥(𝓞 K) ↥(𝓞 L)) |
| 155 | + · have h : Q ≠ ⊥ := IsMaximal_not_eq_bot L Q |
| 156 | + exact h |
| 157 | + · exact ne_bot_algebraMap_comap_ne_bot K L Q |
| 158 | + |
| 159 | +lemma IsMaximal_ToDownstairs_IsMaximal [NumberField K] [NumberField L] |
| 160 | + (Q : Ideal (𝓞 L)) [Ideal.IsMaximal Q] : Ideal.IsMaximal (ToDownstairs (𝓞 K) (𝓞 L) Q) := by |
| 161 | + rw [ToDownstairs] |
| 162 | + exact IsMaximal_comap_IsMaximal' K L Q |
| 163 | + |
| 164 | +instance (k l : Type) [Field k] [Field l] [NumberField k] [NumberField l] [Algebra k l] : |
| 165 | + SMul (𝓞 k) (𝓞 l) := Algebra.toSMul |
| 166 | + |
| 167 | +instance [NumberField K] [NumberField L]: IsScalarTower (𝓞 K) (𝓞 L) L := |
| 168 | + IsScalarTower.of_algebraMap_eq (congrFun rfl) |
| 169 | + |
| 170 | +instance (k l : Type) [Field k] [Field l] [NumberField k] [NumberField l] [Algebra k l] : |
| 171 | + IsIntegralClosure (↥(𝓞 l)) (↥(𝓞 k)) l := sorry -- a missing theorem, needs a proof |
| 172 | + |
| 173 | +/-- Predicate on Frobenius elements for number fields. Should be depreciated to use `IsFrobenius` |
| 174 | +instead.-/ |
| 175 | +def IsFrobenius' [NumberField K] (g : (L ≃ₐ[K] L)) (P : Ideal (𝓞 K)) [Ideal.IsMaximal P] : Prop := |
| 176 | + ∀(N : Type) [Field N] [NumberField N] [Algebra K N] [FiniteDimensional K N] [IsGalois K N] |
| 177 | + [Algebra N L] [IsScalarTower K N L], |
| 178 | + IsFrobeniusFinite K N (𝓞 N) (AlgEquiv.restrictNormalHom N g) P |
| 179 | + |
| 180 | +/--A predicate on Frobenius elements in a higher level of generality-/ |
| 181 | +def IsFrobenius (g : (L ≃ₐ[K] L)) (P : Ideal A) [Ideal.IsMaximal P] : Prop := |
| 182 | + ∀ (N: Type) [Field N] [Algebra K N] [Algebra A N] [FiniteDimensional K N] |
| 183 | + [IsGalois K N] [IsScalarTower A K N] [Algebra N L] [IsScalarTower K N L], |
| 184 | + ∃ (C : Type) (_ : CommRing C) (_ : Algebra A C) (_ : Algebra C N) |
| 185 | + (_ : IsScalarTower A C N) (_ :IsIntegralClosure C A N), |
| 186 | + IsFrobeniusFinite K N C (AlgEquiv.restrictNormalHom N g) P |
0 commit comments