# Roadmap: quadratic characters and finite reduction of quadratic orders **Summary.** A Dirichlet character whose values are all real takes only the values 0, 1 and −1. Following Mathlib, such characters are called quadratic; the principal character is one of them, whereas Montgomery and Vaughan reserve the word for exact order two. This roadmap builds the elementary dictionary between these characters, fundamental discriminants, and quadratic rings reduced modulo an integer. Characters have complex values and positive level. Here `ℤ[ω]` has basis `1, ω` with `ω² = a + bω`, and `ℤ[√r]` is the case `ω² = r` for any integer `r`, squarefree or not: the order presented by `ω`, not the maximal order of `ℚ(√r)`. The first layer works with characters alone. For an odd prime `p` and every `k ≥ 0`, a character of level `p^k` is quadratic exactly when it is principal or, for `k ≥ 1`, the Legendre symbol modulo `p` read at level `p^k`. At level `2^k` the quadratic characters are the principal one, the character `χ₄` of conductor 4 when `k ≥ 2`, and the two characters `χ₈` and `χ₈′ = χ₄χ₈` of conductor 8 when `k ≥ 3`. At any level, the conductor of a quadratic character is the product of its local conductors. The layer's main theorem attaches a discriminant to every quadratic character. A fundamental discriminant `D` is either a squarefree integer `≡ 1 (mod 4)`, including 1, or `4d` with `d` squarefree and `d ≢ 1 (mod 4)`. Its character `χ_D` has level `|D|` and equals the Legendre symbol `(D/p)` at an odd prime `p`. Every quadratic character `χ` of level `N` agrees, at every integer prime to `N`, with `χ_D` for exactly one fundamental discriminant `D` whose absolute value is the conductor of `χ`. This `D` is `χ(−1)` times the conductor. For instance, `χ₄` times the Legendre symbol modulo 3 has conductor 12 and `D = 12`. The second layer, independent of the first, reduces `ℤ[ω]` modulo any natural number `m`. Coordinatewise reduction is a surjective ring map onto the quadratic algebra over `ℤ/m` with the reduced parameters. Its kernel is the ideal `(m)`, so `ℤ[ω]/(m)` is isomorphic to that algebra, also for `m = 0` and `m = 1`. For `m > 0` the quotient has `m²` elements. The layer also compares `ℤ[√d]` with `ℤ[(1 + √d)/2]` for `d ≡ 1 (mod 4)`: the natural map induces an isomorphism modulo every odd `m`, but not modulo 2. The third layer works over finite fields, then reduces modulo a prime. Over a finite field `F` with `Q` elements, let `F[ω]` have `ω² = r`. If `r` is not a square, `F[ω]` is a field with `Q²` elements and every `z = x + yω` satisfies `z^Q = x − yω`. If `Q` is odd and `r` is a nonzero square, `F[ω]` is isomorphic to `F × F` and `z^Q = z`. Reduction gives the integral form: if the integer `r` is not a square modulo an odd prime `p`, then `(u + v√r)^p ≡ u − v√r (mod p)` coefficientwise for all integers `u, v`. Inertness in the maximal order does not suffice: 2 is inert in `ℚ(√5)`, yet the congruence fails in `ℤ[√5]` at 2. The fourth layer works over `ℚ` and `ℂ`, and uses the second only through the inclusion of `ℤ[ω]` in `ℚ[ω]`. For rational `r` and `ω² = r`, every `ℚ`-algebra map `σ` from `ℚ[ω]` to `ℂ` satisfies `|σ(u + vω)| ≤ |u| + |v|√|r|`, with no hypothesis on `r`. When `r` is not a square, `ℚ[ω]` is the field `ℚ(√r)` and every such map is injective. The discriminant theorem builds on [AnalyticNumberTheoryPartI](../AnalyticNumberTheoryPartI/README.md), which identifies a primitive nonprincipal quadratic character of level `q` with `χ_D` for `D = χ(−1)q`. This roadmap adds the principal and imprimitive cases and the uniqueness. [ClassicalArithmeticCompletion](../ClassicalArithmeticCompletion/README.md) provides the primitivity of `χ₄`, `χ₈`, `χ₈′` and the Legendre characters, and shows that a primitive quadratic conductor has squarefree odd part. The Tau Ceti library provides `χ_D` itself, the criterion for `(p)` to be maximal in `ℤ[ω]`, and a complex embedding for `r ≤ 0`. The third layer's congruence needs no Galois theory; Tau Ceti's maximal-order Frobenius dictionary serves only for comparison. The roadmap is this README; `Suggested.lean` states its headline theorems in Lean. ## Conventions Characters are Mathlib's `DirichletCharacter R N`; the level `N` is positive throughout, carried as `[NeZero N]`. A character is quadratic in the sense of `MulChar.IsQuadratic`: its values lie in `{0, 1, −1}`. This includes the principal character, whereas Montgomery–Vaughan's "quadratic" means exact order two; their "real" (all values real) is Mathlib's quadratic for complex characters (mv-mnt1-ch9, §9.3, p. 295). A real complex character means `∀ a, (χ a).im = 0`. The conductor is `DirichletCharacter.conductor`, primitivity is `DirichletCharacter.IsPrimitive`, and the primitive character inducing `χ` is `χ.primitiveCharacter`, of level `χ.conductor`. Fundamental discriminants are `Int.IsFundamentalDiscr`, which includes `1`; `fundamentalDiscriminantChar 1` is the trivial character of level `1`. Write `D` for a fundamental discriminant, `d` for a squarefree radicand, `q` for a conductor, `N` for a level, `m` for a modulus, `p` for a prime and `Q` for the cardinality of a finite field. Quadratic algebras are Mathlib's `QuadraticAlgebra R a b`, with generator `ω` satisfying `ω² = a + bω`, coordinates `re` and `im` in the basis `1, ω`, norm `QuadraticAlgebra.norm` with `norm (x + yω) = x² + bxy − ay²`, trace `QuadraticAlgebra.trace` with `trace (x + yω) = 2x + by`, and conjugation `star (x + yω) = (x + by) − yω`. The order written `ℤ[√r]` is `QuadraticAlgebra ℤ r 0` for an integer `r`, so `star ω = −ω` there; this is the presented order, not the maximal order of `ℚ(√r)`. For positive `r` conjugation exchanges the two real embeddings and is not complex conjugation. The parameter `r` is any integer, and the statements that need it nonsquare say so; `r = 5` and `r = 20` are both in scope. Reduction modulo `m` is `QuadraticAlgebra.mapRingHom (Int.castRingHom (ZMod m)) a b`, the coefficientwise map `ℤ[ω] → (ℤ/m)[ω̄]` with `ω ↦ ω̄`, written `ρ_m` in prose. The ideal `(m)` of `QuadraticAlgebra ℤ a b` is `Ideal.span {(m : QuadraticAlgebra ℤ a b)}`. Finite fields are carried as `[Field F] [Finite F]` with `Q = Nat.card F`; a prime field is `ZMod p` with `[Fact p.Prime]`. ## Layer 1: quadratic characters, local conductors and the primitive discriminant ### 1.1 Quadratic characters at an odd prime-power level Prove `odd_prime_power_classification`: for an odd prime `p` and every `k ≥ 0`, a Dirichlet character `χ` of level `p^k` with complex values is quadratic if and only if it is principal or, when `p ∣ p^k`, that is `k ≥ 1`, the lift by `changeLevel` of the Legendre character `quadraticChar (ZMod p)` with complex values (mv-mnt1-ch9, §9.3, pp. 295–296). At `k = 0` the level is `1` and the only character is principal. The listed characters are quadratic by `quadraticChar_isQuadratic`, `MulChar.IsQuadratic.comp` and Tau Ceti `isQuadratic_changeLevel`. The route for the converse: `χ* = χ.primitiveCharacter` is primitive of level `χ.conductor`, a divisor `p^j` of `p^k`, and quadratic, because by `changeLevel_primitiveCharacter` its value at a unit is the value of `χ` at a unit lifting it (`ZMod.unitsMap_surjective`) and it vanishes at nonunits. ClassicalArithmeticCompletion §1.21 makes the odd part `p^j` of its level squarefree, so `j ≤ 1`. If `j = 0`, then `χ = 1` (`eq_one_iff_conductor_eq_one`). If `j = 1`, then `χ*` is a nonprincipal quadratic character modulo `p`. It is trivial on the squares, which form the subgroup of index two of `(ℤ/p)ˣ` (`ZMod.euler_criterion`); it takes the value `−1` at some unit, necessarily a nonsquare, and hence at every nonsquare, since two nonsquares differ by a square. So `χ*` is the Legendre character, and `χ` is its lift by `changeLevel_primitiveCharacter`. - Conductor: a quadratic character of level `p^k` has conductor `1` or `p`; the lifted Legendre character has conductor `p` by ClassicalArithmeticCompletion §1.5 with `conductor_ringHomComp` and `conductor_changeLevel`. - The nonprincipal quadratic character at level `p^k`, `k ≥ 1`, takes at an integer `n` the value `legendreSym p n`, including `0` when `p ∣ n`. - For `k ≥ 1` the quadratic characters at level `p^k` form a group of order two under multiplication; at `k = 0` it has order one. - A real complex character at level `p^k` is quadratic: a value of a finite-order character on a unit has absolute value one, and a real such value is `±1`. **Checks.** - At level `9` there are five nonprincipal characters; the one of order two has conductor `3`, and the two of order three are primitive. Counting conductors `{1, 3}` for every nonprincipal character at level `9` would be wrong. - At level `3` the quadratic characters are the principal character and the Legendre character, with values `1, 1, 0` and `1, −1, 0` at `1, 2, 3`; the Legendre character has conductor `3`. - At level `25` the nonprincipal quadratic character takes the value `−1` at `2` (since `2` is not a square modulo `5`) and `0` at `5` and `10`; its conductor is `5`, not `25`. - At `k = 0` the level is `1`, `p ∤ 1`, and the second alternative is void: the only character is principal. A classification offering the lift of the Legendre character at every `k` would assert a second quadratic character at level `1`. - The hypothesis `p ≠ 2` is needed: `quadraticChar (ZMod 2)` is the trivial character, and at level `4` the quadratic character `χ₄` is neither principal nor a lift of it. *Needs:* Mathlib `DirichletCharacter.changeLevel`, `DirichletCharacter.changeLevel_primitiveCharacter`, `DirichletCharacter.primitiveCharacter_isPrimitive`, `DirichletCharacter.conductor_dvd_level`, `DirichletCharacter.eq_one_iff_conductor_eq_one`, `DirichletCharacter.conductor_changeLevel`, `DirichletCharacter.changeLevel_injective`, `ZMod.unitsMap_surjective`, `ZMod.euler_criterion`, `quadraticChar`, `quadraticChar_isQuadratic`, `quadraticChar_ne_one`, `legendreSym`, `MulChar.ringHomComp`, `MulChar.map_nonunit`, `MulChar.IsQuadratic`, `MulChar.IsQuadratic.comp`; Tau Ceti `isQuadratic_changeLevel`, `conductor_ringHomComp`; ClassicalArithmeticCompletion §1.21, and §1.5 for the conductor. ### 1.2 Quadratic characters at a power-of-two level Prove `two_power_classification`: for every `k ≥ 0`, a Dirichlet character `χ` of level `2^k` with complex values is quadratic if and only if it is principal, or `4 ∣ 2^k` and `χ` is the lift of `ZMod.χ₄`, or `8 ∣ 2^k` and `χ` is the lift of `ZMod.χ₈` or of `ZMod.χ₈'`, each with complex values (mv-mnt1-ch9, §9.3, p. 296). So there is one quadratic character at levels `1` and `2`, two at level `4` and four at every level `2^k` with `k ≥ 3`. The listed characters are quadratic as in §1.1. The route for the converse: `χ* = χ.primitiveCharacter` is primitive and quadratic, as in §1.1, of level `2^j` dividing `2^k`, and Tau Ceti `IsPrimitive.factorization_two_eq_zero_or_two_or_three` gives `j ∈ {0, 2, 3}`. If `j = 0`, then `χ = 1`. If `j = 2`, then `χ*` is the nonprincipal character modulo `4`, which is `χ₄`. If `j = 3`, then `χ*` is one of the four characters of `(ℤ/8)ˣ = {1, 3, 5, 7}`, each fixed by its values `±1` at `3` and `5`; primitivity excludes the two with `χ*(5) = 1`, which factor through `4` since `5 ≡ 1 (mod 4)`, and leaves `χ₈` and `χ₈'`. Conclude by `changeLevel_primitiveCharacter`. - The four quadratic characters at level `2^k`, `k ≥ 3`, have the value table at odd residues: the principal character is `1`; `χ₄(n) = (−1)^((n−1)/2)`; `χ₈(n) = (−1)^((n²−1)/8)`; `χ₈'(n) = χ₄(n) χ₈(n)`. They vanish at even `n`. - Conductor: the four lifts have conductors `1`, `4`, `8`, `8` by ClassicalArithmeticCompletion §1.4 with `conductor_ringHomComp` and `conductor_changeLevel`; so a quadratic character of level `2^k` has conductor `1`, `4` or `8`. - A real complex character at level `2^k` is quadratic. **Checks.** - At level `2` the principal character is the only character; there is no primitive character at level `2` (Tau Ceti `IsPrimitive.factorization_two_ne_one`), and since `4 ∤ 2` the classification admits only the principal character there. - At level `16` the four quadratic characters take, at `3, 5, 7`, the values `1, 1, 1`; `−1, 1, −1`; `−1, −1, 1`; `1, −1, −1`. A character with values `−1, −1, −1` at `3, 5, 7` does not exist: `χ(3)χ(5) = χ(15) = χ(−1)` and `χ(7) = χ(−1)χ(9) = χ(−1)χ(5)² = χ(−1)`, so `χ(3)χ(5) = χ(7)`, which the values `(−1)(−1) ≠ −1` violate. - The conductor `2` never occurs, and neither does `16`: the character of order `4` at level `16` sending `5 ↦ i` is primitive but not quadratic, and the classification at level `16` lists four characters, not the eight characters of `(ℤ/16)ˣ`. *Needs:* Tau Ceti `DirichletCharacter.IsPrimitive.factorization_two_eq_zero_or_two_or_three`, `isQuadratic_changeLevel`, `conductor_ringHomComp`; Mathlib `ZMod.χ₄`, `ZMod.χ₈`, `ZMod.χ₈'`, `DirichletCharacter.changeLevel`, `DirichletCharacter.changeLevel_primitiveCharacter`, `DirichletCharacter.primitiveCharacter_isPrimitive`, `DirichletCharacter.factorsThrough_iff_ker_unitsMap`, `DirichletCharacter.conductor_changeLevel`, `DirichletCharacter.changeLevel_injective`, `ZMod.unitsMap_surjective`, `MulChar.ringHomComp`, `MulChar.map_nonunit`, `MulChar.IsQuadratic`, `MulChar.IsQuadratic.comp`; ClassicalArithmeticCompletion §1.4 for the conductors. ### 1.3 The conductor of a quadratic character at any level For a quadratic Dirichlet character `χ` of level `N > 0` with complex values, prove that `χ` is the product, over the prime powers `p^k ∥ N`, of the lifts to level `N` of its local factors, that each local factor is quadratic, and that the conductor of `χ` is the product of the local conductors (mv-mnt1-ch9, Lemma 9.3, p. 283, and §9.3, p. 295). The local factor at `p` is the character of level `p^k` whose value at a unit `a` modulo `p^k` is `χ(x)` for the unit `x` modulo `N` with `x ≡ a (mod p^k)` and `x ≡ 1 (mod N/p^k)`; it is quadratic because its values on units are values of `χ`. The splitting at one exact divisor is Tau Ceti `TauCeti.Nat.IsExactDivisor.eq_mul_comp_unitsMap`, applied prime by prime; the conductor of the product is `conductor_prod_of_pairwise_coprime`, the local conductors being powers of distinct primes, and by §§1.1–1.2 each local conductor is `1` or `p` at odd `p` and `1`, `4` or `8` at `p = 2`. For the primitive character `χ*` the shape of its level, odd part squarefree and 2-adic exponent `0`, `2` or `3`, is ClassicalArithmeticCompletion §1.21 with Tau Ceti `IsPrimitive.factorization_two_eq_zero_or_two_or_three`; by §1.4 this level is `|D|` for a fundamental discriminant `D`, and both signs occur (`D = 12` and `D = −3` have odd part `3`). - Local factors: for `p^k ∥ N`, the local factor at `p` is the restriction of `χ` along `a ↦ x`, read through Tau Ceti `TauCeti.Nat.IsExactDivisor.unitsEquivProd` at `p^k ∥ N`; the product over `p` of the lifts of the local factors to level `N` is `χ`. - `χ.conductor = ∏ (local conductor)`: by `conductor_prod_of_pairwise_coprime`, once each local conductor is shown to be the conductor of the lifted factor (`conductor_changeLevel`). **Checks.** - The principal character of level `6` has the principal characters of levels `2` and `3` as local factors and conductor `1 = 1 · 1`; it is `0` at `2` and at `3`, while its primitive character, of level `1`, is `1` there, so `χ` and `χ*` agree only at integers coprime to `6`. - At level `12`, `χ₄ · (Legendre mod 3)` has local conductors `4` and `3` and conductor `12`; it is the character of `D = 12`. The character `χ₄` lifted to level `12` has local conductors `4` and `1` and conductor `4`. - At level `45 = 9 · 5` the product of the quadratic characters modulo `9` and modulo `5` has conductor `15`, not `45`: the factor at `3` has conductor `3` by §1.1. *Needs:* §§1.1–1.2; Tau Ceti `TauCeti.Nat.IsExactDivisor.unitsEquivProd`, `TauCeti.Nat.IsExactDivisor.eq_mul_comp_unitsMap`, `conductor_mul_of_coprime`, `conductor_prod_of_pairwise_coprime`, `DirichletCharacter.IsPrimitive.factorization_two_eq_zero_or_two_or_three`, `MulChar.isQuadratic_prod`; Mathlib `DirichletCharacter.changeLevel`, `DirichletCharacter.conductor_changeLevel`, `DirichletCharacter.primitiveCharacter`; ClassicalArithmeticCompletion §1.21. ### 1.4 The primitive discriminant of a real character Prove `exists_unique_fundamental_discriminant`: for a quadratic Dirichlet character `χ` of any level `N > 0` with complex values there is exactly one fundamental discriminant `D` with `|D| = χ.conductor` such that `χ(n) = fundamentalDiscriminantCharCast ℂ D hD (n)` for every integer `n` coprime to `N` (mv-mnt1-ch9, Theorem 9.13, p. 297, for primitive `χ` of order two; the quadratic discriminants defined there on p. 296 are the integers that `Int.isFundamentalDiscr_iff_squarefree` describes). The principal character corresponds to `D = 1`. The route: `χ* = χ.primitiveCharacter` is primitive of level `q = χ.conductor`, which is nonzero (`conductor_ne_zero`), and quadratic, since by `changeLevel_primitiveCharacter` its values at units are values of `χ` at units (`ZMod.unitsMap_surjective`) and its values at nonunits are `0` (`MulChar.map_nonunit`). If `χ*` is principal, then `q = 1` and `D = 1` works; no other `D` has `|D| = 1`, as `−1` is not a fundamental discriminant. Otherwise `quadratic_character_eq_fundamentalDiscriminantChar` (AnalyticNumberTheoryPartI §0.34a) applied to `χ*` at level `q` gives the fundamental discriminant `D = χ*(−1) q`, so `|D| = q`, and `χ*(n) = fundamentalDiscriminantCharCast ℂ D hD (n)` at every integer `n`. At `n` coprime to `N` the left side is `χ(n)` (`primitiveCharacter_apply_of_isCoprime`), which gives existence. Uniqueness: two fundamental discriminants with the same absolute value and the same sign are equal, and the sign of any admissible `D` is `χ(−1)` by `fundamentalDiscriminantChar_neg_one` with `fundamentalDiscriminantCharCast_apply`, since `−1` is coprime to `N`. In particular `D = χ(−1) q`, as in the primitive case of AnalyticNumberTheoryPartI §0.34a. - A real complex character is quadratic, and conversely: `(∀ a, (χ a).im = 0) ↔ χ.IsQuadratic` for every Dirichlet character with complex values at a positive level, by the finite order of the values on units. - Naturality: if `N ∣ M` then `changeLevel χ` at level `M` has the same conductor and the same `D`, and the agreement at integers coprime to `M` follows from the agreement at integers coprime to `N`. - Both realizations: the integer-valued `fundamentalDiscriminantChar D hD` and its complex realization agree at every integer through `Int.castRingHom ℂ` (`fundamentalDiscriminantCharCast_apply`), so a consumer may read the conclusion with integer values. - Odd-prime dictionary for the two square-root parameters: every fundamental discriminant is `D = fundamentalDiscriminant d` for exactly one squarefree `d`, namely `d = D` when `D ≡ 1 (mod 4)` and `d = D/4` otherwise (`Int.isFundamentalDiscr_iff_squarefree` with `fundamentalDiscriminant_of_mod_four_eq_one` and `fundamentalDiscriminant_of_mod_four_ne_one`), and conversely `fundamentalDiscriminant d` is fundamental for every squarefree `d` (`isFundamentalDiscr_fundamentalDiscriminant`). For every odd prime `p`, `χ_D(p) = legendreSym p D = legendreSym p d`, including the value `0` at the odd primes dividing `D`, and `χ(p) = χ_D(p)` for `p ∤ N`; the middle equality holds because `D = c² d` with `c ∈ {1, 2}` prime to `p` (`exists_sq_mul_eq_fundamentalDiscriminant`, `legendreSym.mul`, `legendreSym.sq_one'`). This is the radicand form of AnalyticNumberTheoryPartI §0.34a at every level. A consumer needing Layer 3's nonsquare hypothesis for `r = d` or `r = D` reads it off a value `χ(p) = −1`. **Checks.** - `D = 1, −4, 8, −8, 5, −3, 12` are fundamental; `D = −4` and `D = 8` come from `χ₄` and `χ₈` at their own levels, `D = 12` from the conductor-`12` character of §1.3, and the sign `χ(−1)` separates `D = 12` from `D = −12`, which is not fundamental (`−12 = 4 · (−3)` with `−3 ≡ 1 (mod 4)`). - For `χ₄` lifted to level `12` the conductor is `4` and `D = −4`; the lifted character is `0` at `3` while `χ_(−4)(3) = −1`: the agreement holds only at integers coprime to `12`, as stated. - For the principal character at level `6`, `D = 1` and the agreement at `n = 5` reads `1 = 1`; taking `D = −3` would give `|D| = 3 ≠ 1 = χ.conductor`. - Uniqueness needs the sign: at conductor `8` the characters of `D = 8` and `D = −8` have the same `|D|` and are distinguished by `χ(−1)`; a statement asking only for `|D| = q` would have two solutions. - Odd-prime dictionary: `D = 12` has radicand `d = 3`, and at `p = 5`, `legendreSym 5 12 = legendreSym 5 2 = −1 = legendreSym 5 3`, while at `p = 3` both symbols are `0`; `D = −4` has radicand `d = −1`. The prime `2` is excluded: `χ_5(2) = χ₈(5) = −1`, while `legendreSym 2 5 = 1`, the quadratic character of `ZMod 2` being trivial on units. *Needs:* AnalyticNumberTheoryPartI §0.34a (`quadratic_character_eq_fundamentalDiscriminantChar`); Mathlib `DirichletCharacter.primitiveCharacter`, `DirichletCharacter.primitiveCharacter_isPrimitive`, `DirichletCharacter.changeLevel_primitiveCharacter`, `DirichletCharacter.primitiveCharacter_apply_of_isCoprime`, `DirichletCharacter.conductor_ne_zero`, `DirichletCharacter.eq_one_iff_conductor_eq_one`, `ZMod.unitsMap_surjective`, `MulChar.map_nonunit`, `Int.isFundamentalDiscr_iff_squarefree`; Tau Ceti `fundamentalDiscriminantCharCast`, `fundamentalDiscriminantCharCast_apply`, `fundamentalDiscriminantCharCast_eq_one_iff`, `fundamentalDiscriminantChar_neg_one`. For the odd-prime dictionary: Mathlib `legendreSym`, `legendreSym.mul`, `legendreSym.sq_one'`; Tau Ceti `fundamentalDiscriminantChar_natCast_eq_legendreSym`, `fundamentalDiscriminant`, `fundamentalDiscriminant_of_mod_four_eq_one`, `fundamentalDiscriminant_of_mod_four_ne_one`, `isFundamentalDiscr_fundamentalDiscriminant`, `exists_sq_mul_eq_fundamentalDiscriminant`. ### Examples The conductor-`12` character `χ₄ · (Legendre mod 3)` is the running example: its local conductors are `4` and `3`, its discriminant is `D = 12`, its values at `5, 7, 11` are `−1, −1, 1`, and lifting it to level `24` changes neither its conductor nor its discriminant. The principal character at level `6` is the degenerate example with `D = 1`. ### Dependencies Mathlib Dirichlet characters, conductors, primitive characters, the Legendre character and `ZMod.χ₄`, `ZMod.χ₈`, `ZMod.χ₈'`; Tau Ceti conductor multiplicativity, the 2-adic exponent of a primitive quadratic level, the Chinese remainder splitting at exact divisors, and the fundamental-discriminant character with its realizations and its radicand map; ClassicalArithmeticCompletion §§1.4, 1.5, 1.21; AnalyticNumberTheoryPartI §0.34a. No input from Layers 2–4. ## Layer 2: reduction of integral quadratic presentations modulo m ### 2.1 The reduction map and the ideal (m) For `A = QuadraticAlgebra ℤ a b` and any natural number `m`, the reduction `ρ_m = mapRingHom (Int.castRingHom (ZMod m)) a b : A →+* QuadraticAlgebra (ZMod m) ā b̄` is surjective (`mapRingHom_surjective`, as `ℤ → ℤ/m` is), sends `ω` to `ω̄`, and commutes with `star`. Define `reductionQuotientHom a b m : A ⧸ (m) →+* QuadraticAlgebra (ZMod m) ā b̄` as the map induced by `ρ_m` through `Ideal.Quotient.lift`; `ρ_m` kills `m` because `m = 0` in `ℤ/m`. Prove `reduction_kernel`: the kernel of `ρ_m` is the principal ideal `(m)` of `A`; and `bijective_reductionQuotientHom`: the induced map is a ring isomorphism `A/(m) ≃+* QuadraticAlgebra (ZMod m) ā b̄`. For a prime `m` and the presentation `ℤ[X]/(X² − bX − a)` of `A` this is the reduction step in the proof of Milne's Theorem 3.41 (milne-ant, proof of Theorem 3.41, p. 63), which identifies `A/pA` with `𝔽_p[X]/(X² − b̄X − ā)`; the statement here is the same identification for every `m`, including `m = 0` and `m = 1`. The route for the kernel: `z ∈ (m)` iff `m ∣ z.re` and `m ∣ z.im` (`Ideal.mem_span_singleton` and `algebraMap_dvd_iff`, after writing `(m : A)` as `algebraMap ℤ A m`), and `ρ_m z = 0` iff both coordinates vanish in `ℤ/m` (`QuadraticAlgebra.ext_iff` and `ZMod.intCast_zmod_eq_zero_iff_dvd`); this is the argument Tau Ceti uses for prime `m` inside `isMaximal_span_natCast_iff`. Bijectivity is injectivity of the lift, which is the kernel statement, with surjectivity of `ρ_m`. - Membership: `z ∈ (m) ↔ (m : ℤ) ∣ z.re ∧ (m : ℤ) ∣ z.im`, and the congruence form `z − w ∈ (m) ↔ z.re ≡ w.re ∧ z.im ≡ w.im (mod m)`. - Coordinates: `(ρ_m z).re = (z.re : ZMod m)` and `(ρ_m z).im = (z.im : ZMod m)` (`re_mapRingHom_apply`, `im_mapRingHom_apply`); `ρ_m (star z) = star (ρ_m z)` (`mapRingHom_star`); `norm (ρ_m z) = (norm z : ZMod m)` and `trace (ρ_m z) = (trace z : ZMod m)` (`norm_mapRingHom`, `trace_mapRingHom`); `ρ_m (P(ω)) = P̄(ω̄)` for an integer polynomial `P`, since `ρ_m` is a ring map with `ρ_m ω = ω̄`. - Composition: for `m ∣ n` the reduction `ρ_m` factors as the canonical map `ZMod n → ZMod m` applied coefficientwise after `ρ_n` (`mapRingHom_comp`), and the induced maps `A/(n) → A/(m)` compose accordingly; `ρ_0` is the identity on coordinates and injective (`mapRingHom_injective`), and the inclusion `A → QuadraticAlgebra ℚ a b` is injective with the same coordinates (`algebraMap_omega`). - The ring isomorphism `A/(m) ≃+* QuadraticAlgebra (ZMod m) ā b̄` is `RingEquiv.ofBijective` of the induced map; equivalently `(Ideal.quotEquivOfEq reduction_kernel).symm` followed by `RingHom.quotientKerEquivOfSurjective`. **Checks.** - `m = 0`: the kernel is the zero ideal and `A/(0)` is `A` itself; `ZMod 0 = ℤ` and `ρ_0` is the identity. A statement of the kernel with `m > 0` as a hypothesis would miss this case, which the theorem includes. - `m = 1`: `ZMod 1` is the zero ring, every `z` lies in `(1) = A`, and the quotient is the zero ring with one element `= 1²`. - `a = 5, b = 0, m = 2`: `ω̄² = 1` in `(ℤ/2)[ω̄]`, so `ρ_2(ω − 1)² = 0` while `ρ_2(ω − 1) ≠ 0`: the reduction of `ℤ[√5]` modulo `2` is the repeated-root algebra, not a field, although `2` is inert in the maximal order of `ℚ(√5)` (Milne, Example 3.44(iii), p. 63). The kernel statement is unaffected; §2.3 and §3.3 return to this example. - Coefficientwise divisibility is not divisibility of the norm: for `a = −1`, `z = 1 + ω` has norm `2`, so `2 ∣ norm z`, while `z ∉ (2)` since `2 ∤ z.re`. *Needs:* Mathlib `QuadraticAlgebra.mapRingHom`, `mapRingHom_surjective`, `mapRingHom_omega`, `mapRingHom_star`, `mapRingHom_comp`, `QuadraticAlgebra.ext_iff`, `algebraMap_dvd_iff`, `Ideal.mem_span_singleton'`, `Ideal.Quotient.lift`, `RingHom.quotientKerEquivOfSurjective`, `RingEquiv.ofBijective`, `ZMod.natCast_self`, `ZMod.intCast_zmod_eq_zero_iff_dvd`, `QuadraticAlgebra.re_mapRingHom_apply`, `im_mapRingHom_apply`, `mapRingHom_injective`, `norm_mapRingHom`, `trace_mapRingHom`, `algebraMap_omega`; the pinned proof pattern of Tau Ceti `isMaximal_span_natCast_iff`. ### 2.2 Cardinality and finite coordinate sets Prove `card_reduction_quotient`: for `m > 0`, `A/(m)` has exactly `m²` elements; this and the statements on coordinate sets below are elementary consequences of §2.1 and of the coordinate bijection `equivProd`. The route: transport along the isomorphism of §2.1 (`Nat.card_congr`), then `equivProd` and `Nat.card_prod` with `Nat.card_zmod`. For finite sets `U, V ⊂ ℤ` of coordinates, the set `{z ∈ A | z.re ∈ U ∧ z.im ∈ V}` is the image of `U × V` under the coordinate bijection and has `#U · #V` elements; when reduction modulo `m` is injective on `U` and on `V`, `ρ_m` is injective on this set, since `ρ_m z = ρ_m w` forces `z.re ≡ w.re` and `z.im ≡ w.im (mod m)`. A half-open interval `[t, t + m)` of integers reduces injectively modulo `m > 0`, because two of its elements differ by less than `m`; so do `[t, t + m]` with its right endpoint removed and any interval of at most `m` consecutive integers, while an interval of `m + 1` consecutive integers does not. - `Nat.card (A ⧸ (m)) = m²` for `m > 0`; the quotient is finite exactly when `m ≠ 0`. - For `U, V` with injective reduction, `ρ_m` restricted to the coordinate rectangle is injective, for every `m`; for `m > 0` the image has `#U · #V` elements in a set of size `m²`, hence `#U · #V ≤ m²`. At `m = 0` the bound fails: `U = V = {0}` reduces injectively and `1 > 0 = m²`, the value `0` being `Nat.card` of the infinite quotient `A/(0)`. - The interval criterion is stated with its exact endpoints: `Set.Ico t (t + m)` for `m > 0`, and `Set.Icc t (t + m − 1)` as the same set. **Checks.** - `a = 5, b = 0, m = 2`: the quotient has `4` elements, the classes of `0, 1, ω, 1 + ω`. - `a = 20, b = 0, m = 3`: the quotient has `9` elements; `20 ≡ 2 (mod 3)` is not a square, so it is the field with nine elements. This is the nonsquare, non-squarefree parameter in scope. - The singleton `U = V = {0}` reduces injectively for every `m`, including `m = 0`, where `#U · #V = 1 ≤ m² = 0` fails: the bound needs `m > 0`. The empty coordinate set gives the empty rectangle with `0 · #V = 0` elements. - `U = [0, m]` has `m + 1` elements and its endpoints `0` and `m` reduce to the same class: injectivity fails, so the interval criterion needs length at most `m`. *Needs:* §2.1; Mathlib `Nat.card_congr`, `Nat.card_prod`, `Nat.card_zmod`, `QuadraticAlgebra.equivProd`, `Set.InjOn`, `ZMod.intCast_eq_intCast_iff_dvd_sub`, `Set.ncard` of a product. ### 2.3 The presented order and its index-two enlargement modulo odd m For an integer `d ≡ 1 (mod 4)` let `B = QuadraticAlgebra ℤ ((d − 1)/4) 1`, the presentation of `ℤ[(1 + √d)/2]` with generator `ω'` satisfying `ω'² = ω' + (d − 1)/4`. Define `ι : QuadraticAlgebra ℤ d 0 →ₐ[ℤ] B` by `lift` at `2ω' − 1`, which squares to `d`. Then `(ι ω).im = 2`, so `ι` is injective by Mathlib `isRegular_im_omega_iff_injective`, `2` being regular in `ℤ`. Prove that the image of `ι` is the subgroup `{x + yω' | y even}` of index two, and that for every odd `m` the induced map `ℤ[√d]/(m) → B/(m)` is a ring isomorphism, while for `m = 2` it is neither injective nor surjective (Milne, Example 2.41, p. 39, for the integral basis `1, (1 + √d)/2` of `ℚ(√d)` when `d` is squarefree and `≡ 1 (mod 4)`). The route: `ι(x + yω) = (x − y) + 2yω'`, so the image is as stated. Modulo `m`, `ι` reduces to the `ℤ/m`-algebra map `QuadraticAlgebra (ZMod m) d̄ 0 → QuadraticAlgebra (ZMod m) c̄ 1`, `c = (d − 1)/4`, sending `ω` to `2ω' − 1`; by `isUnit_im_omega_iff_bijective` it is bijective exactly when `2` is a unit in `ℤ/m`, that is for odd `m`, and with §2.1 on both sides this is the induced map `ℤ[√d]/(m) → B/(m)`. At `m = 2` the element `2 = 0` is not regular, so the reduced map is not injective (`isRegular_im_omega_iff_injective`), and as both sides have four elements it is not surjective; explicitly its image is `{y even}`, and `ι(ω − 1) = 2ω' − 2 ∈ (2)B` while `ω − 1 ∉ (2)`. The hypothesis `d ≡ 1 (mod 4)` is needed for `B` to be defined over `ℤ`; squarefreeness of `d` is not needed for the comparison of the two presented orders and is used only to identify `B` with the maximal order, which is the supplier's statement, not this roadmap's. - `ι` commutes with `star`, norm and trace (`algHom_star`, `norm_algHom`, `trace_algHom`, as `ι` is injective), and with reduction modulo every `m` on both sides. - For odd `m`, the two quotients `ℤ[√d]/(m)` and `B/(m)` have `m²` elements each and `ι` induces an isomorphism between them. - For `m = 2`, the quotient `B/(2)` is the field with four elements when `d ≡ 5 (mod 8)` and `ℤ/2 × ℤ/2` when `d ≡ 1 (mod 8)`, while `ℤ[√d]/(2)` is the repeated-root algebra in both cases. **Checks.** - `d = 5`: `B = QuadraticAlgebra ℤ 1 1`, `ι(ω) = 2ω' − 1` and `(2ω' − 1)² = 4ω'² − 4ω' + 1 = 4(ω' + 1) − 4ω' + 1 = 5`. Modulo `3` both quotients have nine elements and are fields (`5 ≡ 2` is not a square modulo `3`). Modulo `2`, `B/(2)` is the field with four elements and `ℤ[√5]/(2)` is not reduced: the map is not injective. - `d = −3`: `B = QuadraticAlgebra ℤ (−1) 1`, the Eisenstein integers; `ι(ω) = 2ω' − 1` and `(2ω' − 1)² = 4(ω' − 1) − 4ω' + 1 = −3`. - `d = 5, m = 2` is the negative control for "inert in the maximal order implies the presented order is a field modulo `p`": `B/(2)` is a field and `ℤ[√5]/(2)` is not. *Needs:* §§2.1–2.2; Mathlib `QuadraticAlgebra.lift`, `isRegular_im_omega_iff_injective`, `isUnit_im_omega_iff_bijective`, `mapRingHom`, `algHom_star`, `norm_algHom`, `trace_algHom`; Milne, Example 2.41. ### Examples `ℤ[√5]` modulo `2`, `3` and `5` gives the three reduction types: the repeated-root algebra (and the index-two comparison fails), the field with nine elements (where the index-two comparison is an isomorphism), and the algebra with `ω̄² = 0` again at the ramified prime `5`. The parameter `20` modulo `3` shows that squarefreeness plays no role in Layer 2. ### Dependencies Mathlib quadratic algebras with `mapRingHom`, ideals and quotient rings, `ZMod` and `Nat.card`; Tau Ceti's inert criterion as the model of the kernel argument. No input from Layer 1. ## Layer 3: finite quadratic algebras and Frobenius ### 3.1 The trichotomy over a finite field For a finite field `F` with `Q = Nat.card F` elements and `r ∈ F`, classify `A = QuadraticAlgebra F r 0` by `r`; this is the elementary trichotomy for `F[X]/(X² − r)` according as `X² − r` has two distinct roots, none, or a double root in `F`, through the Chinese remainder theorem in the first case: if `r = u²` with `u ≠ 0` and `Q` is odd, then `algEquivProdOfSq u` is an algebra isomorphism `A ≃ₐ[F] F × F` with `ω ↦ (u, −u)`; if `r` is not a square, then `A` is a field (Mathlib's instance under `Fact (¬ IsSquare r)`), a quadratic extension of `F` with `Q²` elements; if `r = 0`, then `A ≃ₐ[F] DualNumber F` with `ω ↦ ε`, the repeated-root algebra, which is not reduced. Define the last equivalence by `lift` at `ε`, with inverse `DualNumber.lift`, and prove the three cases exhaustive for odd `Q`. In characteristic two every element of `F` is a square (`FiniteField.isSquare_of_char_two`), so for even `Q` only the first and third shapes can occur, and the first fails: `r = u² ≠ 0` gives `(ω − u)² = 0`, so `A` is again the repeated-root algebra up to the change of generator `ω ↦ ω − u`. - The type equivalence `equivProd : A ≃ F × F` is the coordinate map and not a ring map: it sends `ω` to `(0, 1)`, whose square `(0, 1)` is not the coordinate vector `(r, 0)` of `ω²`; the algebra isomorphism of the split case sends `x + yω` to `(x + yu, x − yu)`, with inverse `(s, t) ↦ (s + t)/2 + ((s − t)/(2u)) ω`. - In the split case `norm (x + yω) = (x + yu)(x − yu)` is the product of the two coordinates and `trace` is their sum; `star` exchanges the two factors. - In the inert case `A` is a field with `Q²` elements and `F` is the subfield of elements with `im = 0`; `norm z = z · star z` and `trace z = z + star z` (`mul_star`). - In the repeated-root case the nilradical is `F ε`, `norm (x + yε) = x²` and `trace (x + yε) = 2x`. **Checks.** - `F = ℤ/5`, `r = −1 = 2²`: split; `ω ↦ (2, −2) = (2, 3)`, and `1 + ω ↦ (3, 4)` has norm `12 ≡ 2 = 1 + 1`, matching `norm (1 + ω) = 1 − (−1) = 2`. - `F = ℤ/3`, `r = −1`: not a square, `A` is the field with nine elements; `F = ℤ/3`, `r = 3 = 0`: the repeated-root algebra, in which `ω ≠ 0` and `ω² = 0`. - `F = ℤ/2`, `r = 1`: `1` is a square and `Q` is even; `(ω + 1)² = ω² + 1 = 0`, so `A` is not `F × F`, which has no nonzero nilpotent. This is the negative control for the oddness hypothesis in the split case. *Needs:* Tau Ceti `algEquivProdOfSq`; Mathlib `QuadraticAlgebra.lift`, the `Field` instance under `Fact (¬ IsSquare a)`, `DualNumber`, `DualNumber.lift`, `FiniteField.isSquare_iff`, `FiniteField.isSquare_of_char_two`, `FiniteField.odd_card_of_char_ne_two`, `QuadraticAlgebra.mul_star`, `norm_def`, `trace_def`. ### 3.2 Frobenius on a finite quadratic algebra Prove `pow_card_eq_star`: for a finite field `F` with `Q` elements and a nonsquare `r ∈ F`, every `z ∈ QuadraticAlgebra F r 0` satisfies `z^Q = star z`; and `pow_card_eq_self_of_square`: for odd `Q` and a nonzero square `r`, every `z` satisfies `z^Q = z`. In the first case in particular `ω^Q = −ω`. The route: in the inert case `A` is a field with `Q²` elements, the `Q`-th power map is a field automorphism fixing `F` (`FiniteField.pow_card` on `F`, the binomial theorem in characteristic `p`), and `ω^Q = ω · r^((Q−1)/2) = −ω` by Euler's criterion (`ZMod.euler_criterion` for prime fields, `FiniteField.isSquare_iff` in general, as `r` is not a square and `Q` is odd, which holds because a finite field of characteristic two has every element a square); so the `Q`-th power map agrees with `star` on `F` and on `ω`, hence everywhere. Equivalently, the `Q`-th power map generates `Gal(F(√r)/F)`, the cyclic group of order two (milne-ant, Example 7.54, p. 129, for the Frobenius generator of the Galois group of a finite extension of a finite field), and `star` is its nontrivial element. In the split case transport `FiniteField.pow_card` componentwise through `algEquivProdOfSq`. In the repeated-root case `z^Q = (z.re)^Q = z.re`: Frobenius kills `ε`, since `Q ≡ 0` in `F`. - `trace z = z + z^Q` and `norm z = z · z^Q` in the inert case; the fixed points of `z ↦ z^Q` are exactly `F`. - For `r` not a square, `z ↦ z^Q` is the unique nontrivial `F`-algebra automorphism of `A`, and `(z^Q)^Q = z`. - Scalar extension: for a finite extension `F ⊂ F'`, the identity `z^Q = star z` for `z ∈ A` is the restriction of `z^(Q') = star z` on `QuadraticAlgebra F' r 0` only when `r` stays a nonsquare in `F'`; over `F'` of even degree over `F`, `r` becomes a square and the identity changes to `z^(Q') = z`. **Checks.** - `F = ℤ/3`, `r = −1`, `z = 1 + ω`: `z³ = 1 + 3ω + 3ω² + ω³ = 1 + 3ω − 3 − ω = −2 + 2ω = 1 − ω = star z` in `ℤ/3`. A statement `z^Q = z` would give `1 + ω ≠ 1 − ω`. - `F = ℤ/5`, `r = −1`, `z = 1 + ω`: `z⁵ = z` since `A ≃ F × F`; here `star z = 1 − ω ≠ z`, so the inert identity would be false: the two headlines are separated by the square class of `r`. - `F = ℤ/3`, `r = 0`, `z = 1 + ω`: `z³ = 1 + 3ω + 3ω² + ω³ = 1`, neither `z` nor `star z = 1 − ω`. The repeated-root case has its own identity `z^Q = z.re`. - `ω^Q = −ω` is the value table at the generator: for `F = ℤ/7`, `r = 3` (a nonsquare, as `3³ = 27 ≡ −1`), `ω⁷ = ω · 3³ = −ω`. *Needs:* §3.1; Mathlib `FiniteField.pow_card`, `ZMod.euler_criterion`, `FiniteField.isSquare_iff`, `FiniteField.isSquare_of_char_two`, `FiniteField.odd_card_of_char_ne_two`, `frobenius`, the `Field` instance on `QuadraticAlgebra F r 0`, `QuadraticAlgebra.star_mk`, `QuadraticAlgebra.mul_star`; Tau Ceti `algEquivProdOfSq`. ### 3.3 The integral Frobenius congruence Prove `frobenius_congruence`: for an integer `r`, an odd prime `p` such that `r` is not a square modulo `p`, and every `z = u + v√r ∈ ℤ[√r]`, `z^p − star z ∈ (p)`, that is, `z^p ≡ u − v√r (mod p)` coefficientwise. The route: reduce modulo `p` with `ρ_p` of §2.1, which is a ring homomorphism commuting with `star` and with `p`-th powers; apply `pow_card_eq_star` over `F = ZMod p`, whose cardinality is `p`, to `ρ_p z`; conclude by `reduction_kernel`. In coordinates the congruence says `p ∣ u^p − u` and `p ∣ v^p r^((p−1)/2) + v`, the second by Euler's criterion with `r^((p−1)/2) ≡ −1`. Compare with the maximal order: for `r = d` squarefree and an odd prime `p ∤ d`, the hypothesis "no square root of `r` modulo `p`" is the inertness of `(p)` in `ℤ[√r]` (`isMaximal_span_natCast_iff`) and, through Conrad's Theorem 2.4 and Corollary 3.1 (conrad-quadchar, PDF pp. 3–4) and Milne's Example 3.44(ii) (p. 63), the condition `legendreSym p d = −1` under which `p` is inert in the maximal order and the arithmetic Frobenius at `p` is the nontrivial automorphism (`arithFrobAt_eq_one_iff_legendreSym_eq_one`). The congruence is the elementary form of this dictionary in the presented order and needs no Galois theory. The prime `2` is excluded: `pow_card_eq_star` needs a nonsquare, and modulo `2` every residue is a square. - The commuting square: `ρ_p (z^p) = (ρ_p z)^p = star (ρ_p z) = ρ_p (star z)`. - Coordinate consequences: `p ∣ u^p − u` (Fermat) and `p ∣ v (v^(p−1) r^((p−1)/2) + 1)`, which for `p ∤ v` is Euler's criterion for `r`. - Comparison with inertness: under the hypothesis of the theorem, `(p)` is a maximal ideal of `ℤ[√r]` and `ℤ[√r]/(p)` is the field with `p²` elements, by §2.1 and §3.1. **Checks.** - `r = −1, p = 3`: `(u + v√−1)³ = (u³ − 3uv²) + (3u²v − v³)√−1`, and subtracting `u − v√−1` gives `(u³ − u − 3uv²) + (3u²v − v³ + v)√−1`; `3 ∣ u³ − u` and `3 ∣ v − v³`, so both coordinates are divisible by `3`. - `r = −1, p = 5`: `−1 = 2²` is a square modulo `5`, the hypothesis fails, and indeed `(1 + √−1)⁵ ≡ 1 + √−1 ≢ 1 − √−1 (mod 5)`: the congruence is false, as `pow_card_eq_self_of_square` predicts. - `r = 5, p = 2`: `5 ≡ 1` is a square modulo `2`, so the theorem does not apply; `(u + v√5)² − (u − v√5) = (u² + 5v² − u) + (2uv + v)√5`, whose second coordinate is `≡ v (mod 2)`: the congruence fails for odd `v`, although `2` is inert in the maximal order of `ℚ(√5)` (Milne, Example 3.44(iii), p. 63). The field's dyadic inertness does not give the congruence in `ℤ[√5]`, whose reduction modulo `2` is the repeated-root algebra of §2.1. - `r = 3, p = 3`: `3 ≡ 0` is a square, the theorem does not apply, and `(u + v√3)³ − (u − v√3) = (u³ + 9uv² − u) + (3u²v + 3v³ + v)√3` has second coordinate `≡ v (mod 3)`: the ramified prime is excluded by the hypothesis, not by the oddness of `p`. *Needs:* §§2.1, 3.2; Mathlib `ZMod.euler_criterion`, `legendreSym.eq_pow`, `ZMod.pow_card`, `Nat.card_zmod`; Tau Ceti `isMaximal_span_natCast_iff`, `arithFrobAt_eq_one_iff_legendreSym_eq_one`; Conrad, Theorem 2.4 and Corollary 3.1; Milne, Example 3.44. ### Examples `ℤ[√−1]` at `3` and at `5` separates the inert congruence from the split identity; `ℤ[√5]` at `2` separates inertness in the maximal order from the congruence in the presented order; `ℤ/7` with `r = 3` fixes the sign `ω^Q = −ω`. ### Dependencies Layers 2 (reduction) and the finite-field library of Mathlib; Tau Ceti's split equivalence, inert criterion and maximal-order Frobenius dictionary for the comparisons. No input from Layers 1 and 4. ## Layer 4: embeddings and coordinate bounds ### 4.1 The two complex embeddings and the coordinate bound For a rational `r` and a complex `s` with `s² = r` (for `r ≥ 0` take `s = √r`, for `r < 0` take `s = √(−r)·i`), define the two `ℚ`-algebra homomorphisms `σ₊, σ₋ : QuadraticAlgebra ℚ r 0 →ₐ[ℚ] ℂ` by `lift` at `s` and at `−s`, so that `σ±(u + vω) = u ± vs`. Prove `norm_embedding_le`: for every `ℚ`-algebra homomorphism `σ : QuadraticAlgebra ℚ r 0 →ₐ[ℚ] ℂ` and every `z = u + vω`, `‖σ z‖ ≤ |u| + |v|√|r|`, an elementary consequence of the triangle inequality. The route: `σ ω` squares to `r`, so `‖σ ω‖² = |r|` and `‖σ ω‖ = √|r|`; then `‖σ z‖ = ‖u + v σ ω‖ ≤ |u| + |v| ‖σ ω‖` by the triangle inequality and `Complex.norm_ratCast`. For nonsquare `r` prove that `σ₊` and `σ₋` are injective, that every `ℚ`-algebra homomorphism to `ℂ` is one of them (it is determined by the image of `ω`, which is a square root of `r`), that `σ₋ = σ₊ ∘ star`, and that `σ₊(z) · σ₋(z) = norm z` and `σ₊(z) + σ₋(z) = trace z` read in `ℂ`. For `r ≤ 0`, `σ₊` is Tau Ceti's `complexEmbedding`, whose exhaustiveness statement `algHom_eq_or_eq_comp_starAlgEquiv` is the `r ≤ 0` case; the positive nonsquare case is the target here. The integral specialization reads `u, v ∈ ℤ` through the inclusion of `ℤ[√r]` in `QuadraticAlgebra ℚ r 0` and accepts every nonsquare integer `r`, including the nonsquare non-squarefree fundamental discriminants such as `r = 12` and `r = 20`. - Coordinate recovery: `u = (σ₊ z + σ₋ z)/2` and `v = (σ₊ z − σ₋ z)/(2s)`, so `|u| ≤ (‖σ₊ z‖ + ‖σ₋ z‖)/2` and `|v| ≤ (‖σ₊ z‖ + ‖σ₋ z‖)/(2√|r|)` for `r ≠ 0`; the hypothesis `s ≠ 0`, that is `r ≠ 0`, is retained. - Signature: for `r > 0` both `σ±` take real values and are the two real embeddings, exchanged by `star`; for `r < 0` they are complex conjugate, `σ₋ = conj ∘ σ₊`, and `star` corresponds to complex conjugation only in this case. - For `r` a nonzero square `t²` in `ℚ`, `σ±` are still defined (`ω ↦ ±t`) but not injective: `ω − t ↦ 0` under `σ₊`. - The norm comparison with the field: for nonsquare `r`, `norm z = σ₊(z) σ₋(z)` is the field norm of `ℚ(√r)/ℚ` of the image of `z`, and `‖σ₊ z‖² = norm z` holds for every `z` if and only if `r < 0`: for `r < 0`, `‖u + v√(−r) i‖² = u² − rv² = norm z`, while for `r > 0` the element `ω` has `‖σ₊ ω‖² = r ≠ −r = norm ω` (the equality can still hold at single elements, such as `z = 1`). **Checks.** - `r = −1`, `z = u + vω`: `σ₊ z = u + vi`, `‖σ₊ z‖ = √(u² + v²) ≤ |u| + |v|`, with equality iff `uv = 0`. - `r = 20`, `z = 1 + ω`: `s = 2√5`, `σ₊ z = 1 + 2√5 ≈ 5.47` and `|1| + |1|√20 = 1 + 2√5`: equality, as `u, v ≥ 0` and `s > 0`. For `z = 1 − ω`, `σ₊ z = 1 − 2√5 ≈ −3.47` and the bound `1 + 2√5` is strict. - `r = 4`, `z = ω − 2`: `σ₊ z = 0 ≤ |−2| + |1|·2 = 4`; the bound holds but `σ₊` is not injective, so the bound is a statement about every algebra map while injectivity needs `r` nonsquare. - `r = 0`: `σ₊ = σ₋` sends `ω` to `0`; the bound reads `‖u‖ ≤ |u| + 0`, and coordinate recovery of `v` is unavailable, as `s = 0`. *Needs:* Mathlib `QuadraticAlgebra.lift`, `Complex.norm_ratCast`, `Complex.norm_real`, `Real.sqrt_sq`, `Real.sqrt_mul_self`, `norm_add_le`, `norm_mul`, `QuadraticAlgebra.norm_def`, `trace_def`, `algebraMap_omega`; Tau Ceti `complexEmbedding`, `complexEmbedding_apply`, `algHom_eq_or_eq_comp_starAlgEquiv`. ### Examples `r = −1` is the Gaussian case with the Euclidean bound; `r = 20` shows the integral specialization at a nonsquare, non-squarefree parameter; `r = 4` separates the bound, valid for every algebra map, from injectivity and coordinate recovery, which need `r` nonsquare and nonzero. ### Dependencies Mathlib quadratic algebras over `ℚ`, the complex norm and real square roots; Tau Ceti's distinguished complex embedding for `r ≤ 0`; Layer 2 only through the inclusion of `ℤ[√r]` in `ℚ[√r]`. No input from Layers 1 and 3. ## Downstream consumers The targets are exposed on the native carriers with the maps commuting, not as existence statements for isomorphic objects, so that a consumer can read values off coordinates. Layer 1 supplies, at any level, the discriminant `D` of a real character with its sign and odd-prime values, which a consumer uses to pass from a character value `χ(p) = −1` to the nonsquare hypothesis of Layer 3 for `r = d` or `r = D`. Layer 2 supplies the reduction of `ℤ[√r]` modulo any `m` and the injectivity of reduction on coordinate rectangles, with the exact interval endpoints. Layer 3 supplies the Frobenius congruence, which separates a point of `ℤ[√r]` from its conjugate modulo a prime at which `r` is not a square, and Layer 4 the archimedean bound on every embedding, for every parameter `r` and with no rectangle, prime or parameter choice fixed here. No roadmap on main consumes a target of this roadmap. AnalyticNumberTheoryPartI is a supplier of Layer 1 and consumes nothing from this roadmap: the special cases of §§3.3 and 4.1 that the determinant method of its §0.34c uses are established inside its own proof, as recorded under Scope and ownership. ## Scope and ownership This roadmap owns the classification of the quadratic Dirichlet characters at odd prime-power and at two-power levels (§§1.1–1.2) and their local decomposition with the product formula for the conductor at an arbitrary positive level (§1.3); the primitive discriminant of a real character at any level, with its uniqueness (§1.4); the reduction of an integral quadratic presentation `QuadraticAlgebra ℤ a b` modulo any `m`, its kernel, the quotient comparison, the cardinality `m²`, coordinate divisibility and finite coordinate sets (Layer 2); the comparison of the presented order `ℤ[√d]` with the index-two order `ℤ[(1 + √d)/2]` modulo odd `m` (§2.3); the split, inert and repeated-root trichotomy of `QuadraticAlgebra F r 0` over a finite field, the Frobenius identities and the integral Frobenius congruence (Layer 3); and the two complex embeddings of `QuadraticAlgebra ℚ r 0` with their coordinate bounds for every nonsquare `r`, positive or negative (Layer 4). - **AnalyticNumberTheoryPartI §0.34a** owns the classification of primitive nonprincipal real Dirichlet characters as Kronecker characters of fundamental discriminants: its declaration `quadratic_character_eq_fundamentalDiscriminantChar` states that such a character `χ` of level `q` is a fundamental discriminant character, `χ(n) = fundamentalDiscriminantCharCast ℂ D (n)` at every integer `n` for `D = χ(−1) q`, and its `quadratic_character_kronecker` derives from it the radicand form, a squarefree `d ≠ 1` with `|d| ≤ q` and `χ(p) = jacobiSym d p` at every odd prime `p ∤ q`. §1.4 consumes the first declaration's conclusion and adds the conductor-one case, the uniqueness of `D` and the extension to imprimitive characters at any level; its odd-prime dictionary differs from the radicand form in holding at every level and at the odd primes dividing `D`. - **AnalyticNumberTheoryPartI §0.34c** uses, as facts 2 and 3 of the determinant method in its proof of `inert_prime_sum_le`, two special cases of targets here: the bound `|x ± y√d| ≤ N(1 + √|d|)` for the radicand `d` of §0.34a and integers `0 ≤ x, y < N`, a case of §4.1, and the congruence `(x + y√d)^p ≡ x − y√d (mod p)` in `ℤ[√d]` at an odd prime `p` with `(d/p) = −1`, a case of §3.3. AnalyticNumberTheoryPartI stands before this roadmap in the merge order, takes nothing from it and establishes both cases inside that proof. The targets here are the general forms: §3.3 for every integer `r` and every odd prime `p` modulo which `r` is not a square, §4.1 for every rational `r` and every `ℚ`-algebra map to `ℂ`. - **ClassicalArithmeticCompletion** on main owns, in its Layer 1, the explicit generators `−1` and `5` of the unit group modulo `2^(e+3)` (§1.1), the squareness of units `≡ 1 (mod p)` modulo odd prime powers (§1.2), the `d`-th power criterion in a cyclic group (§1.3), the primitivity of `ZMod.χ₄`, `ZMod.χ₈` and `ZMod.χ₈'` (§1.4) and of the Legendre character modulo an odd prime (§1.5), the primitivity of a product of primitive characters of coprime levels (§1.6), the value table of `fundamentalDiscriminantChar` (§1.7), the uniqueness of a primitive character from its values at almost all primes (§1.8), and the shape of a primitive quadratic conductor: its 2-adic exponent is not `1` (§1.9), the squares modulo `2^(e+3)` are the units `≡ 1 (mod 8)` (§1.20), its odd part is squarefree (§1.21) and its 2-adic exponent is at most `3` (§1.32). None of these is restated here. §§1.1–1.2 consume §§1.4, 1.5 and 1.21; §1.3 consumes §1.21 for the shape of a primitive quadratic conductor. - **Tau Ceti** natively owns the Kronecker character `TauCeti.kroneckerChar`, the fundamental-discriminant character `fundamentalDiscriminantChar` with its sign, odd-prime, dyadic and Jacobi values, its primitivity and its scalar realizations `fundamentalDiscriminantCharCast` with their conductor and commuting coefficient maps; the squarefree-radicand map `fundamentalDiscriminant d` with `D = d` for `d ≡ 1 (mod 4)` and `D = 4d` otherwise; the multiplicativity of the conductor over coprime factors; the 2-adic exponent `0`, `2` or `3` of a primitive quadratic level (`DirichletCharacter.IsPrimitive.factorization_two_eq_zero_or_two_or_three`, the library form of ClassicalArithmeticCompletion §§1.9 and 1.32); the stability of quadraticity under products and change of level; the Chinese remainder splitting of a character at an exact divisor of its level; the inert criterion `isMaximal_span_natCast_iff` for `(p) ⊂ ℤ[ω]`; the split-case equivalences `algEquivProdOfSq` and `algEquivProdOfRoots`; the distinguished complex embedding `complexEmbedding` of `QuadraticAlgebra ℚ a 0` for `a ≤ 0`; and the maximal-order arithmetic Frobenius dictionary `arithFrobAt_eq_one_iff_legendreSym_eq_one`. These are cited under the supplier contracts, never rebuilt. Mathlib owns the two-sided squarefree description `Int.isFundamentalDiscr_iff_squarefree` of fundamental discriminants, the Field instance on `QuadraticAlgebra K a b` when `X² − bX − a` has no root, and the primitive character `DirichletCharacter.primitiveCharacter` of any Dirichlet character, with `χ(n) = χ*(n)` at integers coprime to the level (`DirichletCharacter.primitiveCharacter_apply_of_isCoprime`) and `χ(n) = 0` at the others (`MulChar.map_nonunit`), which is the description of `χ` as induced by `χ*` (mv-mnt1-ch9, Theorem 9.2, p. 283). - **GlobalNumberFields** (completed, Layer 11) and **NumberFieldArithmetic** (completed) own orders in number fields, their discriminants, index and enlargement, norms and the prime decomposition in maximal orders. §2.3 compares the presented order with one explicit index-two enlargement through a concrete ring homomorphism and states nothing about maximal orders in general. - **ThetaSeries §2H** defines its own Kronecker symbol and character for lattice discriminants; **ImaginaryQuadraticClassNumber H2.1** constructs the primitive character of a negative fundamental discriminant on the native carrier. Neither is a supplier or a consumer of a target here; the comparisons of this roadmap use the pinned Tau Ceti character directly. Nothing here constructs a second character, discriminant predicate, quadratic-field carrier or Kronecker symbol, and nothing identifies a presented order `ℤ[√r]` with a maximal order. ## Exact supplier contracts ### From Mathlib - `DirichletCharacter`, `DirichletCharacter.conductor`, `DirichletCharacter.IsPrimitive`, `DirichletCharacter.primitiveCharacter`, `DirichletCharacter.changeLevel_primitiveCharacter`, `DirichletCharacter.primitiveCharacter_apply_of_isCoprime`, `DirichletCharacter.primitiveCharacter_isPrimitive`, `DirichletCharacter.conductor_dvd_level`, `DirichletCharacter.conductor_ne_zero`, `DirichletCharacter.eq_one_iff_conductor_eq_one`, `DirichletCharacter.factorsThrough_iff_ker_unitsMap`, `DirichletCharacter.changeLevel`, `DirichletCharacter.changeLevel_injective` and `DirichletCharacter.conductor_changeLevel` in `Mathlib/NumberTheory/DirichletCharacter/Basic.lean`: the character carrier, conductors, nonzero at a nonzero level, the primitive character of any character, the criterion for factoring through a divisor `d` of the level (the kernel of `(ℤ/N)ˣ → (ℤ/d)ˣ` lies in the kernel of the character), change of level, its injectivity and its invariance of the conductor (mv-mnt1-ch9, Theorem 9.2, p. 283, for the primitive character inducing a given one). `MulChar.IsQuadratic`, `MulChar.IsQuadratic.comp`, `MulChar.ringHomComp` and `MulChar.map_nonunit` in `Mathlib/NumberTheory/MulChar/Basic.lean`: values in `{0, 1, −1}`, preserved by ring homomorphisms, the change of coefficients, and the value `0` at nonunits. `ZMod.unitsMap_surjective` in `Mathlib/Data/ZMod/Units.lean`: every unit modulo a divisor lifts to a unit. `quadraticChar`, `quadraticChar_isQuadratic`, `quadraticChar_ne_one` in `Mathlib/NumberTheory/LegendreSymbol/QuadraticChar/Basic.lean`, and `legendreSym`, `legendreSym.mul` and `legendreSym.sq_one'` in `Mathlib/NumberTheory/LegendreSymbol/Basic.lean`: the Legendre character modulo an odd prime, with values in `ℤ`, nonprincipal, its value at an integer, its multiplicativity in the argument, and the value `1` at the square of an integer prime to `p`. `ZMod.χ₄`, `ZMod.χ₈`, `ZMod.χ₈'` in `Mathlib/NumberTheory/LegendreSymbol/ZModChar.lean`: the characters of conductors `4`, `8`, `8` with values in `ℤ`. - `ZMod.euler_criterion` and `legendreSym.eq_pow` in `Mathlib/NumberTheory/LegendreSymbol/Basic.lean`: a nonzero `a` modulo `p` is a square iff `a^(p/2) = 1`, and the Legendre symbol is `a^(p/2)`. `FiniteField.pow_card`, `FiniteField.isSquare_iff`, `FiniteField.isSquare_of_char_two` and `FiniteField.odd_card_of_char_ne_two` in `Mathlib/FieldTheory/Finite/Basic.lean`: `a^Q = a`, the square criterion in odd characteristic, and that every element is a square in characteristic two. - `Int.IsFundamentalDiscr`, `Int.isFundamentalDiscr_iff_squarefree` in `Mathlib/NumberTheory/FundamentalDiscriminant.lean`: the predicate, including `D = 1`, and its squarefree description in both directions. - `QuadraticAlgebra`, `QuadraticAlgebra.equivProd`, `QuadraticAlgebra.ext_iff`, `QuadraticAlgebra.algebraMap_dvd_iff` in `Mathlib/Algebra/QuadraticAlgebra/Defs.lean`: the carrier, its coordinate bijection with `R × R`, extensionality and `algebraMap r ∣ z ↔ r ∣ z.re ∧ r ∣ z.im`. `QuadraticAlgebra.lift`, `QuadraticAlgebra.star_mk`, `QuadraticAlgebra.norm`, `QuadraticAlgebra.norm_def`, `QuadraticAlgebra.mul_star`, `QuadraticAlgebra.trace`, `QuadraticAlgebra.trace_def`, `QuadraticAlgebra.mapRingHom`, `QuadraticAlgebra.mapRingHom_omega`, `QuadraticAlgebra.mapRingHom_injective`, `QuadraticAlgebra.mapRingHom_surjective`, `QuadraticAlgebra.mapRingHom_comp`, `QuadraticAlgebra.mapRingHom_star`, `QuadraticAlgebra.re_mapRingHom_apply`, `QuadraticAlgebra.im_mapRingHom_apply` (the coordinates `(mapRingHom f a b z).re = f z.re` and `.im = f z.im`), `QuadraticAlgebra.norm_mapRingHom` (`norm (mapRingHom f a b z) = f (norm z)`), `QuadraticAlgebra.trace_mapRingHom` (`trace (mapRingHom f a b z) = f (trace z)`) and the `Field` instance on `QuadraticAlgebra K a b` under `Fact (∀ r, r ^ 2 ≠ a + b * r)`, with its `b = 0` form under `Fact (¬ IsSquare a)`, in `Mathlib/Algebra/QuadraticAlgebra/Basic.lean`: the universal property, conjugation, norm, trace, coefficient change and the field criterion. `QuadraticAlgebra.isRegular_im_omega_iff_injective`, `QuadraticAlgebra.isUnit_im_omega_iff_bijective`, `QuadraticAlgebra.algHom_star`, `QuadraticAlgebra.norm_algHom` and `QuadraticAlgebra.trace_algHom` in `Mathlib/Algebra/QuadraticAlgebra/AlgHom.lean`: an `R`-algebra map `f` between quadratic algebras over `R` is injective exactly when `(f ω).im` is a regular element of `R` and bijective exactly when it is a unit, and an injective one commutes with `star`, norm and trace. `QuadraticAlgebra.algebraMap_omega` in `Mathlib/Algebra/QuadraticAlgebra/Int.lean`: the inclusion of `ℤ[ω]` in `ℚ[ω]` sends `ω` to `ω`. - `Ideal.Quotient.lift`, `Ideal.Quotient.mk`, `Ideal.quotEquivOfEq` in `Mathlib/RingTheory/Ideal/Quotient/Defs.lean`, `RingHom.quotientKerEquivOfSurjective` in `Mathlib/RingTheory/Ideal/Quotient/Operations.lean`, `Ideal.mem_span_singleton'`, `Ideal.span_singleton_le_iff_mem` in `Mathlib/RingTheory/Ideal/Span.lean`, `RingEquiv.ofBijective`: quotient rings and the first isomorphism theorem. `ZMod.natCast_self`, `ZMod.intCast_zmod_eq_zero_iff_dvd`, `ZMod.intCast_eq_intCast_iff_dvd_sub` in `Mathlib/Data/ZMod/Basic.lean`; `Nat.card_zmod`, `Nat.card_prod`, `Nat.card_congr` in `Mathlib/SetTheory/Cardinal/Finite.lean`. - `DualNumber` and `DualNumber.lift` in `Mathlib/Algebra/DualNumber.lean`: the repeated-root algebra `R[ε]/(ε²)` of §3.1. `Complex.norm_ratCast`, `Complex.norm_real` in `Mathlib/Analysis/Complex/Norm.lean`, `Real.sqrt_sq`, `Real.sqrt_mul_self` in `Mathlib/Analysis/Real/Sqrt.lean` and the triangle inequality `norm_add_le`: the embedding bound of §4.1. ### From Tau Ceti - `TauCeti.kroneckerChar`, `TauCeti.kroneckerChar_apply`, `TauCeti.kroneckerChar_intCast` in `TauCeti/NumberTheory/LegendreSymbol/KroneckerSymbol.lean`: the Kronecker character of any `D ≡ 0, 1 (mod 4)`, `D ≠ 0`, at level `|D|`, with values in any commutative ring. - `TauCeti.Multiquadratic.fundamentalDiscriminantChar` with `fundamentalDiscriminantChar_intCast`, `fundamentalDiscriminantChar_neg_one` (`χ_D(−1) = sign D`), `fundamentalDiscriminantChar_isQuadratic`, `isPrimitive_fundamentalDiscriminantChar`, `fundamentalDiscriminantChar_natCast_eq_legendreSym` (`χ_D(q) = legendreSym q D` at an odd prime `q`, zero when `q ∣ D`), `fundamentalDiscriminantChar_two` (`χ_D(2) = χ₈(D)`), `fundamentalDiscriminantChar_ne_one` in `TauCeti/NumberTheory/Multiquadratic/FundamentalDiscriminant/Character.lean`: the character of a fundamental discriminant is by definition `kroneckerChar ℤ D` at level `|D|`, so the two agree at every residue with no change of level. `fundamentalDiscriminantChar_natCast_eq_jacobiSym`, `fundamentalDiscriminantChar_mul`, `fundamentalDiscriminantChar_neg_four`, `fundamentalDiscriminantChar_eight`, `fundamentalDiscriminantChar_neg_eight`, `fundamentalDiscriminantChar_oddPrimeDiscriminant` in `…/FundamentalDiscriminant/Values.lean`: the Jacobi values at odd arguments, multiplicativity in coprime discriminants, and the identification with `χ₄`, `χ₈`, `χ₈'` and the Legendre characters. - `TauCeti.Multiquadratic.fundamentalDiscriminantCharCast R D hD` with `fundamentalDiscriminantCharCast_apply`, `fundamentalDiscriminantCharCast_ringHomComp`, `fundamentalDiscriminantCharCast_isQuadratic`, `isPrimitive_fundamentalDiscriminantCharCast`, `conductor_fundamentalDiscriminantCharCast` and `fundamentalDiscriminantCharCast_eq_one_iff` in `…/FundamentalDiscriminant/Realization.lean`: the realization with coefficients in any commutative ring `R`, its compatibility with every scalar map `R → S`, its quadraticity, and in characteristic zero its primitivity, its conductor `|D|` and its triviality exactly for `D = 1`. - `TauCeti.Multiquadratic.fundamentalDiscriminant` with `fundamentalDiscriminant_of_mod_four_eq_one`, `fundamentalDiscriminant_of_mod_four_ne_one`, `isFundamentalDiscr_fundamentalDiscriminant` and `exists_sq_mul_eq_fundamentalDiscriminant` in `…/FundamentalDiscriminant/OfSquarefree.lean`: the fundamental discriminant `d` or `4d` of a squarefree `d`, which is `c² d` for `c = 1` or `c = 2`. - `DirichletCharacter.conductor_mul_of_coprime`, `conductor_prod_of_pairwise_coprime`, `isPrimitive_ringHomComp_iff`, `conductor_ringHomComp` in `TauCeti/NumberTheory/DirichletCharacter/Conductor.lean`: the conductor of a product of characters with coprime conductors is the product, and conductors are stable under injective coefficient maps. - `DirichletCharacter.IsPrimitive.factorization_two_eq_zero_or_two_or_three` and `IsPrimitive.factorization_two_le_three` in `TauCeti/NumberTheory/DirichletCharacter/Dyadic/Quadratic.lean`, and `IsPrimitive.factorization_two_ne_one` in `…/Dyadic/Basic.lean`: the level of a primitive quadratic character with values in any commutative ring has 2-adic exponent `0`, `2` or `3`, and the level of any primitive character has 2-adic exponent different from `1`. - `DirichletCharacter.isQuadratic_changeLevel` and `MulChar.isQuadratic_prod` in `TauCeti/NumberTheory/DirichletCharacter/Quadratic.lean`: lifts and finite products of quadratic characters are quadratic. - `TauCeti.Nat.IsExactDivisor.unitsEquivProd` and `TauCeti.Nat.IsExactDivisor.eq_mul_comp_unitsMap` in `TauCeti/Data/ZMod/ExactDivisor.lean`: for an exact divisor `Q ∥ N`, `(ℤ/N)ˣ ≃ (ℤ/Q)ˣ × (ℤ/(N/Q))ˣ` by the two reductions, and a character on `(ℤ/N)ˣ` is the product of its restrictions to the two factors, read back through the reductions. - `QuadraticAlgebra.isMaximal_span_natCast_iff` in `TauCeti/NumberTheory/QuadraticOrder/PrimeIdeal.lean`: for a prime `p`, `(p) ⊂ ℤ[ω]` is maximal iff `X² − bX − a` has no root modulo `p`. The proof of the inert criterion contains, as local facts for prime `p`, the membership criterion and the kernel identification that §2.1 states for every `m`. - `TauCeti.QuadraticAlgebra.algEquivProdOfSq` and `algEquivProdOfRoots` in `TauCeti/Algebra/QuadraticAlgebra/Split.lean`: with `2` invertible and `a = u²` for a unit `u`, `QuadraticAlgebra R a 0 ≃ₐ[R] R × R` sends `ω` to `(u, −u)`; more generally two roots with unit difference split the algebra. - `QuadraticAlgebra.complexEmbedding` with `complexEmbedding_apply` and `algHom_eq_or_eq_comp_starAlgEquiv` in `TauCeti/NumberTheory/NumberField/Quadratic/ComplexEmbedding.lean`: for `a ≤ 0`, the embedding `ω ↦ √(−a)·i` and the fact that every algebra map to `ℂ` is it or its conjugate. §4.1 extends the exhaustiveness to positive nonsquare `a`. - `TauCeti.NumberField.arithFrobAt_eq_one_iff_legendreSym_eq_one` in `TauCeti/NumberTheory/NumberField/Quadratic/Frobenius.lean`: in the maximal order of `ℚ(θ)`, `θ² = d`, the arithmetic Frobenius at a prime above an odd `p ∤ d` is trivial iff `legendreSym p d = 1`. §3.3 compares its elementary congruence with this dictionary where both apply. ### From TauCetiRoadmap.AnalyticNumberTheoryPartI, §0.34a §0.34a's declaration `quadratic_character_eq_fundamentalDiscriminantChar` states, for `χ` with `χ.IsPrimitive`, `χ.IsQuadratic` and `χ ≠ 1` at level `q` with `[NeZero q]` and complex values, and for `D = q` if `χ(−1) = 1` and `D = −q` otherwise, that `D` is a fundamental discriminant (`hD : Int.IsFundamentalDiscr D`) and that `χ(n) = fundamentalDiscriminantCharCast ℂ D hD (n)` for every integer `n`, the left side read in `ZMod q` and the right side in `ZMod |D|`. §1.4 applies this conclusion to the primitive character of a quadratic character, and takes no step of the proof of §0.34a. ### From TauCetiRoadmap.ClassicalArithmeticCompletion, §§1.4, 1.5, 1.21 §1.4 and §1.5 supply the primitivity of `χ₄`, `χ₈`, `χ₈'` and of the Legendre character modulo an odd prime, as Dirichlet characters with integer values; §1.21 that the odd part of the level of a primitive quadratic character of nonzero level, with values in a commutative ring, is squarefree. These are consumed at their stated generality (integer values; complex values through `MulChar.ringHomComp` and Tau Ceti `conductor_ringHomComp`). ## References Page numbers refer to the printed edition named; a PDF page is stated where it differs. - **[mv-mnt1-ch9]** H. L. Montgomery and R. C. Vaughan, *Multiplicative Number Theory I: Classical Theory*, Cambridge Studies in Advanced Mathematics 97 (2006), [Chapter 9, Primitive characters and Gauss sums](https://personal.science.psu.edu/rcv4/personal/Publications/MNTI/13.0_pp_282_325_Primitive_characters_and_Gauss_sums.pdf), author's copy, pp. 282–325 (PDF page `n` is printed page `281 + n`): Theorem 9.2 and Lemma 9.3 (p. 283), §9.3 (pp. 295–297) and Theorem 9.13 (p. 297). - **[conrad-quadchar]** B. Conrad, [Quadratic characters associated to quadratic fields](https://math.stanford.edu/~conrad/676Page/handouts/quadchar.pdf), course handout: Theorem 2.4 (PDF p. 3) and Corollary 3.1 (PDF p. 4), the Frobenius and Legendre-value interpretation of the field character. - **[milne-ant]** J. S. Milne, [Algebraic Number Theory](https://www.jmilne.org/math/CourseNotes/ANT.pdf), version 3.08 (2020), author's course notes (PDF page is printed page `+ 2`): Example 2.41 (p. 39), the integral basis of `ℚ(√m)`; Theorem 3.41 (pp. 62–63), the Dedekind–Kummer factorization; Example 3.44 (p. 63), the splitting of primes in `ℚ(√m)`, including the prime `2` for `m ≡ 1 (mod 4)`; Example 7.54 (p. 129), the Frobenius generator `x ↦ x^q` of the Galois group of the degree-`n` extension of a finite field with `q` elements.