🏛️ Atlas✒️Formalizations.RingTheory.FreeField.ThreeAxes.ExactArc view on GitHub ↗12 theorems
/-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 Formalizations.LinearAlgebra.Matrix.FinTwopublic import Mathlib.Algebra.Ring.Invertiblepublic import Mathlib.LinearAlgebra.Matrix.Determinant.Basicpublic import Mathlib.LinearAlgebra.Matrix.Tracepublic import Mathlib.LinearAlgebra.Matrix.Notationpublic import Mathlib.Data.Matrix.Blockpublic import Mathlib.Algebra.CharP.Lemmaspublic import Mathlib.Tactic.Ringpublic import Mathlib.Tactic.LinearCombinationpublic import Mathlib.Tactic.FinCasespublic import Mathlib.Tactic.NoncommRing /-!# The exact arc for the three-axes problem Finite identities behind the proof that `s⁻¹`, `s = u⁻² + v⁻² + w⁻²`, does not lie in the firstlayer generated by inverses of binomials, stated in general form. ## Main results * `sq_eq_neg_det_of_trace_zero`: a `2×2` matrix over a commutative ring with trace `0` squares to  `−det • 1`. `exactArc_sq`: `U = !![i t², −t; i² t³ − η, −i t²]` satisfies `U * U = (t η) • 1`;  `exactArc_sq_pow`: with `η = t^k`, `U * U = t^(k+1) • 1`.* `prod_scalar_interleave`: in an `R`-algebra, `a₀ (c b₁) (c b₂) ⋯ (c b_r)` with `c` a scalar  equals `c^r • (a₀ b₁ ⋯ b_r)` (evaluation of `𝒥^r` where every `u_j²` is the scalar `c`).  `H0_eval`: if `u², v², w²` all equal `s • 1`, then `[[u²+v², u²],[u², u²+w²]] = s • [[2,1],[1,2]]`;  `H_eval_pow`: the same for `H_{3,2r}`, with `s^r`.* `inv_add_inv`: for units `a`, `b`, `a⁻¹ + b⁻¹ = a⁻¹ (a + b) b⁻¹`; `inv_add_inv_inverse`: if  `a + b` is a unit `e`, then `b e⁻¹ a` is a two-sided inverse of `a⁻¹ + b⁻¹`.* `one_add_pow_char`: in characteristic `p`, `(1 + x)^p = 1 + x^p`; `inv_sq_char`: if `1 + x^p` is  a unit `e`, then `(1+x)^(p−2) e⁻¹` is a two-sided inverse of `(1+x)²` (so the non-membership  result fails in characteristic `p`). ## Related Three statements are restated here under the names the paper cites, with one-line proofs fromexisting lemmas: `sq_eq_neg_det_of_trace_zero` is the trace-zero case of the `2×2`Cayley–Hamilton identity `Matrix.mul_self_eq_trace_smul_sub_det_smul_fin_two` (in`Formalizations.LinearAlgebra.Matrix.FinTwo`); `inv_add_inv` is Mathlib's `invOf_add_invOf`for the `Invertible` instance of a unit; `one_add_pow_char` is Mathlib's`add_pow_char_of_commute` with `Commute.one_left`.-/ @[expose] public section namespace ThreeAxes.ExactArc open Matrix /-! ### T1: trace-zero 2×2 matrices have scalar square; the exact arc -/ /-- A traceless `2×2` matrix squares to `−det • 1` (the trace-zero case of`Matrix.mul_self_eq_trace_smul_sub_det_smul_fin_two`). -/theorem sq_eq_neg_det_of_trace_zero {R : Type*} [CommRing R] (M : Matrix (Fin 2) (Fin 2) R)    (h : M.trace = 0) : M * M = (-M.det) • (1 : Matrix (Fin 2) (Fin 2) R) := by  rw [Matrix.mul_self_eq_trace_smul_sub_det_smul_fin_two, h, zero_smul, zero_sub, neg_smul] /-- The exact arc: one matrix per index `i`, perturbation `η` (take `η = t^k`). -/def exactArc {R : Type*} [CommRing R] (i t η : R) : Matrix (Fin 2) (Fin 2) R :=  !![i * t ^ 2, -t; i ^ 2 * t ^ 3 - η, -(i * t ^ 2)] theorem exactArc_trace {R : Type*} [CommRing R] (i t η : R) : (exactArc i t η).trace = 0 := by  simp [exactArc, Matrix.trace_fin_two] theorem exactArc_det {R : Type*} [CommRing R] (i t η : R) : (exactArc i t η).det = -(t * η) := by  simp [exactArc, Matrix.det_fin_two]; ring theorem exactArc_sq {R : Type*} [CommRing R] (i t η : R) :    exactArc i t η * exactArc i t η = (t * η) • (1 : Matrix (Fin 2) (Fin 2) R) := by  rw [sq_eq_neg_det_of_trace_zero _ (exactArc_trace i t η), exactArc_det, neg_neg] theorem exactArc_sq_pow {R : Type*} [CommRing R] (i t : R) (k : ℕ) :    exactArc i t (t ^ k) * exactArc i t (t ^ k) = t ^ (k + 1) • (1 : Matrix (Fin 2) (Fin 2) R) := by  rw [exactArc_sq, pow_succ'] /-! ### T2: scalar evaluation -/ theorem prod_scalar_interleave {R S : Type*} [CommSemiring R] [Semiring S] [Algebra R S] (c : R) (a : S)    (l : List S) :    a * (l.map fun b => algebraMap R S c * b).prod = c ^ l.length • (a * l.prod) := by  induction l generalizing a with  | nil => simp  | cons b l ih =>    simp only [List.map_cons, List.prod_cons, List.length_cons]    rw [← mul_assoc, ← mul_assoc, ← Algebra.commutes, mul_assoc (algebraMap R S c), ← Algebra.smul_def,      smul_mul_assoc, ih, smul_smul, ← pow_succ', mul_assoc] theorem H0_eval {R n : Type*} [CommRing R] [Fintype n] [DecidableEq n] (s : R)    (u v w : Matrix n n R) (hu : u * u = s • 1) (hv : v * v = s • 1) (hw : w * w = s • 1) :    Matrix.fromBlocks (u * u + v * v) (u * u) (u * u) (u * u + w * w) =      s • Matrix.fromBlocks (1 + 1 : Matrix n n R) 1 1 (1 + 1) := by  rw [hu, hv, hw, Matrix.fromBlocks_smul, smul_add] /-- Lemma 4.2(2) for every `r`: if `u², v², w²` all equal `s • 1`, then`H_{3,2r} = [[u^{2r}+v^{2r}, u^{2r}],[u^{2r}, u^{2r}+w^{2r}]] = s^r • [[2,1],[1,2]]`. -/theorem H_eval_pow {R n : Type*} [CommRing R] [Fintype n] [DecidableEq n] (s : R)    (u v w : Matrix n n R) (hu : u * u = s • 1) (hv : v * v = s • 1) (hw : w * w = s • 1)    (r : ℕ) :    Matrix.fromBlocks (u ^ (2 * r) + v ^ (2 * r)) (u ^ (2 * r)) (u ^ (2 * r))        (u ^ (2 * r) + w ^ (2 * r)) =      s ^ r • Matrix.fromBlocks (1 + 1 : Matrix n n R) 1 1 (1 + 1) := by  have key : ∀ x : Matrix n n R, x * x = s • 1 → x ^ (2 * r) = s ^ r • 1 := fun x hx => by    rw [pow_mul, sq, hx, smul_pow, one_pow]  rw [key u hu, key v hv, key w hw, Matrix.fromBlocks_smul, smul_add] /-! ### T3: two axes -/ /-- `a⁻¹ + b⁻¹ = a⁻¹ (a + b) b⁻¹` for units. This is Mathlib's `invOf_add_invOf`, restated for`Rˣ` under the name the paper cites. -/theorem inv_add_inv {R : Type*} [Ring R] (a b : Rˣ) :    ((a⁻¹ : Rˣ) : R) + ((b⁻¹ : Rˣ) : R) = (a⁻¹ : Rˣ) * ((a : R) + b) * (b⁻¹ : Rˣ) :=  invOf_add_invOf (a : R) (b : R) theorem inv_add_inv_inverse {R : Type*} [Ring R] (a b e : Rˣ) (he : (e : R) = a + b) :    ((b : R) * (e⁻¹ : Rˣ) * a) * (((a⁻¹ : Rˣ) : R) + ((b⁻¹ : Rˣ) : R)) = 1 ∧    (((a⁻¹ : Rˣ) : R) + ((b⁻¹ : Rˣ) : R)) * ((b : R) * (e⁻¹ : Rˣ) * a) = 1 := by  rw [inv_add_inv, ← he]  constructor  · calc (b : R) * (e⁻¹ : Rˣ) * a * ((a⁻¹ : Rˣ) * e * (b⁻¹ : Rˣ))        = (b : R) * (e⁻¹ : Rˣ) * (a * (a⁻¹ : Rˣ)) * e * (b⁻¹ : Rˣ) := by noncomm_ring      _ = 1 := by        rw [Units.mul_inv, mul_one, mul_assoc (b : R), Units.inv_mul, mul_one, Units.mul_inv]  · calc ((a⁻¹ : Rˣ) : R) * e * (b⁻¹ : Rˣ) * (b * (e⁻¹ : Rˣ) * a)        = ((a⁻¹ : Rˣ) : R) * e * ((b⁻¹ : Rˣ) * b) * (e⁻¹ : Rˣ) * a := by noncomm_ring      _ = 1 := by        rw [Units.inv_mul, mul_one, mul_assoc ((a⁻¹ : Rˣ) : R), Units.mul_inv, mul_one, Units.inv_mul] /-! ### T4: characteristic p -/ /-- `(1 + x)^p = 1 + x^p` in characteristic `p`: Mathlib's `add_pow_char_of_commute` with`Commute.one_left`, restated under the name the paper cites. -/theorem one_add_pow_char {R : Type*} [Ring R] (p : ℕ) [Fact p.Prime] [CharP R p] (x : R) :    (1 + x) ^ p = 1 + x ^ p := by  rw [add_pow_char_of_commute (p := p) (h := Commute.one_left x), one_pow] theorem inv_sq_char {R : Type*} [Ring R] (p : ℕ) [Fact p.Prime] [CharP R p] (x : R) (e : Rˣ)    (he : (e : R) = 1 + x ^ p) :    (1 + x) ^ 2 * ((1 + x) ^ (p - 2) * (e⁻¹ : Rˣ)) = 1 ∧    ((1 + x) ^ (p - 2) * (e⁻¹ : Rˣ)) * (1 + x) ^ 2 = 1 := by  have hp : 2 ≤ p := (Fact.out : p.Prime).two_le  have hpow : (1 + x) ^ 2 * (1 + x) ^ (p - 2) = e := by    rw [← pow_add, Nat.add_sub_cancel' hp, he, one_add_pow_char p]  have hcomm : Commute (e : R) ((1 + x) ^ 2) := by    rw [← hpow]; exact (Commute.pow_pow_self (1 + x) 2 2).mul_left (Commute.pow_pow_self (1 + x) (p - 2) 2)  refine ⟨by rw [← mul_assoc, hpow, Units.mul_inv], ?_⟩  rw [mul_assoc, hcomm.units_inv_left.eq, ← mul_assoc, (Commute.pow_pow_self (1 + x) (p - 2) 2).eq, hpow,    Units.mul_inv] end ThreeAxes.ExactArc