11import Mathlib.Algebra.Order.Star.Basic
2- import Mathlib.AlgebraicGeometry.PrimeSpectrum.Basic
32import Mathlib.Data.DFinsupp.WellFounded
4- import Mathlib.LinearAlgebra.Charpoly.Basic
5- import Mathlib.Order.CompletePartialOrder
6- import Mathlib.RingTheory.AdjoinRoot
73import LeanCamCombi.Mathlib.Algebra.Polynomial.Eval
84import LeanCamCombi.Mathlib.Data.Fintype.Card
95import LeanCamCombi.Mathlib.Data.Prod.Lex
106import LeanCamCombi.Mathlib.Order.RelClasses
117import LeanCamCombi.GrowthInGroups.PolynomialLocalization
128import LeanCamCombi.GrowthInGroups.PrimeSpectrumPolynomial
139
14- variable {R M A} [CommRing R] [AddCommGroup M] [Module R M] [CommRing A] [Algebra R A]
10+ variable {R S M A : Type *} [CommRing R] [CommRing S] [AddCommGroup M] [Module R M] [CommRing A]
11+ [Algebra R A]
1512
1613open Polynomial TensorProduct PrimeSpectrum
14+ open scoped Pointwise
1715
1816@[ext]
1917structure InductionObj (R) [CommRing R] (n : ℕ) where
2018 val : Fin n → R[X]
2119
22- variable {n : ℕ} (S T : InductionObj R n)
20+ variable {n : ℕ}
2321
2422instance : CoeFun (InductionObj R n) (fun _ ↦ Fin n → R[X]) := ⟨InductionObj.val⟩
2523
2624namespace InductionObj
2725
28- def coeffSubmodule : Submodule ℤ R := Submodule.span ℤ ({1 } ∪ ⋃ i, Set.range (S.val i).coeff)
26+ def coeffSubmodule (e : InductionObj R n) : Submodule ℤ R :=
27+ .span ℤ ({1 } ∪ ⋃ i, Set.range (e.val i).coeff)
2928
30- lemma one_le_coeffSubmodule : 1 ≤ S.coeffSubmodule := by
29+ lemma coeffSubmodule_mapRingHom_comp (e : InductionObj R n) (f : R →+* S) :
30+ ({ val := mapRingHom f ∘ e.val } : InductionObj S n).coeffSubmodule
31+ = e.coeffSubmodule.map f.toIntAlgHom.toLinearMap := by
32+ simp [coeffSubmodule, Submodule.map_span, Set.image_insert_eq, Set.image_iUnion, ← Set.range_comp,
33+ coeff_map_eq_comp]
34+
35+ variable {e T : InductionObj R n}
36+
37+ lemma one_le_coeffSubmodule : 1 ≤ e.coeffSubmodule := by
3138 rw [Submodule.one_eq_span, Submodule.span_le, Set.singleton_subset_iff]
3239 exact Submodule.subset_span (.inl rfl)
3340
3441variable (n) in
3542abbrev DegreeType := (Fin n → WithBot ℕ) ×ₗ Prop
3643
44+ variable (S) in
3745def degree : DegreeType n :=
38- toLex (Polynomial.degree ∘ S .val, ¬ ∃ i, (S .val i).Monic ∧
39- ∀ j, S .val j ≠ 0 → (S .val i).degree ≤ (S .val j).degree)
46+ toLex (Polynomial.degree ∘ e .val, ¬ ∃ i, (e .val i).Monic ∧
47+ ∀ j, e .val j ≠ 0 → (e .val i).degree ≤ (e .val j).degree)
4048
41- @[simp] lemma ofLex_degree_fst (i) : (ofLex S .degree).fst i = (S .val i).degree := rfl
42- lemma ofLex_degree_snd : (ofLex S .degree).snd = ¬ ∃ i, (S .val i).Monic ∧
43- ∀ j, S .val j ≠ 0 → (S .val i).degree ≤ (S .val j).degree := rfl
49+ @[simp] lemma ofLex_degree_fst (i) : (ofLex e .degree).fst i = (e .val i).degree := rfl
50+ lemma ofLex_degree_snd : (ofLex e .degree).snd = ¬ ∃ i, (e .val i).Monic ∧
51+ ∀ j, e .val j ≠ 0 → (e .val i).degree ≤ (e .val j).degree := rfl
4452
45- def degBound : ℕ := 2 ^ ∑ i, (S .val i).natDegree
53+ def degBound : ℕ := 2 ^ ∑ i, (e .val i).natDegree
4654
47- def exponentBound : ℕ := S .degBound ^ S .degBound
55+ def exponentBound : ℕ := e .degBound ^ e .degBound
4856
49- def InductionStatement (R) (n) [CommRing R] (S : InductionObj R n) : Prop :=
57+ def InductionStatement (R) (n) [CommRing R] (e : InductionObj R n) : Prop :=
5058 ∀ f, ∃ T : Finset (Σ n, R × (Fin n → R)),
51- comap C '' (zeroLocus (Set.range S .val) \ zeroLocus {f}) =
59+ comap C '' (zeroLocus (Set.range e .val) \ zeroLocus {f}) =
5260 ⋃ C ∈ T, (zeroLocus (Set.range C.2 .2 ) \ zeroLocus {C.2 .1 }) ∧
53- ∀ C ∈ T, C.1 ≤ S.degBound ∧ ∀ i, C.2 .2 i ∈ S.coeffSubmodule ^ S.exponentBound
61+ ∀ C ∈ T, C.1 ≤ e.degBound ∧ ∀ i, C.2 .2 i ∈ e.coeffSubmodule ^ e.exponentBound
62+
63+ open Submodule in
64+ lemma coeffSubmodule_smul (e : InductionObj R n) (f : R →+* S) (a : R) [Invertible (f a)] :
65+ ({ val := ⅟(f a) • mapRingHom f ∘ e.val } : InductionObj S n).coeffSubmodule =
66+ ⅟(f a) ^ e.degBound • (span ℤ ({a} ∪ ⋃ i, Set.range (e.val i).coeff)).map f.toIntAlgHom.toLinearMap := by
67+ sorry -- probably useless
5468
5569universe u
5670
@@ -150,7 +164,7 @@ lemma foo_induction (n : ℕ)
150164universe v
151165
152166lemma comap_C_eq_comap_quotient_union_comap_localization (s : Set (PrimeSpectrum R[X])) (c : R) :
153- comap C '' s =
167+ . comap C '' s =
154168 comap (Ideal.Quotient.mk (.span {c})) '' (comap C ''
155169 (comap (mapRingHom (Ideal.Quotient.mk _)) ⁻¹' s)) ∪
156170 comap (algebraMap R (Localization.Away c)) '' (comap C ''
@@ -198,6 +212,7 @@ lemma Ideal.span_range_update_divByMonic {ι : Type*} [DecidableEq ι]
198212 · exact ⟨i, Function.update_noteq hij _ _⟩
199213 exact Ideal.subset_span ⟨k, Function.update_noteq (.symm hjk) _ _⟩
200214
215+ open Polynomial IsLocalization Localization in
201216lemma induction_aux (R) [CommRing R] (c : R) (i : Fin n) (e : InductionObj R n)
202217 (hi : c = (e.1 i).leadingCoeff) :
203218 InductionStatement (Localization.Away c) n
@@ -206,9 +221,13 @@ lemma induction_aux (R) [CommRing R] (c : R) (i : Fin n) (e : InductionObj R n)
206221 InductionStatement (R ⧸ Ideal.span {c}) n ⟨mapRingHom (algebraMap _ _) ∘ e.val⟩ →
207222 InductionStatement R n e := by
208223 intro H₁ H₂ f
209- obtain ⟨T₁, hT₁, HT₁⟩ := H₁ (mapRingHom (algebraMap _ _) f)
210- obtain ⟨T₂, hT₂, HT₂⟩ := H₂ (mapRingHom (algebraMap _ _) f)
211- simp only [coe_mapRingHom] at HT₁
224+ obtain ⟨T₁, hT₁⟩ := H₁ (mapRingHom (algebraMap _ _) f)
225+ obtain ⟨T₂, hT₂⟩ := H₂ (mapRingHom (algebraMap _ _) f)
226+ simp only [forall_and] at hT₁ hT₂
227+ obtain ⟨hT₁, hT₁deg, hT₁span⟩ := hT₁
228+ obtain ⟨hT₂, hT₂deg, hT₂span⟩ := hT₂
229+ rw [coeffSubmodule_mapRingHom_comp, ← Submodule.map_pow] at hT₂span
230+ choose l₂ hl₂ using hT₂span
212231 sorry
213232
214233lemma isConstructible_comap_C_zeroLocus_sdiff_zeroLocus {R} [CommRing R] {n}
0 commit comments