Skip to content

Lean formalization of the Riemann Hypothesis (Alpöge, 2026-11-20) being cleaned up by members of the Lean community.

Python

refactor(New/UpperBound): use Mathlib for nonzero images under injective ring maps

√28ff63bf49ee8
diff --git a/src/New/UpperBound/ElementaryDivisors/Depth.lean b/src/New/UpperBound/ElementaryDivisors/Depth.lean
index 1074396e94e..8d092d094bb 100644
--- a/src/New/UpperBound/ElementaryDivisors/Depth.lean
+++ b/src/New/UpperBound/ElementaryDivisors/Depth.lean
@@ -64,10 +64,6 @@ section DeepForms
variable {N k : ℕ} {W K : Type} [CommRing W] [IsLocalRing W] [Field K] (T : FrobeniusCycle N W K)
-private lemma ringHom_ne_zero {R S : Type*} [NonAssocSemiring R] [NonAssocSemiring S]
- {f : R →+* S} (hf : Function.Injective f) {a : R} (ha : a ≠ 0) : f a ≠ 0 :=
- fun h ↦ ha (hf (h.trans (RingHom.map_zero f).symm))
-
theorem deepIndicator_eq_zero_or_eq_one (r : ℕ) (v : Fin k × ZMod N) :
T.deepIndicator r v = 0 ∨ T.deepIndicator r v = 1 :=
(ite_eq_or_eq _ 1 0).symm
@@ -207,7 +203,7 @@ theorem specializeShallow_polyOfCoeffs_ne_zero {L : Type} [CommRing L] {n : ℕ}
{F : Exponents N k n → K} (hF_ne : F ≠ 0) : T.specializeShallow r x (polyOfCoeffs F) ≠ 0 := by
obtain ⟨β, hβ⟩ : ∃ β : Exponents N k n, F β ≠ 0 := Function.ne_iff.1 hF_ne
have h_coeff : (polyOfCoeffs F).coeff (exponentOf β) = F β := by simp [polyOfCoeffs]
- exact ringHom_ne_zero (T.specializeShallow_injective r hx)
+ exact (map_ne_zero_iff _ (T.specializeShallow_injective r hx)).mpr
(MvPolynomial.ne_zero_iff.2 ⟨exponentOf β, h_coeff.trans_ne hβ⟩)
/-- The ring map `T.specializeShallow r x` keeps the deep variables and reads the others in `L`
@@ -335,7 +331,7 @@ lemma single_mem_lowPowerForms_of_ne_zero {r m : ℕ} (hm : 2 * r + m = k) {L :
simpa [entryRow, Fin.ext_iff] using congrArg Prod.fst h_var
have h_unit : IsUnit (x.mapMatrix M) := by
rw [isUnit_iff_isUnit_det, ← x.map_det]
- exact (ringHom_ne_zero hx h_det).isUnit
+ exact ((map_ne_zero_iff x hx).mpr h_det).isUnit
obtain ⟨μ, hμ⟩ : ∃ μ : Fin r → L, μ ᵥ* x.mapMatrix M = Pi.single b 1 :=
vecMul_surjective_iff_isUnit.2 h_unit _
let row (u : Fin r) : Fin r × Fin (m + 1) → L :=
@@ -387,9 +383,9 @@ lemma single_zero_mem_lowPowerForms {r m : ℕ} (hm : 2 * r + m = k) {L : Type}
dsimp only [row, Function.comp_apply, entryCoeff]
cases h_even : T.isEven i
· simp only [v, rootVar, h_even, Bool.false_eq_true, ↓reduceIte, mul_neg, mul_one]
- exact ringHom_ne_zero hx (neg_ne_zero.mpr (X_ne_zero _))
+ exact (map_ne_zero_iff x hx).mpr (neg_ne_zero.mpr (X_ne_zero _))
· simp only [v, rootVar, h_even, ↓reduceIte, mul_one]
- exact ringHom_ne_zero hx (X_ne_zero _)
+ exact (map_ne_zero_iff x hx).mpr (X_ne_zero _)
have h_other (b' : Fin r) (hb' : b' ≠ b) : row (b', 0) = 0 := by
suffices h_var : T.rootVar (entryRow hm (b', 0)) (entryCol hm (b', 0)) v.2 ≠ v by
dsimp only [row, Function.comp_apply, entryCoeff]