import Mathlib /-! # Hilbert's twelfth problem `Hilbert12.Hilbert12Combined` is the closed proposition at the end of this file. For each number field embedded in β„‚ it joins three requirements on the same ray fields. * The analytic construction uses the point language, convergent expressions, common manifold, and ideal action of `Hilbert12KroneckerType`. * Arithmetic classification supplies the subgroup correspondence, conductors, the conductor–discriminant formula, and finite catalogues for prescribed invariants. * The classical specializations recover cyclotomic values over β„š and the j-invariant and Weber values of ideal-torsion points over imaginary quadratic fields. The recipe is uniform in the modulus. Arithmetic point formulas admit unbounded quantification, and each embedded base field has existentially specified geometry. Intrinsicness of the special points remains a mathematical question about a proposed construction. An exact finite catalogue is specified extensionally. Based on the supplied Hilbert12.lean and the staged HilbertDrafts/Hilbert12.lean. Checked configuration: Lean v4.35.0-rc2, Mathlib 065356127b1dc0016f66b7283ce0ce2c4055aa55. -/ namespace Hilbert12 open NumberField open scoped NumberField nonZeroDivisors noncomputable section section Arithmetic variable (K : Type*) [Field K] [NumberField K] /-- A nonzero integral ideal and the real embeddings included in the modulus. -/ structure Modulus where finite : Ideal (π“ž K) finite_ne_bot : finite β‰  βŠ₯ realPlaces : Finset (K β†’+* ℝ) variable {K} /-- Nonzero integral ideals prime to the finite part of the modulus. -/ def PrimeTo (m : Modulus K) : Submonoid (Ideal (π“ž K)) where carrier := {I | I β‰  βŠ₯ ∧ I βŠ” m.finite = ⊀} one_mem' := by change (1 : Ideal (π“ž K)) β‰  βŠ₯ ∧ (1 : Ideal (π“ž K)) βŠ” m.finite = ⊀ rw [Ideal.one_eq_top] exact ⟨top_ne_bot, top_sup_eq _⟩ mul_mem' := by intro I J hI hJ change I β‰  βŠ₯ ∧ I βŠ” m.finite = ⊀ at hI change J β‰  βŠ₯ ∧ J βŠ” m.finite = ⊀ at hJ exact ⟨fun h => (Ideal.mul_eq_bot.mp h).elim hI.1 hJ.1, (Ideal.mul_sup_eq_of_coprime_left hI.2).trans hJ.2⟩ variable (K) abbrev Fractional (K : Type*) [Field K] := FractionalIdeal (π“ž K)⁰ K variable {K} /-- The natural inclusion of an integral ideal prime to the modulus among the units of the fractional ideal ring. -/ def fractionalize (m : Modulus K) : PrimeTo m β†’* (Fractional K)Λ£ where toFun I := Units.mk0 (I.val : Fractional K) (FractionalIdeal.coeIdeal_ne_zero.mpr I.property.1) map_one' := by apply Units.ext change ((1 : Ideal (π“ž K)) : Fractional K) = 1 rw [Ideal.one_eq_top, FractionalIdeal.coeIdeal_top] map_mul' I J := by apply Units.ext change ((I.val * J.val : Ideal (π“ž K)) : Fractional K) = (I.val : Fractional K) * (J.val : Fractional K) exact FractionalIdeal.coeIdeal_mul _ _ /-- The group of fractional ideals prime to the modulus is generated by the nonzero integral ideals prime to its finite part. -/ def FractionalAway (m : Modulus K) : Subgroup (Fractional K)Λ£ := Subgroup.closure (Set.range (fractionalize m)) def integralToFractional (m : Modulus K) : PrimeTo m β†’* FractionalAway m := (fractionalize m).codRestrict (FractionalAway m) (fun I => Subgroup.subset_closure ⟨I, rfl⟩) /-- The multiplicative ray congruence in the localization away from the finite part. A denominator that is a unit in the residue ring represents an element with valuation zero at every prime dividing the finite part. -/ def RayCongruentOne (m : Modulus K) (Ξ± : K) : Prop := (βˆƒ x y : π“ž K, x β‰  0 ∧ y β‰  0 ∧ Ξ± = algebraMap (π“ž K) K x / algebraMap (π“ž K) K y ∧ IsUnit (Ideal.Quotient.mk m.finite y) ∧ x - y ∈ m.finite) ∧ βˆ€ v ∈ m.realPlaces, 0 < v Ξ± /-- Principal ray ideals are generated by elements congruent to one at the finite modulus and positive at the selected real places. -/ def PrincipalRay (m : Modulus K) : Subgroup (FractionalAway m) := Subgroup.closure {I | βˆƒ Ξ± : K, RayCongruentOne m Ξ± ∧ ((I.val : (Fractional K)Λ£) : Fractional K) = FractionalIdeal.spanSingleton (π“ž K)⁰ Ξ±} abbrev RayClass (m : Modulus K) := FractionalAway m β§Έ PrincipalRay m /-- Take the ray class of a nonzero integral ideal prime to the modulus. -/ def idealClass (m : Modulus K) : PrimeTo m β†’* RayClass m := (QuotientGroup.mk' (PrincipalRay m)).comp (integralToFractional m) end Arithmetic section EmbeddedFields variable (K : Type*) [Field K] [NumberField K] [Algebra K β„‚] def IsFiniteAbelian (E : IntermediateField K β„‚) : Prop := FiniteDimensional K E ∧ IsGalois K E ∧ βˆ€ Οƒ Ο„ : E ≃ₐ[K] E, Οƒ * Ο„ = Ο„ * Οƒ /-- As a set of complex elements, the union of the finite abelian extensions of the fixed embedded base field. -/ def AbelianValues : Set β„‚ := {z | βˆƒ E : IntermediateField K β„‚, IsFiniteAbelian K E ∧ z ∈ E} variable {K} /-- Normalize the Artin symbol using arithmetic Frobenius. At every prime above the given base prime, the ramification index is one and this automorphism induces the residue-field power map. -/ def IsArithmeticFrobenius (E : IntermediateField K β„‚) (p : Ideal (π“ž K)) (Οƒ : E ≃ₐ[K] E) : Prop := βˆ€ q : Ideal (π“ž E), q.IsPrime β†’ q.comap (algebraMap (π“ž K) (π“ž E)) = p β†’ q.ramificationIdx (π“ž K) = 1 ∧ βˆ€ x : π“ž E, RingOfIntegers.mapRingHom Οƒ.toRingHom x - x ^ p.absNorm ∈ q variable (K) /-- Class field theory is supplied independently of the analytic recipe. The Artin isomorphism has the canonical ray class group as domain. -/ structure ClassFieldTheory where rayField : Modulus K β†’ IntermediateField K β„‚ finiteAbelian : βˆ€ m, IsFiniteAbelian K (rayField m) artinEquiv : βˆ€ m, RayClass m ≃* (rayField m ≃ₐ[K] rayField m) frobenius : βˆ€ m (p : PrimeTo m), p.val.IsPrime β†’ IsArithmeticFrobenius (rayField m) p.val (artinEquiv m (idealClass m p)) realUnramified : βˆ€ m (v : K β†’+* ℝ), v βˆ‰ m.realPlaces β†’ βˆ€ w : rayField m β†’+* β„‚, w.comp (algebraMap K (rayField m)) = Complex.ofRealHom.comp v β†’ βˆ€ x : rayField m, (w x).im = 0 cofinal : βˆ€ E : IntermediateField K β„‚, IsFiniteAbelian K E β†’ βˆƒ m, E ≀ rayField m variable {K} /-- Artin action of the integral ideals prime to the finite modulus. -/ def ClassFieldTheory.artin (C : ClassFieldTheory K) (m : Modulus K) : PrimeTo m β†’* (C.rayField m ≃ₐ[K] C.rayField m) := (C.artinEquiv m).toMonoidHom.comp (idealClass m) theorem ClassFieldTheory.mem_abelianValues_iff (C : ClassFieldTheory K) (z : β„‚) : z ∈ AbelianValues K ↔ βˆƒ m, z ∈ C.rayField m := by constructor Β· rintro ⟨E, hE, hz⟩ obtain ⟨m, hm⟩ := C.cofinal E hE exact ⟨m, hm hz⟩ Β· rintro ⟨m, hm⟩ exact ⟨C.rayField m, C.finiteAbelian m, hm⟩ end EmbeddedFields end end Hilbert12 noncomputable section namespace Hilbert12 open scoped NumberField nonZeroDivisors /-- The three sorts of data visible to point programs. -/ inductive ArithmeticAtom (K : Type*) [Field K] [NumberField K] where | scalar (x : K) | ideal (I : FractionalIdeal (π“ž K)⁰ K) | place (v : K β†’+* ℝ) /-- The fixed relations of the arithmetic language. No new relation symbols can be introduced by a point program. Congruences are expressed using ideal membership. -/ inductive ArithmeticRelation : β„• β†’ Type where | equal : ArithmeticRelation 2 | zero : ArithmeticRelation 1 | one : ArithmeticRelation 1 | add : ArithmeticRelation 3 | mul : ArithmeticRelation 3 | contains : ArithmeticRelation 2 | idealAdd : ArithmeticRelation 3 | idealMul : ArithmeticRelation 3 | principal : ArithmeticRelation 2 | integral : ArithmeticRelation 1 | positive : ArithmeticRelation 2 | finitePart : ArithmeticRelation 1 | markedPlace : ArithmeticRelation 1 /-- First-order formulas with an explicit finite context. -/ inductive ArithmeticFormula : β„• β†’ Type where | atom {n arity : β„•} (rel : ArithmeticRelation arity) (args : Fin arity β†’ Fin n) : ArithmeticFormula n | neg {n : β„•} (body : ArithmeticFormula n) : ArithmeticFormula n | and {n : β„•} (left right : ArithmeticFormula n) : ArithmeticFormula n | ex {n : β„•} (body : ArithmeticFormula (n + 1)) : ArithmeticFormula n variable {K : Type*} [Field K] [NumberField K] /-- Arithmetic interpretation of each primitive relation. The two modulus accessors expose only its finite ideal and marked real places. -/ def ArithmeticRelation.Holds (finitePart : FractionalIdeal (π“ž K)⁰ K) (marked : Set (K β†’+* ℝ)) {arity : β„•} (rel : ArithmeticRelation arity) (args : Fin arity β†’ ArithmeticAtom K) : Prop := match rel with | .equal => args 0 = args 1 | .zero => args 0 = .scalar 0 | .one => args 0 = .scalar 1 | .add => match args 0, args 1, args 2 with | .scalar x, .scalar y, .scalar z => x + y = z | _, _, _ => False | .mul => match args 0, args 1, args 2 with | .scalar x, .scalar y, .scalar z => x * y = z | _, _, _ => False | .contains => match args 0, args 1 with | .ideal I, .scalar x => x ∈ I | _, _ => False | .idealAdd => match args 0, args 1, args 2 with | .ideal I, .ideal J, .ideal L => I + J = L | _, _, _ => False | .idealMul => match args 0, args 1, args 2 with | .ideal I, .ideal J, .ideal L => I * J = L | _, _, _ => False | .principal => match args 0, args 1 with | .scalar x, .ideal I => FractionalIdeal.spanSingleton (π“ž K)⁰ x = I | _, _ => False | .integral => match args 0 with | .scalar x => IsIntegral β„€ x | _ => False | .positive => match args 0, args 1 with | .place v, .scalar x => 0 < v x | _, _ => False | .finitePart => args 0 = .ideal finitePart | .markedPlace => match args 0 with | .place v => v ∈ marked | _ => False def ArithmeticFormula.Holds (finitePart : FractionalIdeal (π“ž K)⁰ K) (marked : Set (K β†’+* ℝ)) : {n : β„•} β†’ ArithmeticFormula n β†’ (Fin n β†’ ArithmeticAtom K) β†’ Prop | _, .atom rel args, env => rel.Holds finitePart marked (env ∘ args) | _, .neg body, env => Β¬ body.Holds finitePart marked env | _, .and left right, env => left.Holds finitePart marked env ∧ right.Holds finitePart marked env | _, .ex body, env => βˆƒ value, body.Holds finitePart marked (Fin.snoc env value) /-- The three formulas use the same contexts and the same semantics at every modulus. The graph argument order is source, target, acting integral ideal. -/ structure PointProgram where scalars : β„• ideals : β„• admissible : ArithmeticFormula (scalars + ideals) equivalent : ArithmeticFormula ((scalars + ideals) + (scalars + ideals)) actionGraph : ArithmeticFormula (((scalars + ideals) + (scalars + ideals)) + 1) def PointProgram.Representative (P : PointProgram) (K : Type*) [Field K] [NumberField K] := (Fin P.scalars β†’ K) Γ— (Fin P.ideals β†’ FractionalIdeal (π“ž K)⁰ K) def PointProgram.environment (P : PointProgram) (p : P.Representative K) : Fin (P.scalars + P.ideals) β†’ ArithmeticAtom K := Fin.append (fun i => .scalar (p.1 i)) (fun j => .ideal (p.2 j)) end Hilbert12 namespace Hilbert12 /-- A rational polynomial and a rational open rectangle isolating a complex root. -/ structure AlgebraicConstant where polynomial : Polynomial β„š realLower : β„š realUpper : β„š imagLower : β„š imagUpper : β„š def AlgebraicConstant.InRectangle (c : AlgebraicConstant) (z : β„‚) : Prop := (c.realLower : ℝ) < z.re ∧ z.re < (c.realUpper : ℝ) ∧ (c.imagLower : ℝ) < z.im ∧ z.im < (c.imagUpper : ℝ) def AlgebraicConstant.IsRoot (c : AlgebraicConstant) (z : β„‚) : Prop := (c.polynomial.map (algebraMap β„š β„‚)).eval z = 0 ∧ c.InRectangle z def AlgebraicConstant.IsolatedRoot (c : AlgebraicConstant) (z : β„‚) : Prop := c.polynomial β‰  0 ∧ c.IsRoot z ∧ βˆ€ w, c.IsRoot w β†’ w = z /-- Arithmetic in the bound summation and product indices. -/ inductive IndexExpression (k : β„•) where | numeral : β„• β†’ IndexExpression k | variable : Fin k β†’ IndexExpression k | add : IndexExpression k β†’ IndexExpression k β†’ IndexExpression k | mul : IndexExpression k β†’ IndexExpression k β†’ IndexExpression k | factorial : IndexExpression k β†’ IndexExpression k def IndexExpression.eval (indices : Fin k β†’ β„•) : IndexExpression k β†’ β„• | .numeral m => m | .variable j => indices j | .add a b => a.eval indices + b.eval indices | .mul a b => a.eval indices * b.eval indices | .factorial a => (a.eval indices).factorial /-- An expression in `n` complex coordinates and `k` natural-number indices. Series and products bind one index in their subexpression. -/ inductive AnalyticExpression (n : β„•) : β„• β†’ Type where | rational : β„š β†’ AnalyticExpression n k | algebraic : AlgebraicConstant β†’ AnalyticExpression n k | coordinate : Fin n β†’ AnalyticExpression n k | index : IndexExpression k β†’ AnalyticExpression n k | add : AnalyticExpression n k β†’ AnalyticExpression n k β†’ AnalyticExpression n k | neg : AnalyticExpression n k β†’ AnalyticExpression n k | mul : AnalyticExpression n k β†’ AnalyticExpression n k β†’ AnalyticExpression n k | inv : AnalyticExpression n k β†’ AnalyticExpression n k | pow : AnalyticExpression n k β†’ IndexExpression k β†’ AnalyticExpression n k | series : AnalyticExpression n (k + 1) β†’ AnalyticExpression n k | product : AnalyticExpression n (k + 1) β†’ AnalyticExpression n k namespace AnalyticExpression /-- An expression has a value only when its inverses and root codes are valid and its series and products converge. Sequence terms come from the bound subexpression. The relation makes no choices on an undefined input. -/ inductive Evaluates (input : Fin n β†’ β„‚) : {k : β„•} β†’ AnalyticExpression n k β†’ (Fin k β†’ β„•) β†’ β„‚ β†’ Prop where | rational (q : β„š) (indices : Fin k β†’ β„•) : Evaluates input (.rational q) indices q | algebraic {c : AlgebraicConstant} {z : β„‚} {indices : Fin k β†’ β„•} (h : c.IsolatedRoot z) : Evaluates input (.algebraic c) indices z | coordinate (j : Fin n) (indices : Fin k β†’ β„•) : Evaluates input (.coordinate j) indices (input j) | index (term : IndexExpression k) (indices : Fin k β†’ β„•) : Evaluates input (.index term) indices (term.eval indices : β„‚) | add {a b : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z w : β„‚} (ha : Evaluates input a indices z) (hb : Evaluates input b indices w) : Evaluates input (.add a b) indices (z + w) | neg {a : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z : β„‚} (ha : Evaluates input a indices z) : Evaluates input (.neg a) indices (-z) | mul {a b : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z w : β„‚} (ha : Evaluates input a indices z) (hb : Evaluates input b indices w) : Evaluates input (.mul a b) indices (z * w) | inv {a : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z : β„‚} (ha : Evaluates input a indices z) (hne : z β‰  0) : Evaluates input (.inv a) indices z⁻¹ | pow {a : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z : β„‚} (b : IndexExpression k) (ha : Evaluates input a indices z) : Evaluates input (.pow a b) indices (z ^ b.eval indices) | series {body : AnalyticExpression n (k + 1)} {indices : Fin k β†’ β„•} {values : β„• β†’ β„‚} {z : β„‚} (hbody : βˆ€ j, Evaluates input body (Fin.cons j indices) (values j)) (hsum : HasSum values z) : Evaluates input (.series body) indices z | product {body : AnalyticExpression n (k + 1)} {indices : Fin k β†’ β„•} {values : β„• β†’ β„‚} {z : β„‚} (hbody : βˆ€ j, Evaluates input body (Fin.cons j indices) (values j)) (hprod : HasProd values z) : Evaluates input (.product body) indices z def EvaluatesAt (expr : AnalyticExpression n 0) (input : Fin n β†’ β„‚) (z : β„‚) : Prop := Evaluates input expr Fin.elim0 z /-- Whenever an expression is defined, its value is unique. -/ theorem Evaluates.functional {input : Fin n β†’ β„‚} {expr : AnalyticExpression n k} {indices : Fin k β†’ β„•} {z w : β„‚} (h : Evaluates input expr indices z) (h' : Evaluates input expr indices w) : z = w := by induction h generalizing w with | rational | coordinate | index => cases h'; rfl | algebraic hRoot => cases h' with | algebraic hRoot' => exact (hRoot.2.2 _ hRoot'.2.1).symm | add _ _ ihLeft ihRight => cases h' with | add hLeft hRight => rw [ihLeft hLeft, ihRight hRight] | neg _ ih => cases h' with | neg h => rw [ih h] | mul _ _ ihLeft ihRight => cases h' with | mul hLeft hRight => rw [ihLeft hLeft, ihRight hRight] | inv _ _ ih => cases h' with | inv h _ => rw [ih h] | pow _ _ ih => cases h' with | pow _ h => rw [ih h] | series _ hSum ih => cases h' with | series hTerms hSum' => have equalTerms := funext (fun j => ih j (hTerms j)) rw [equalTerms] at hSum exact hSum.unique hSum' | product _ hProd ih => cases h' with | product hTerms hProd' => have equalTerms := funext (fun j => ih j (hTerms j)) rw [equalTerms] at hProd exact hProd.unique hProd' end AnalyticExpression end Hilbert12 open scoped ContDiff Manifold Topology namespace Hilbert12 /-- A connected complex manifold with a holomorphic presentation by a fixed open domain. The values of `uniformize` outside the domain are immaterial. -/ structure AnalyticPresentation where dimension : β„• coordinates : β„• Space : Type [topology : TopologicalSpace Space] [charts : ChartedSpace (Fin dimension β†’ β„‚) Space] [manifold : IsManifold (π“˜(β„‚, Fin dimension β†’ β„‚)) Ο‰ Space] [hausdorff : T2Space Space] [secondCountable : SecondCountableTopology Space] [connected : ConnectedSpace Space] domain : Set (Fin coordinates β†’ β„‚) domain_open : IsOpen domain uniformize : (Fin coordinates β†’ β„‚) β†’ Space surjective_on_domain : Set.SurjOn uniformize domain Set.univ holomorphic_on_domain : ContMDiffOn π“˜(β„‚, Fin coordinates β†’ β„‚) π“˜(β„‚, Fin dimension β†’ β„‚) Ο‰ uniformize domain namespace AnalyticPresentation attribute [local instance] topology charts /-- A representative of a meromorphic function is regular at a point if it is complex analytic there in local coordinates, including its value at the point. -/ def RegularAt (G : AnalyticPresentation) (f : G.Space β†’ β„‚) (x : G.Space) : Prop := let e := chartAt (Fin G.dimension β†’ β„‚) x AnalyticAt β„‚ (f ∘ e.symm) (e x) /-- In each chart a meromorphic function has a local analytic quotient representation. The denominator is a nonzero germ. Only the values where the denominator is nonzero enter the equality. -/ def IsMeromorphic (G : AnalyticPresentation) (f : G.Space β†’ β„‚) : Prop := βˆ€ x : G.Space, let e := chartAt (Fin G.dimension β†’ β„‚) x let v := e x βˆƒ numerator denominator : (Fin G.dimension β†’ β„‚) β†’ β„‚, AnalyticAt β„‚ numerator v ∧ AnalyticAt β„‚ denominator v ∧ (Β¬ denominator =αΆ [𝓝 v] fun _ => 0) ∧ βˆ€αΆ  z in 𝓝 v, denominator z β‰  0 β†’ f (e.symm z) = numerator z / denominator z end AnalyticPresentation end Hilbert12 namespace Hilbert12 variable {K : Type*} [Field K] [NumberField K] namespace PointProgram /-- Representatives are selected by interpreting the same arithmetic formula at each modulus. -/ def Admissible (P : PointProgram) (m : Modulus K) := {p : P.Representative K // P.admissible.Holds (m.finite : Fractional K) (↑m.realPlaces) (P.environment p)} def Relation (P : PointProgram) (m : Modulus K) (p q : P.Admissible m) : Prop := P.equivalent.Holds (m.finite : Fractional K) (↑m.realPlaces) (Fin.append (P.environment p.val) (P.environment q.val)) def quotientSetoid (P : PointProgram) (m : Modulus K) (h : Equivalence (P.Relation m)) : Setoid (P.Admissible m) := ⟨P.Relation m, h⟩ def Acts (P : PointProgram) (m : Modulus K) (a : PrimeTo m) (p q : P.Admissible m) : Prop := P.actionGraph.Holds (m.finite : Fractional K) (↑m.realPlaces) (Fin.snoc (Fin.append (P.environment p.val) (P.environment q.val)) (.ideal (a.val : Fractional K))) /-- The quotient must be finite. The action must have exactly the graph computed by the arithmetic formula, so the action field cannot choose among different outputs. -/ structure PointModel (P : PointProgram) (m : Modulus K) where equivalence : Equivalence (P.Relation m) finite : Finite (Quotient (P.quotientSetoid m equivalence)) action : PrimeTo m β†’* Function.End (Quotient (P.quotientSetoid m equivalence)) action_spec : βˆ€ a p q, action a (Quotient.mk (P.quotientSetoid m equivalence) p) = Quotient.mk (P.quotientSetoid m equivalence) q ↔ P.Acts m a p q abbrev PointModel.Points {P : PointProgram} {m : Modulus K} (M : P.PointModel m) := Quotient (P.quotientSetoid m M.equivalence) end PointProgram /-- One presentation, one point program, and one finite family of expressions for all moduli. The coordinate expressions for uniformization accept only embedded arithmetic scalars, including any scalars supplied as part of an admissible representative. -/ structure Recipe where points : PointProgram geometry : AnalyticPresentation coordinates : Fin geometry.coordinates β†’ AnalyticExpression points.scalars 0 functionCount : β„• expressions : Fin functionCount β†’ AnalyticExpression geometry.coordinates 0 /-- Realization of the analytic functions on the fixed manifold. The expressions agree where evaluated and regular, and admit evaluation on a dense subset of the coordinate domain. -/ structure Recipe.Functions (R : Recipe) where function : Fin R.functionCount β†’ R.geometry.Space β†’ β„‚ meromorphic : βˆ€ i, R.geometry.IsMeromorphic (function i) agrees : βˆ€ i z, z ∈ R.geometry.domain β†’ βˆ€ w, (R.expressions i).EvaluatesAt z w β†’ R.geometry.RegularAt (function i) (R.geometry.uniformize z) β†’ function i (R.geometry.uniformize z) = w dense_evaluation : βˆ€ i, R.geometry.domain βŠ† closure {z | z ∈ R.geometry.domain ∧ R.geometry.RegularAt (function i) (R.geometry.uniformize z) ∧ βˆƒ w, (R.expressions i).EvaluatesAt z w} variable [Algebra K β„‚] /-- Descent of the one coordinate rule to the special points at a given modulus. Every representative has a lift given by the expressions. Every special value is pole-free and its expression converges on the lift. -/ structure Recipe.Specialization (R : Recipe) (F : R.Functions) (m : Modulus K) where model : R.points.PointModel m point : model.Points β†’ R.geometry.Space regular : βˆ€ i p, R.geometry.RegularAt (F.function i) (point p) uniformization : βˆ€ p : R.points.Admissible m, βˆƒ z, z ∈ R.geometry.domain ∧ (βˆ€ j, (R.coordinates j).EvaluatesAt (fun k => algebraMap K β„‚ (p.val.1 k)) (z j)) ∧ R.geometry.uniformize z = point (Quotient.mk _ p) ∧ βˆ€ i, βˆƒ w, (R.expressions i).EvaluatesAt z w def Recipe.Specialization.value {R : Recipe} {F : R.Functions} {m : Modulus K} (S : R.Specialization F m) (i : Fin R.functionCount) (p : S.model.Points) : β„‚ := F.function i (S.point p) def Recipe.Specialization.values {R : Recipe} {F : R.Functions} {m : Modulus K} (S : R.Specialization F m) : Set β„‚ := Set.range (fun pair : Fin R.functionCount Γ— S.model.Points => S.value pair.1 pair.2) theorem Recipe.Specialization.value_from_expression {R : Recipe} {F : R.Functions} {m : Modulus K} (S : R.Specialization F m) (p : R.points.Admissible m) : βˆƒ z ∈ R.geometry.domain, (βˆ€ j, (R.coordinates j).EvaluatesAt (fun k => algebraMap K β„‚ (p.val.1 k)) (z j)) ∧ βˆ€ i, (R.expressions i).EvaluatesAt z (S.value i (Quotient.mk _ p)) := by obtain ⟨z, hz, hc, hp, hEval⟩ := S.uniformization p refine ⟨z, hz, hc, fun i => ?_⟩ obtain ⟨w, hw⟩ := hEval i have hRegular : R.geometry.RegularAt (F.function i) (R.geometry.uniformize z) := hp.symm β–Έ S.regular i (Quotient.mk _ p) have hValue : S.value i (Quotient.mk _ p) = w := by simpa only [hp, Recipe.Specialization.value] using F.agrees i z hz w hw hRegular exact hValue.symm β–Έ hw /-- Algebraicity, generation and reciprocity for the fixed specialization. Ray-field membership makes the Artin action on each value type-correct and implies membership in the maximal abelian extension. -/ structure RayValueContract (C : ClassFieldTheory K) {R : Recipe} {F : R.Functions} (m : Modulus K) (S : R.Specialization F m) : Prop where in_ray_field : βˆ€ i p, S.value i p ∈ C.rayField m generation : IntermediateField.adjoin K S.values = C.rayField m reciprocity : βˆ€ a i p, ((C.artin m a) ⟨S.value i p, in_ray_field i p⟩ : β„‚) = S.value i (S.model.action a p) theorem RayValueContract.algebraicity {C : ClassFieldTheory K} {R : Recipe} {F : R.Functions} {m : Modulus K} {S : R.Specialization F m} (h : RayValueContract C m S) (i : Fin R.functionCount) (p : S.model.Points) : S.value i p ∈ AbelianValues K := (C.mem_abelianValues_iff _).2 ⟨m, h.in_ray_field i p⟩ /-- The archimedean target relative to an independently specified class field system. -/ def Hilbert12For (C : ClassFieldTheory K) : Prop := βˆƒ (R : Recipe) (F : R.Functions) (S : βˆ€ m : Modulus K, R.Specialization F m), βˆ€ m, RayValueContract C m (S m) /-- A closed target over every number field concretely embedded in `β„‚`. The recipe and all of its specializations precede the class field witnesses. Existence of the background system is included so that the universal correctness clause cannot be vacuous. -/ def Hilbert12KroneckerType : Prop := βˆ€ (K : Subfield β„‚) [NumberField K], βˆƒ (R : Recipe) (F : R.Functions) (S : βˆ€ m : Modulus K, R.Specialization F m), Nonempty (ClassFieldTheory K) ∧ βˆ€ (C : ClassFieldTheory K) (m : Modulus K), RayValueContract C m (S m) end Hilbert12 end namespace Hilbert12 noncomputable section open scoped NumberField variable {K : Type} [Field K] [NumberField K] [Algebra K β„‚] /-- Divisibility of moduli, including the real places. Containment of integral ideals reverses divisibility. -/ def Modulus.Divides (m n : Modulus K) : Prop := n.finite ≀ m.finite ∧ m.realPlaces βŠ† n.realPlaces /-- The subgroup acts through the same Artin isomorphism as the special values. -/ def ClassFieldTheory.subgroupField (C : ClassFieldTheory K) (m : Modulus K) (H : Subgroup (RayClass m)) : IntermediateField K β„‚ := (IntermediateField.fixedField (H.map (C.artinEquiv m).toMonoidHom)).map (C.rayField m).val /-- The conductor characterizes every modulus whose ray field contains E. -/ def ClassFieldTheory.IsConductor (C : ClassFieldTheory K) (E : IntermediateField K β„‚) (f : Modulus K) : Prop := βˆ€ m : Modulus K, E ≀ C.rayField m ↔ f.Divides m /-- The relative discriminant ideal, generated by determinants of trace pairings on integral tuples of length [E : K]. This also works when the ring of integers has no relative integral basis. -/ def relativeDiscriminant (E : IntermediateField K β„‚) : Ideal (π“ž K) := Ideal.span {d : π“ž K | βˆƒ b : Fin (Module.finrank K E) β†’ π“ž E, (d : K) = Matrix.det (fun i j => Algebra.trace K E ((b i : E) * (b j : E)))} abbrev Character (E : IntermediateField K β„‚) := (E ≃ₐ[K] E) β†’* β„‚Λ£ def characterField (E : IntermediateField K β„‚) (Ο‡ : Character E) : IntermediateField K β„‚ := (IntermediateField.fixedField Ο‡.ker).map E.val /-- The fibre for a prescribed degree, abelian Galois group and discriminant. -/ def HasArithmeticData (E : IntermediateField K β„‚) (n : β„•) (G : Type) [CommGroup G] [Finite G] (D : Ideal (π“ž K)) : Prop := IsFiniteAbelian K E ∧ Module.finrank K E = n ∧ Nonempty ((E ≃ₐ[K] E) ≃* G) ∧ relativeDiscriminant E = D /-- Exact finite catalogue. Its cardinality answers the counting question. -/ structure ArithmeticCatalogue (K : Type) [Field K] [NumberField K] [Algebra K β„‚] (n : β„•) (G : Type) [CommGroup G] [Finite G] (D : Ideal (π“ž K)) where entries : Finset (IntermediateField K β„‚) exact : βˆ€ E, E ∈ entries ↔ HasArithmeticData E n G D theorem ArithmeticCatalogue.exists_iff_count_pos {n : β„•} {G : Type} [CommGroup G] [Finite G] {D : Ideal (π“ž K)} (A : ArithmeticCatalogue K n G D) : (βˆƒ E, HasArithmeticData E n G D) ↔ 0 < A.entries.card := by rw [Finset.card_pos] exact ⟨fun ⟨E, h⟩ => ⟨E, (A.exact E).2 h⟩, fun ⟨E, h⟩ => ⟨E, (A.exact E).1 h⟩⟩ /-- The class-field classification and conductor–discriminant formula use one system of ray fields. Cofinality for all finite abelian extensions is part of C. -/ structure ArithmeticClassification (C : ClassFieldTheory K) where finite_ray_class : βˆ€ m : Modulus K, Finite (RayClass m) correspondence : βˆ€ (m : Modulus K) (E : IntermediateField K β„‚), E ≀ C.rayField m ↔ βˆƒ! H : Subgroup (RayClass m), C.subgroupField m H = E order_reversing : βˆ€ (m : Modulus K) (H J : Subgroup (RayClass m)), H ≀ J ↔ C.subgroupField m J ≀ C.subgroupField m H conductor : βˆ€ E : IntermediateField K β„‚, IsFiniteAbelian K E β†’ βˆƒ! f, C.IsConductor E f conductor_discriminant : βˆ€ E : IntermediateField K β„‚, IsFiniteAbelian K E β†’ βˆƒ (characters : Finset (Character E)) (conductors : Character E β†’ Modulus K), (βˆ€ Ο‡, Ο‡ ∈ characters) ∧ (βˆ€ Ο‡, C.IsConductor (characterField E Ο‡) (conductors Ο‡)) ∧ relativeDiscriminant E = ∏ Ο‡ ∈ characters, (conductors Ο‡).finite catalogue : (n : β„•) β†’ (G : Type) β†’ [CommGroup G] β†’ [Finite G] β†’ (D : Ideal (π“ž K)) β†’ ArithmeticCatalogue K n G D /-- The conductor of each catalogue entry determines exactly which specializations generate a field containing that entry. -/ theorem ArithmeticClassification.conductor_for_catalogue_entry {C : ClassFieldTheory K} (classification : ArithmeticClassification C) {R : Recipe} {F : R.Functions} {S : βˆ€ m : Modulus K, R.Specialization F m} (hRay : βˆ€ m, RayValueContract C m (S m)) {n : β„•} {G : Type} [CommGroup G] [Finite G] {D : Ideal (π“ž K)} {E : IntermediateField K β„‚} (hE : E ∈ (classification.catalogue n G D).entries) : βˆƒ! f : Modulus K, βˆ€ m : Modulus K, E ≀ IntermediateField.adjoin K (S m).values ↔ f.Divides m := by simpa only [ClassFieldTheory.IsConductor, fun m => (hRay m).generation] using classification.conductor E (((classification.catalogue n G D).exact E).mp hE).1 /-- exp(2Ο€ik/N) for the positive generator N of the rational finite modulus. -/ def cyclotomicRoot (N k : β„•) : β„‚ := Complex.exp (2 * (Real.pi : β„‚) * Complex.I * (k : β„‚) / (N : β„‚)) /-- Without the real place the rational ray field is the real cyclotomic subfield, generated by ΞΆ + ΢⁻¹. Including the real place gives the full field. -/ def cyclotomicValue (m : Modulus K) (k : β„•) : β„‚ := by classical let ΞΆ := cyclotomicRoot m.finite.absNorm k exact if m.realPlaces = βˆ… then ΞΆ + ΢⁻¹ else ΞΆ /-- The norm of an ideal gives the exponent for arithmetic Frobenius over β„š. The selected values and their ideal translates are evaluations of S itself. -/ def RationalBenchmark (C : ClassFieldTheory K) {R : Recipe} {F : R.Functions} (S : βˆ€ m : Modulus K, R.Specialization F m) : Prop := Module.finrank β„š K = 1 β†’ βˆ€ m : Modulus K, IntermediateField.adjoin K (Set.range (cyclotomicValue m)) = C.rayField m ∧ βˆ€ k : β„•, βˆƒ i p, (S m).value i p = cyclotomicValue m k ∧ βˆ€ a : PrimeTo m, (S m).value i ((S m).model.action a p) = cyclotomicValue m (a.val.absNorm * k) def ImaginaryQuadratic (K : Type) [Field K] [NumberField K] : Prop := Module.finrank β„š K = 2 ∧ βˆ€ _ : K β†’+* ℝ, False /-- Use the embedded full ring of integers as the period lattice. -/ def FullIntegerLattice (K : Type) [Field K] [NumberField K] [Algebra K β„‚] (L : PeriodPair) : Prop := (L.lattice : Set β„‚) = Set.range (fun a : π“ž K => algebraMap K β„‚ (a : K)) def latticeDiscriminant (L : PeriodPair) : β„‚ := L.gβ‚‚ ^ 3 - 27 * L.g₃ ^ 2 def jInvariant (L : PeriodPair) : β„‚ := 1728 * L.gβ‚‚ ^ 3 / latticeDiscriminant L /-- The square and cube account for the extra automorphisms at j = 1728 and j = 0. -/ def weber (L : PeriodPair) (z : β„‚) : β„‚ := by classical exact if L.g₃ = 0 then L.gβ‚‚ ^ 2 / latticeDiscriminant L * L.weierstrassP z ^ 2 else if L.gβ‚‚ = 0 then L.g₃ / latticeDiscriminant L * L.weierstrassP z ^ 3 else L.gβ‚‚ * L.g₃ / latticeDiscriminant L * L.weierstrassP z /-- Nonidentity points of β„‚/π“ž_K annihilated by the entire finite modulus ideal. For the unit ideal this set is empty and the CM values consist of j alone. -/ def nonzeroIdealTorsion (m : Modulus K) (L : PeriodPair) : Set β„‚ := {z | z βˆ‰ L.lattice ∧ βˆ€ a ∈ m.finite, algebraMap K β„‚ (a : K) * z ∈ L.lattice} def cmValues (m : Modulus K) (L : PeriodPair) : Set β„‚ := {jInvariant L} βˆͺ weber L '' nonzeroIdealTorsion m L omit [NumberField K] in /-- At the unit ideal the benchmark specializes to the Hilbert class field generator. -/ theorem cmValues_of_unit_ideal (m : Modulus K) (hm : m.finite = ⊀) (L : PeriodPair) : cmValues m L = {jInvariant L} := by have ht : nonzeroIdealTorsion m L = βˆ… := by apply Set.eq_empty_iff_forall_notMem.mpr intro z hz apply hz.1 simpa using hz.2 (1 : π“ž K) (by simp [hm]) simp [cmValues, ht] /-- Every actual classical value occurs in the common recipe at its own modulus. The field generated by the named values is exactly that ray field. -/ def ImaginaryQuadraticBenchmark (C : ClassFieldTheory K) {R : Recipe} {F : R.Functions} (S : βˆ€ m : Modulus K, R.Specialization F m) : Prop := ImaginaryQuadratic K β†’ (βˆƒ L : PeriodPair, FullIntegerLattice K L) ∧ βˆ€ L : PeriodPair, FullIntegerLattice K L β†’ latticeDiscriminant L β‰  0 ∧ βˆ€ m : Modulus K, cmValues m L βŠ† (S m).values ∧ IntermediateField.adjoin K (cmValues m L) = C.rayField m /-- One recipe per embedded field, fixed across all moduli and before any class-field witness. Each clause uses the same Artin maps and ray fields. -/ def Hilbert12Combined : Prop := βˆ€ (K : Subfield β„‚) [NumberField K], βˆƒ (R : Recipe) (F : R.Functions) (S : βˆ€ m : Modulus K, R.Specialization F m), Nonempty (ClassFieldTheory K) ∧ βˆ€ C : ClassFieldTheory K, (βˆ€ m, RayValueContract C m (S m)) ∧ Nonempty (ArithmeticClassification C) ∧ RationalBenchmark C S ∧ ImaginaryQuadraticBenchmark C S /-- Forgetting the additional obligations recovers the supplied analytic target. -/ theorem Hilbert12Combined.toKroneckerType (h : Hilbert12Combined) : Hilbert12KroneckerType := by intro K _ obtain ⟨R, F, S, hC, hAll⟩ := h K exact ⟨R, F, S, hC, fun C => (hAll C).1⟩ end end Hilbert12