import OAI.LinearAlgebra.CirculantHadamard.LocalComparisonInduction import OAI.LinearAlgebra.CirculantHadamard.CyclotomicFactorDivision import OAI.LinearAlgebra.CirculantHadamard.CyclicEvaluationProjection import OAI.LinearAlgebra.CirculantHadamard.RamifiedLocal namespace OAI universe uA /-! # Local character comparison in the actual cyclotomic quotient Starting with a characteristic-zero DVR whose maximal ideal is generated by the rational prime `p`, all ramified rings needed by the induction are constructed as the actual cyclotomic quotients. No projection-divisibility, comparison, or existence-of-valuation premise is taken from the caller. The conclusion uses membership in the ideal generated by `root - 1` to state residue one. This is independent of how a local-ring instance is installed and can be transported directly to a later localization. -/ noncomputable section namespace CirculantHadamard.LocalComparison open CyclicRing Polynomial variable (A : Type uA) [CommRing A] /-- The fixed primitive-order-`p` root used at every induction level. -/ def orderPRoot (p : ℕ) : RamifiedLocal.Extension A p 0 := AdjoinRoot.root (cyclotomic (p ^ (0 + 1)) A) theorem orderPRoot_pow (p : ℕ) : orderPRoot A p ^ p = 1 := by calc orderPRoot A p ^ p = orderPRoot A p ^ (p ^ (0 + 1)) := congrArg (fun n : ℕ => orderPRoot A p ^ n) (by simp) _ = 1 := cyclotomicAdjoinRoot_pow (R := A) (p ^ (0 + 1)) theorem orderPRoot_pow_level (p e : ℕ) : orderPRoot A p ^ (p ^ (e + 1)) = 1 := by calc orderPRoot A p ^ (p ^ (e + 1)) = orderPRoot A p ^ (p * p ^ e) := congrArg (fun n : ℕ => orderPRoot A p ^ n) (pow_succ' p e) _ = (orderPRoot A p ^ p) ^ (p ^ e) := pow_mul _ _ _ _ = 1 := by rw [orderPRoot_pow, one_pow] /-- Actual order-`p` evaluation of an element of the cyclic group ring of order `p ^ (e + 1)`. -/ def orderPValue (p e : ℕ) [NeZero p] : Elem A (p ^ (e + 1)) →ₐ[A] RamifiedLocal.Extension A p 0 := evaluateAt (p ^ (e + 1)) (orderPRoot A p) (orderPRoot_pow_level A p e) @[simp] theorem orderPValue_scalar (p e : ℕ) [NeZero p] (a : A) : orderPValue A p e (scalar (p ^ (e + 1)) a) = algebraMap A (RamifiedLocal.Extension A p 0) a := (orderPValue A p e).commutes a theorem orderPValue_projection (p e : ℕ) [NeZero p] (F : Elem A (p ^ (e + 2))) : orderPValue A p e (cyclicProjection A (pow_dvd_pow p (Nat.le_succ (e + 1))) F) = orderPValue A p (e + 1) F := evaluateAt_cyclicProjection _ _ _ _ F /-- The conclusion of comparison, expressed by an actual unit and membership in the actual ramified maximal ideal. -/ def OrderPCompared (p e : ℕ) [NeZero p] (F : Elem A (p ^ (e + 1))) : Prop := ∃ u : (RamifiedLocal.Extension A p 0)ˣ, orderPValue A p e F = (u : RamifiedLocal.Extension A p 0) * algebraMap A (RamifiedLocal.Extension A p 0) (augmentation (p ^ (e + 1)) F) ∧ (u : RamifiedLocal.Extension A p 0) - 1 ∈ Ideal.span {RamifiedLocal.uniformizer A p 0} section DVR variable [IsDomain A] [CharZero A] [IsDiscreteValuationRing A] /-- Character comparison with every ramified extension constructed from the input DVR. Both factors are compared, with matching group/scalar exponents. -/ theorem local_character_comparison (p : ℕ) [NeZero p] (hp : p.Prime) (hmax : IsLocalRing.maximalIdeal A = Ideal.span {(p : A)}) (e : ℕ) (b : Aˣ) (F K : Elem A (p ^ (e + 1))) (hFK : F * K = scalar (p ^ (e + 1)) ((p : A) ^ (e + 1) * (b : A))) : OrderPCompared A p e F ∧ OrderPCompared A p e K := by let : IsDomain (RamifiedLocal.Extension A p 0) := RamifiedLocal.isDomain A hp 0 hmax let : IsLocalRing (RamifiedLocal.Extension A p 0) := RamifiedLocal.isLocalRing A hp 0 hmax have hpA : Prime (p : A) := ((IsDiscreteValuationRing.irreducible_iff_uniformizer (p : A)).mpr hmax).prime have hpS : algebraMap A (RamifiedLocal.Extension A p 0) (p : A) ≠ 0 := by intro h exact hpA.ne_zero (RamifiedLocal.algebraMap_injective A hp 0 (by simpa only [map_zero] using h)) have hroot : IsLocalRing.residue (RamifiedLocal.Extension A p 0) (orderPRoot A p) = 1 := by have hpi : RamifiedLocal.uniformizer A p 0 ∈ IsLocalRing.maximalIdeal (RamifiedLocal.Extension A p 0) := by rw [RamifiedLocal.maximalIdeal_eq_span A hp 0 hmax] exact Ideal.subset_span (Set.mem_singleton _) have hz := (IsLocalRing.residue_eq_zero_iff _).mpr hpi simpa only [RamifiedLocal.uniformizer, orderPRoot, map_sub, map_one, sub_eq_zero] using hz have hc := comparison_induction p (algebraMap A (RamifiedLocal.Extension A p 0)) hpA hpS (fun k => (orderPValue A p k).toRingHom) (fun k a => orderPValue_scalar A p k a) (by intro U change IsLocalRing.residue (RamifiedLocal.Extension A p 0) (orderPValue A p 0 U) = IsLocalRing.residue (RamifiedLocal.Extension A p 0) (algebraMap A (RamifiedLocal.Extension A p 0) (augmentation (p ^ 1) U)) simp only [orderPValue, evaluateAt_apply, augmentation_apply, map_sum, map_mul, map_pow, hroot, one_pow, mul_one]) (fun k U => orderPValue_projection A p k U) (by intro k c U V hUV let : IsDomain (RamifiedLocal.Extension A p (k + 1)) := RamifiedLocal.isDomain A hp (k + 1) hmax let : IsLocalRing (RamifiedLocal.Extension A p (k + 1)) := RamifiedLocal.isLocalRing A hp (k + 1) hmax let : IsDiscreteValuationRing (RamifiedLocal.Extension A p (k + 1)) := RamifiedLocal.isDiscreteValuationRing A hp (k + 1) hmax have hpR : (p : RamifiedLocal.Extension A p (k + 1)) ≠ 0 := by intro h apply hpA.ne_zero apply RamifiedLocal.algebraMap_injective A hp (k + 1) simpa only [map_natCast, map_zero] using h exact projected_factor_divisible hp hpR (Nat.mul_pos (Nat.sub_pos_of_lt hp.one_lt) (pow_pos hp.pos (k + 1))) (RamifiedLocal.addVal_prime A hp (k + 1) hmax) c U V hUV) e b F K hFK have toCompared {U : Elem A (p ^ (e + 1))} (hU : ResidueOneAssociated (IsLocalRing.residue (RamifiedLocal.Extension A p 0)) (orderPValue A p e U) (algebraMap A (RamifiedLocal.Extension A p 0) (augmentation (p ^ (e + 1)) U))) : OrderPCompared A p e U := by obtain ⟨u, hu, hres⟩ := hU refine ⟨u, hu, ?_⟩ rw [← RamifiedLocal.maximalIdeal_eq_span A hp 0 hmax] apply (IsLocalRing.residue_eq_zero_iff _).mp rw [map_sub, hres, map_one, sub_self] exact ⟨toCompared hc.1, toCompared hc.2⟩ omit [IsDiscreteValuationRing A] in /-- The augmentation denominators used in the corresponding ratio statement are nonzero in the coefficient DVR. -/ theorem local_character_comparison_denominators [IsDiscreteValuationRing A] (p : ℕ) (hp : p.Prime) (e : ℕ) (b : Aˣ) (F K : Elem A (p ^ (e + 1))) (hFK : F * K = scalar (p ^ (e + 1)) ((p : A) ^ (e + 1) * (b : A))) : augmentation (p ^ (e + 1)) F ≠ 0 ∧ augmentation (p ^ (e + 1)) K ≠ 0 := augmentation_ne_zero_of_scalar_product (Nat.cast_ne_zero.mpr hp.ne_zero) b F K hFK end DVR end CirculantHadamard.LocalComparison end end OAI