Contents
PrimitiveCharacterAPI.lean
Statement index · Original Lean file
1
import Thesis.Dirichlet23/-!4# Primitive-character API around Lemma 2.756Swarm `smwl2pri6`, member `m13`, direction (m).78`Thesis/Dirichlet.lean` states the reverse direction of Lemma 2.79(`primitiveAssociate_changeLevel`) as a dependent equality in the sigma type `𝒳(N)`:10the level `(changeLevel hd χ).conductor` and `d` are equal as numbers but not11definitionally, so the character components live in propositionally equal types only.12This file supplies1314* the two generic cast-free gadgets that make such comparisons routine15 (`heq_of_forall_intCast`, `sigmaSubtype_ext`),16* the pointwise identity behind the reverse direction17 (`primitiveCharacter_changeLevel_apply_intCast`, `primitiveCharacter_apply_intCast`),18* and the consequences of the bijection that downstream chapters use: injectivity of19 `changeLevelPrimitive`, uniqueness of a primitive character in terms of the character it20 induces (`conductor_eq_of_changeLevel_eq`, `heq_of_changeLevel_eq`), and the fibre form21 `primitiveAssociate_eq_iff`.2223Nothing here uses `sorry`, `axiom`, `opaque` or `native_decide`.24-/2526namespace Thesis2728noncomputable section2930open DirichletCharacter3132/-- A primitive Dirichlet character agrees, pointwise on `ℤ`, with its own primitive33character. Values on `ℤ` are level-agnostic (`ℤ → R`), so no cast is needed. -/34lemma primitiveCharacter_apply_intCast {R : Type*} [CommMonoidWithZero R] [Nontrivial R]35 {d : ℕ} {χ : DirichletCharacter R d} (hχ : IsPrimitive χ) (a : ℤ) :36 χ.primitiveCharacter a = χ a := by37 have hc : χ.conductor = d := (isPrimitive_def _).mp hχ38 by_cases ha : IsCoprime a d39 · exact primitiveCharacter_apply_of_isCoprime (χ := χ) ha40 · rw [(apply_eq_zero_iff (χ := χ.primitiveCharacter) a).mpr (by rwa [hc]),41 (apply_eq_zero_iff (χ := χ) a).mpr ha]4243/-- Inducing a primitive character `χ` of level `d ∣ N` to level `N` and then passing to44the primitive character returns `χ`, pointwise on `ℤ`. -/45lemma primitiveCharacter_changeLevel_apply_intCast {R : Type*} [CommMonoidWithZero R]46 [Nontrivial R] {N d : ℕ} [NeZero N] {hd : d ∣ N} {χ : DirichletCharacter R d}47 (hχ : IsPrimitive χ) (a : ℤ) :48 (changeLevel hd χ).primitiveCharacter a = χ a := by49 rw [primitiveCharacter_changeLevel_apply hd χ a, primitiveCharacter_apply_intCast hχ a]5051/-- Dirichlet characters on propositionally equal levels that agree on every integer are52heterogeneously equal. (The integers map onto `ZMod n`, so they detect the character.) -/53lemma heq_of_forall_intCast {R : Type*} [CommMonoidWithZero R] {n m : ℕ} (h : n = m)54 {χ : DirichletCharacter R n} {ψ : DirichletCharacter R m}55 (H : ∀ a : ℤ, χ a = ψ a) : HEq χ ψ := by56 subst h57 refine heq_of_eq (MulChar.ext' ?_)58 intro x59 obtain ⟨a, rfl⟩ := ZMod.intCast_surjective x60 exact H a6162/-- Dependent sigma-cast glue for `𝒳(N)`: two members whose levels are equal and whose63character components are heterogeneously equal coincide. -/64lemma sigmaSubtype_ext {R : Type*} [CommMonoidWithZero R] {N : ℕ}65 {a b : {d : ℕ // d ∣ N}}66 (hab : a = b)67 {x : {χ : DirichletCharacter R a.1 // IsPrimitive χ}}68 {y : {χ : DirichletCharacter R b.1 // IsPrimitive χ}}69 (hxy : HEq x.1 y.1) :70 (⟨a, x⟩ : Σ d : {d : ℕ // d ∣ N}, {χ : DirichletCharacter R d // IsPrimitive χ}) =71 ⟨b, y⟩ := by72 cases hab73 rw [Subtype.ext (eq_of_heq hxy)]7475/-- `changeLevelPrimitive : 𝒳(N) → DirichletCharacter ℂ N` is injective: the level and the76primitive character are recovered from the induced character. -/77lemma changeLevelPrimitive_injective (N : ℕ) [NeZero N] :78 Function.Injective (changeLevelPrimitive (N := N)) := by79 intro x y hxy80 calc x = primitiveAssociate (changeLevelPrimitive x) := (primitiveAssociate_changeLevel x).symm81 _ = primitiveAssociate (changeLevelPrimitive y) := by rw [hxy]82 _ = y := primitiveAssociate_changeLevel y8384/-- A primitive character of level dividing `N` is determined by the character it induces85at level `N`: its level is forced by the conductor. -/86theorem conductor_eq_of_changeLevel_eq {N d₁ d₂ : ℕ} [NeZero N]87 (h₁ : d₁ ∣ N) (h₂ : d₂ ∣ N) {χ₁ : DirichletCharacter ℂ d₁}88 {χ₂ : DirichletCharacter ℂ d₂} (hp₁ : IsPrimitive χ₁) (hp₂ : IsPrimitive χ₂)89 (H : changeLevel h₁ χ₁ = changeLevel h₂ χ₂) : d₁ = d₂ := by90 have e₁ : (changeLevel h₁ χ₁).conductor = d₁ := by91 rw [conductor_changeLevel, (isPrimitive_def _).mp hp₁]92 have e₂ : (changeLevel h₂ χ₂).conductor = d₂ := by93 rw [conductor_changeLevel, (isPrimitive_def _).mp hp₂]94 rw [← e₁, ← e₂, H]9596/-- Two primitive characters inducing the same character at a common level agree, up to97the (forced) equality of their levels. -/98theorem heq_of_changeLevel_eq {N d₁ d₂ : ℕ} [NeZero N]99 (h₁ : d₁ ∣ N) (h₂ : d₂ ∣ N) {χ₁ : DirichletCharacter ℂ d₁}100 {χ₂ : DirichletCharacter ℂ d₂} (hp₁ : IsPrimitive χ₁) (hp₂ : IsPrimitive χ₂)101 (H : changeLevel h₁ χ₁ = changeLevel h₂ χ₂) : HEq χ₁ χ₂ := by102 have key : ∀ a : ℤ, χ₁ a = χ₂ a := by103 intro a104 rw [← primitiveCharacter_apply_intCast hp₁ a,105 ← primitiveCharacter_changeLevel_apply h₁ χ₁ a, H,106 primitiveCharacter_changeLevel_apply h₂ χ₂ a, primitiveCharacter_apply_intCast hp₂ a]107 exact heq_of_forall_intCast (conductor_eq_of_changeLevel_eq h₁ h₂ hp₁ hp₂ H) key108109/-- **Fibre form of Lemma 2.7.** The primitive associate of `ψ` is the pair `(d, χ)` exactly110when `ψ` is induced from `χ`: the level-`N` character group is partitioned by the primitive111characters of the divisors of `N`, each fibre being the single character `changeLevel hd χ`. -/112theorem primitiveAssociate_eq_iff {N : ℕ} [NeZero N] (ψ : DirichletCharacter ℂ N)113 (d : ℕ) (hd : d ∣ N) {χ : DirichletCharacter ℂ d} (hχ : IsPrimitive χ) :114 primitiveAssociate ψ = ⟨⟨d, hd⟩, ⟨χ, hχ⟩⟩ ↔ ψ = changeLevel hd χ := by115 constructor116 · intro H117 have := congrArg changeLevelPrimitive H118 rw [changeLevel_primitiveAssociate] at this119 simpa only [changeLevelPrimitive] using this120 · intro H121 subst H122 exact primitiveAssociate_changeLevel ⟨⟨d, hd⟩, ⟨χ, hχ⟩⟩123124end125126end Thesis