/-Copyright (c) 2026 Carles Marín. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles Marín-/module public import Mathlib.Algebra.Ring.Subring.Basicpublic import Mathlib.Algebra.Group.Units.Basicpublic import Mathlib.Algebra.Ring.NonZeroDivisorspublic import Mathlib.Data.Int.GCDpublic import Mathlib.Tactic.Ringpublic import Mathlib.Tactic.LinearCombination /-!# Recentering: the algebraic core Let `S` be a commutative ring, `ι : S →+* S` a ring endomorphism (in the application, complexconjugation; it need not be an involution), `μ` a unit with `ι μ = μ⁻¹` and `μ ^ n = 1`, and `B` asubring of `S` stable under `ι`. Suppose some `x = μ^k a ∈ B` with `ι a = a` is a unit of `B`, and`gcd(2k, n) = 1`. Then `μ ∈ B`; if `B` is generated by elements `μ^(d j) a j` with `ι (a j) = a j`,then `B` is generated by the `a j` and `μ`; and when `μ − μ⁻¹` is a non-zero-divisor, the`ι`-fixed part of `R[μ]` is `R` for an `ι`-fixed subring `R` containing `τ = μ + μ⁻¹`. The hypotheses (stability of `B`, the unit `x` of `B`, the non-zero-divisor) are supplied by thecaller; integrality, Galois stability and the identities `e_j(μT) = μ^j e_j(T)` are notformalized here. ## Main results * `NotaPuente.Recentering.mu_mem`, `NotaPuente.Recentering.mu_inv_mem`: `μ, μ⁻¹ ∈ B`.* `NotaPuente.Recentering.B_eq_closure`: `B = closure (A' ∪ {μ})`.* `NotaPuente.Recentering.mem_closure_iff_exists`, `NotaPuente.Recentering.eq_zero_of_fixed`: every element of `R[μ]` is `a + b μ` with `a, b ∈ R`, and `a + b μ` fixed forces `b = 0`.* `NotaPuente.Recentering.fixed_iff_of_fixed_subring`: `(R[μ])^ι = R`.* `NotaPuente.Recentering.recentering`: the assembled statement. ## References * C. Marín, *Non-real orders of character values of `GL(n)`*, preprint (2026).* C. Marín, *The ring of character values depends only on the segment: SU(n), Sp(2m) and GL(n) at a torsion element*, Zenodo (2026), doi:10.5281/zenodo.22847476.-/ @[expose] public section namespace NotaPuente.Recentering variable {S : Type*} [CommRing S] /-- `ι μ = μ⁻¹` forces `ι μ⁻¹ = μ`. -/lemma iota_inv (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) : ι ((μ⁻¹ : Sˣ) : S) = μ := by have h1 : ι (μ : S) * ι ((μ⁻¹ : Sˣ) : S) = 1 := by rw [← map_mul, Units.mul_inv, map_one] rw [hιμ] at h1 linear_combination (μ : S) * h1 - ι ((μ⁻¹ : Sˣ) : S) * Units.mul_inv μ /-- Key identity: `μ^(2k) = x * ι y` when `x = μ^k a`, `ι a = a`, `x y = 1`. -/lemma pow_two_mul_eq (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (k : ℕ) (a y : S) (hιa : ι a = a) (hxy : (μ : S) ^ k * a * y = 1) : (μ : S) ^ (2 * k) = (μ : S) ^ k * a * ι y := by have h := congrArg ι hxy rw [map_mul, map_mul, map_pow, hιμ, hιa, map_one] at h -- h : μ⁻¹^k * a * ι y = 1 have hu : (μ : S) ^ k * ((μ⁻¹ : Sˣ) : S) ^ k = 1 := by rw [← mul_pow, Units.mul_inv, one_pow] calc (μ : S) ^ (2 * k) = (μ : S) ^ (2 * k) * (((μ⁻¹ : Sˣ) : S) ^ k * a * ι y) := by rw [h, mul_one] _ = ((μ : S) ^ k * ((μ⁻¹ : Sˣ) : S) ^ k) * ((μ : S) ^ k * a * ι y) := by ring _ = (μ : S) ^ k * a * ι y := by rw [hu, one_mul] /-- **(1) μ ∈ B'.** -/theorem mu_mem (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (n k : ℕ) (hn : (μ : S) ^ n = 1) (hcop : Nat.Coprime (2 * k) n) (B : Subring S) (hB : ∀ z ∈ B, ι z ∈ B) (a y : S) (hιa : ι a = a) (hx : (μ : S) ^ k * a ∈ B) (hy : y ∈ B) (hxy : (μ : S) ^ k * a * y = 1) : (μ : S) ∈ B := by have h2k : (μ : S) ^ (2 * k) ∈ B := by rw [pow_two_mul_eq ι μ hιμ k a y hιa hxy] exact B.mul_mem hx (hB y hy) rcases Nat.lt_trichotomy n 1 with hlt | rfl | hgt · have h0 : n = 0 := by omega subst h0 rw [Nat.coprime_zero_right] at hcop omega · rw [pow_one] at hn; rw [hn]; exact B.one_mem · obtain ⟨m, -, hm⟩ := Nat.exists_mul_mod_eq_one_of_coprime hcop hgt have : (μ : S) = ((μ : S) ^ (2 * k)) ^ m := by rw [← pow_mul, pow_eq_pow_mod (2 * k * m) hn, hm, pow_one] rw [this] exact B.pow_mem h2k m /-- μ⁻¹ ∈ B' as well (it is ι μ). -/theorem mu_inv_mem (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (B : Subring S) (hB : ∀ z ∈ B, ι z ∈ B) (hμ : (μ : S) ∈ B) : ((μ⁻¹ : Sˣ) : S) ∈ B := by rw [← hιμ]; exact hB _ hμ /-- **(2) B' = A'[μ].** `B = closure {μ^(d j) * a j}`, all `a j` ι-fixed, one generator`μ^(d j₀) * a j₀` a unit of `B` with `Coprime (2 d j₀) n`. Then `B = closure (range a ∪ {μ})`. -/theorem B_eq_closure (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (n : ℕ) (hn : (μ : S) ^ n = 1) {J : Type*} (d : J → ℕ) (a : J → S) (hιa : ∀ j, ι (a j) = a j) (B : Subring S) (hBdef : B = Subring.closure (Set.range fun j => (μ : S) ^ d j * a j)) (hB : ∀ z ∈ B, ι z ∈ B) (j₀ : J) (hcop : Nat.Coprime (2 * d j₀) n) (y : S) (hy : y ∈ B) (hxy : (μ : S) ^ d j₀ * a j₀ * y = 1) : B = Subring.closure (Set.range a ∪ {(μ : S)}) := by have hgen : ∀ j, (μ : S) ^ d j * a j ∈ B := fun j => by rw [hBdef]; exact Subring.subset_closure ⟨j, rfl⟩ have hμ : (μ : S) ∈ B := mu_mem ι μ hιμ n (d j₀) hn hcop B hB (a j₀) y (hιa j₀) (hgen j₀) hy hxy have hμi := mu_inv_mem ι μ hιμ B hB hμ apply le_antisymm · rw [hBdef, Subring.closure_le] rintro _ ⟨j, rfl⟩ have hμC : (μ : S) ∈ Subring.closure (Set.range a ∪ {(μ : S)}) := Subring.subset_closure (Or.inr rfl) have haC : a j ∈ Subring.closure (Set.range a ∪ {(μ : S)}) := Subring.subset_closure (Or.inl ⟨j, rfl⟩) exact Subring.mul_mem _ (Subring.pow_mem _ hμC _) haC · rw [Subring.closure_le] rintro _ (⟨j, rfl⟩ | h) · have : a j = ((μ⁻¹ : Sˣ) : S) ^ d j * ((μ : S) ^ d j * a j) := by rw [← mul_assoc, ← mul_pow, Units.inv_mul, one_pow, one_mul] rw [this] exact B.mul_mem (B.pow_mem hμi _) (hgen j) · rw [Set.mem_singleton_iff] at h; rw [h]; exact hμ section DirectSum variable (ι : S →+* S) (μ : Sˣ) /-- **(3a) spanning.** If `R` contains `τ = μ + μ⁻¹`, every element of `R[μ]` is `a + b μ`. -/theorem mem_closure_iff_exists (R : Subring S) (hτ : (μ : S) + ((μ⁻¹ : Sˣ) : S) ∈ R) (z : S) : z ∈ Subring.closure ((R : Set S) ∪ {(μ : S)}) ↔ ∃ a ∈ R, ∃ b ∈ R, z = a + b * μ := by constructor · intro hz -- μ² = τ μ - 1 have hsq : (μ : S) * μ = ((μ : S) + ((μ⁻¹ : Sˣ) : S)) * μ - 1 := by have := Units.inv_mul μ linear_combination -this induction hz using Subring.closure_induction with | mem x hx => rcases hx with hx | hx · exact ⟨x, hx, 0, R.zero_mem, by ring⟩ · rw [Set.mem_singleton_iff] at hx exact ⟨0, R.zero_mem, 1, R.one_mem, by rw [hx]; ring⟩ | zero => exact ⟨0, R.zero_mem, 0, R.zero_mem, by ring⟩ | one => exact ⟨1, R.one_mem, 0, R.zero_mem, by ring⟩ | add x w _ _ hx hw => obtain ⟨a, ha, b, hb, rfl⟩ := hx obtain ⟨c, hc, e, he, rfl⟩ := hw exact ⟨a + c, R.add_mem ha hc, b + e, R.add_mem hb he, by ring⟩ | neg x _ hx => obtain ⟨a, ha, b, hb, rfl⟩ := hx exact ⟨-a, R.neg_mem ha, -b, R.neg_mem hb, by ring⟩ | mul x w _ _ hx hw => obtain ⟨a, ha, b, hb, rfl⟩ := hx obtain ⟨c, hc, e, he, rfl⟩ := hw set τ := (μ : S) + ((μ⁻¹ : Sˣ) : S) refine ⟨a * c - b * e, R.sub_mem (R.mul_mem ha hc) (R.mul_mem hb he), a * e + b * c + b * e * τ, R.add_mem (R.add_mem (R.mul_mem ha he) (R.mul_mem hb hc)) (R.mul_mem (R.mul_mem hb he) hτ), ?_⟩ linear_combination (b * e) * hsq · rintro ⟨a, ha, b, hb, rfl⟩ exact Subring.add_mem _ (Subring.subset_closure (Or.inl ha)) (Subring.mul_mem _ (Subring.subset_closure (Or.inl hb)) (Subring.subset_closure (Or.inr rfl))) /-- **(3b) directness.** `a + b μ` ι-fixed with `a, b` ι-fixed and `μ - μ⁻¹` a non-zero-divisor⇒ `b = 0`. -/theorem eq_zero_of_fixed (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (hnzd : (μ : S) - ((μ⁻¹ : Sˣ) : S) ∈ nonZeroDivisors S) (a b : S) (hιa : ι a = a) (hιb : ι b = b) (hfix : ι (a + b * μ) = a + b * μ) : b = 0 := by rw [map_add, map_mul, hιa, hιb, hιμ] at hfix have h : b * ((μ : S) - ((μ⁻¹ : Sˣ) : S)) = 0 := by linear_combination -hfix exact (mem_nonZeroDivisors_iff_right.mp hnzd) b h /-- **(4) B'^ι = A'[τ].** With `R` ι-fixed containing `τ`, the ι-fixed elements of`R[μ] = closure (R ∪ {μ})` are exactly `R`. -/theorem fixed_iff_of_fixed_subring (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (hnzd : (μ : S) - ((μ⁻¹ : Sˣ) : S) ∈ nonZeroDivisors S) (R : Subring S) (hR : ∀ r ∈ R, ι r = r) (hτ : (μ : S) + ((μ⁻¹ : Sˣ) : S) ∈ R) (z : S) : (z ∈ Subring.closure ((R : Set S) ∪ {(μ : S)}) ∧ ι z = z) ↔ z ∈ R := by constructor · rintro ⟨hz, hfix⟩ obtain ⟨a, ha, b, hb, rfl⟩ := (mem_closure_iff_exists μ R hτ _).mp hz have := eq_zero_of_fixed ι μ hιμ hnzd a b (hR a ha) (hR b hb) hfix rw [this, zero_mul, add_zero]; exact ha · intro hz exact ⟨Subring.subset_closure (Or.inl hz), hR z hz⟩ end DirectSum /-- **Lemma 5.4 assembled.** Hypotheses as in `B_eq_closure`, plus `μ - μ⁻¹` a non-zero-divisor.With `R := A'[τ] = closure (range a ∪ {τ})`: `B = R[μ]` and `B^ι = R`. -/theorem recentering (ι : S →+* S) (μ : Sˣ) (hιμ : ι μ = ((μ⁻¹ : Sˣ) : S)) (n : ℕ) (hn : (μ : S) ^ n = 1) {J : Type*} (d : J → ℕ) (a : J → S) (hιa : ∀ j, ι (a j) = a j) (B : Subring S) (hBdef : B = Subring.closure (Set.range fun j => (μ : S) ^ d j * a j)) (hB : ∀ z ∈ B, ι z ∈ B) (j₀ : J) (hcop : Nat.Coprime (2 * d j₀) n) (y : S) (hy : y ∈ B) (hxy : (μ : S) ^ d j₀ * a j₀ * y = 1) (hnzd : (μ : S) - ((μ⁻¹ : Sˣ) : S) ∈ nonZeroDivisors S) : let R := Subring.closure (Set.range a ∪ {(μ : S) + ((μ⁻¹ : Sˣ) : S)}) B = Subring.closure ((R : Set S) ∪ {(μ : S)}) ∧ ∀ z, (z ∈ B ∧ ι z = z ↔ z ∈ R) := by intro R have hτR : (μ : S) + ((μ⁻¹ : Sˣ) : S) ∈ R := Subring.subset_closure (Or.inr rfl) have hRfix : ∀ r ∈ R, ι r = r := by intro r hr have hle : R ≤ (ι.eqLocus (RingHom.id S)) := by rw [Subring.closure_le] rintro _ (⟨j, rfl⟩ | h) · exact hιa j · rw [Set.mem_singleton_iff] at h rw [h, SetLike.mem_coe, RingHom.mem_eqLocus, map_add, hιμ, iota_inv ι μ hιμ, RingHom.id_apply, add_comm] exact hle hr have hB' := B_eq_closure ι μ hιμ n hn d a hιa B hBdef hB j₀ hcop y hy hxy -- closure (range a ∪ {μ}) = closure (R ∪ {μ}) have hμB : (μ : S) ∈ B := by rw [hB']; exact Subring.subset_closure (Or.inr rfl) have hμiB := mu_inv_mem ι μ hιμ B hB hμB have hEq : B = Subring.closure ((R : Set S) ∪ {(μ : S)}) := by apply le_antisymm · rw [hB', Subring.closure_le] rintro _ (⟨j, rfl⟩ | h) · exact Subring.subset_closure (Or.inl (Subring.subset_closure (Or.inl ⟨j, rfl⟩))) · exact Subring.subset_closure (Or.inr h) · rw [Subring.closure_le] rintro _ (hr | h) · have hRB : R ≤ B := by rw [Subring.closure_le] rintro _ (⟨j, rfl⟩ | h) · rw [hB']; exact Subring.subset_closure (Or.inl ⟨j, rfl⟩) · rw [Set.mem_singleton_iff] at h; rw [h]; exact B.add_mem hμB hμiB exact hRB hr · rw [Set.mem_singleton_iff] at h; rw [h]; exact hμB refine ⟨hEq, fun z => ?_⟩ rw [hEq] exact fixed_iff_of_fixed_subring ι μ hιμ hnzd R hRfix hτR z end NotaPuente.Recentering