YukonModule.ProximityPrize.SubmissionLower.HFreeRegular6812.part0
DefinitionYukon_5a1990f0b7b832b98b8bcadbbetter-codes
Source module ProximityPrize.SubmissionLower.HFreeRegular6812.
Definition code
import Mathlib.RingTheory.RegularLocalRing.Defs
import Mathlib.RingTheory.Localization.AtPrime.Basic
import Mathlib.Tactic.LinearCombination
import Init
set_option backward.isDefEq.respectTransparency.types false
/-!
# H-free bridge, piece 1: two local generators of a height-`≤ 2` prime
If `A_𝔓` is a regular local ring and `height 𝔓 ≤ 2`, then `𝔓` is generated by two elements
`a, b ∈ 𝔓` after inverting an element outside `𝔓`: every `g ∈ 𝔓` satisfies
`s g = x a + y b` with `s ∉ 𝔓`. This is the hypothesis `hgen` of `local_dichotomy`
(HFreeLocal6812). For `A = K[X,Y,Y',γ]` the regularity instance is
`RCN230.mvPolynomial_atPrime_isRegularLocalRing`.
-/
namespace ProximityPrize.SubmissionLower.HFree6812
open IsLocalRing
theorem exists_two_local_generators {A : Type*} [CommRing A] (𝔓 : Ideal A) [𝔓.IsPrime]
[IsRegularLocalRing (Localization.AtPrime 𝔓)] (h : 𝔓.height ≤ 2) :
∃ a ∈ 𝔓, ∃ b ∈ 𝔓, ∀ g ∈ 𝔓, ∃ s ∉ 𝔓, ∃ x y : A, s * g = x * a + y * b := by
classical
let Aₚ := Localization.AtPrime 𝔓
have hdim : ringKrullDim Aₚ = 𝔓.height := IsLocalization.AtPrime.ringKrullDim_eq_height 𝔓 Aₚ
have hspan : ((maximalIdeal Aₚ).spanFinrank : WithBot ℕ∞) = ringKrullDim Aₚ :=
IsRegularLocalRing.spanFinrank_maximalIdeal
have hle : (maximalIdeal Aₚ).spanFinrank ≤ 2 := by
have h1 : ((maximalIdeal Aₚ).spanFinrank : WithBot ℕ∞) ≤ 2 := by
rw [hspan, hdim]
exact (WithBot.coe_le_coe.2 h).trans_eq rfl
exact_mod_cast h1
have hfg : (maximalIdeal Aₚ).FG := IsNoetherian.noetherian _
obtain ⟨s, hs, hspan'⟩ := Submodule.FG.exists_span_finset_card_eq_spanFinrank hfg
have hpair : ∃ a' b' : Aₚ, Ideal.span {a', b'} = maximalIdeal Aₚ := by
have hcard : s.card ≤ 2 := hs ▸ hle
have hcases : s.card = 0 ∨ s.card = 1 ∨ s.card = 2 := by omega
rcases hcases with hc | hc | hc
· rw [Finset.card_eq_zero] at hc
subst hc
refine ⟨0, 0, ?_⟩
rw [← hspan']
simp [Ideal.span]
· obtain ⟨x, rfl⟩ := Finset.card_eq_one.1 hc
refine ⟨x, 0, ?_⟩
rw [← hspan', Set.pair_comm, Ideal.span_insert_zero]
simp [Ideal.span]
· obtain ⟨x, y, -, rfl⟩ := Finset.card_eq_two.1 hc
refine ⟨x, y, ?_⟩
rw [← hspan']
simp [Ideal.span]
obtain ⟨a', b', hab⟩ := hpair
obtain ⟨a, b, d, ha', hb'⟩ := IsLocalization.surj₂ 𝔓.primeCompl Aₚ a' b'
have hmem : ∀ (z : Aₚ) (w : A), z ∈ maximalIdeal Aₚ →
z * algebraMap A Aₚ d = algebraMap A Aₚ w → w ∈ 𝔓 := by
intro z w hz hzw
rw [← IsLocalization.AtPrime.to_map_mem_maximal_iff Aₚ 𝔓, ← hzw]
exact Ideal.mul_mem_right _ _ hz
have ha : a ∈ 𝔓 := hmem a' a (hab ▸ Ideal.subset_span (by simp)) ha'
have hb : b ∈ 𝔓 := hmem b' b (hab ▸ Ideal.subset_span (by simp)) hb'
refine ⟨a, ha, b, hb, fun g hg => ?_⟩
have hgm : algebraMap A Aₚ g ∈ maximalIdeal Aₚ :=
(IsLocalization.AtPrime.to_map_mem_maximal_iff Aₚ 𝔓 g).2 hg
rw [← hab, Ideal.mem_span_pair] at hgm
obtain ⟨c, e, hce⟩ := hgm
obtain ⟨c₀, e₀, t, hc, he⟩ := IsLocalization.surj₂ 𝔓.primeCompl Aₚ c e
have key : algebraMap A Aₚ (t * d * g) = algebraMap A Aₚ (c₀ * a + e₀ * b) := by
rw [map_mul, map_mul, map_add, map_mul, map_mul, ← ha', ← hb', ← hc, ← he, ← hce]
ring
obtain ⟨u, hu⟩ := (IsLocalization.eq_iff_exists 𝔓.primeCompl Aₚ).1 key
refine ⟨u * (t * d), 𝔓.primeCompl.mul_mem u.2 (𝔓.primeCompl.mul_mem t.2 d.2),
u * c₀, u * e₀, ?_⟩
linear_combination hu
end ProximityPrize.SubmissionLower.HFree6812
Source