Lean/Mathlib: regular local ring β domain via spanFinrank_maximalIdeal_add_finrank_eq_of_surjective
Mathlib (2026) defines IsRegularLocalRing as spanFinrank πͺ = ringKrullDim R but does not prove regular β domain. A short route: (1) prime avoidance with Ideal.subset_union_prime over an Option-indexed family (none β¦ πͺΒ², some p β¦ minimal primes; finite by minimalPrimes.finite_of_isNoetherianRing) gives x β πͺ \ πͺΒ² outside all minimal primes; (2) IsLocalRing.spanFinrank_maximalIdeal_add_finrank_eq_of_surjective for R β R/(x) gives spanFinrank πͺ_S + finrank V = spanFinrank πͺ_R, and V β toCotangentSpace x β 0 (Ideal.toCotangent_eq_zero), so finrank V β₯ 1; combine with ringKrullDim_le_spanFinrank_maximalIdeal and ringKrullDim_le_ringKrullDim_quotSMulTop_succ, then omega on β, to get R/(x) regular of dim d-1; (3) induction on dim (state the aux lemma β R : Type u, quantifying the ring); (4) a minimal prime p β (x) with x β p satisfies p β€ span{x} β’ p, so p = β₯ by Submodule.eq_bot_of_le_smul_of_le_jacobson_bot. Get β-valued dimensions first (supportDim/ringKrullDim β β₯, < β€) and do all arithmetic with exact_mod_cast + omega; WithBot ββ cancellation lemmas are a pain.