@@ -10,12 +10,8 @@ open Polynomial TensorProduct PrimeSpectrum
1010abbrev Ideal.ResidueField (I : Ideal R) [I.IsPrime] : Type _ :=
1111 LocalRing.ResidueField (Localization.AtPrime I)
1212
13- lemma LocalRing.residue_surjective {R} [CommRing R] [LocalRing R] :
14- Function.Surjective (LocalRing.residue R) :=
15- Ideal.Quotient.mk_surjective
16-
1713instance {R S} [CommRing R] [CommRing S] [LocalRing S] [Algebra R S] :
18- Algebra R (LocalRing.ResidueField S) := by delta LocalRing.ResidueField; infer_instance
14+ Algebra R (LocalRing.ResidueField S) := by infer_instance
1915
2016@[simp]
2117lemma LocalRing.algebraMap_residueField {R} [CommRing R] [LocalRing R] :
@@ -54,8 +50,6 @@ lemma Ideal.ker_algebraMap_residueField (I : Ideal R) [I.IsPrime] :
5450 ext x
5551 exact Ideal.algebraMap_residueField_eq_zero
5652
57-
58- -- set_option
5953-- set_option synthInstance.maxHeartbeats 400000 in
6054-- noncomputable
6155-- instance (g : R[ X ] ) (x : Ideal R) [ x.IsPrime ] :
@@ -73,7 +67,7 @@ def fooBarMap (s : Set A) (I : Ideal A) (hg : s ⊆ I) [I.IsPrime] :
7367 · exact fun _ _ ↦ .all _ _
7468
7569-- set_option synthInstance.maxHeartbeats 400000 in
76- -- -- set_option maxHeartbeats 0 in
70+ -- set_option maxHeartbeats 0 in
7771lemma mem_image_comap_zeroLocus_sdiff (f : A) (s : Set A) (x) :
7872 x ∈ comap (algebraMap R A) '' (zeroLocus s \ zeroLocus {f}) ↔
7973 ¬ IsNilpotent (algebraMap A ((A ⧸ Ideal.span s) ⊗[R] x.asIdeal.ResidueField) f) := by
@@ -122,7 +116,6 @@ lemma mem_image_comap_basicOpen_iff_map_ne_zero (f : R[X]) (x : PrimeSpectrum R)
122116 · ext; simp [e]
123117 · simp [e, monomial_one_one_eq_X]
124118
125-
126119lemma image_comap_C_basicOpen (f : R[X]) :
127120 comap C '' basicOpen f = (zeroLocus (Set.range f.coeff))ᶜ := by
128121 ext p
@@ -139,13 +132,6 @@ lemma isOpenMap_comap_C : IsOpenMap (comap (R := R) C) := by
139132 simp only [image_comap_C_basicOpen]
140133 exact (isClosed_zeroLocus _).isOpen_compl
141134
142-
143- open Module in
144- lemma LinearMap.nilpotent_iff_charpoly {R M} [CommRing R] [IsDomain R] [AddCommGroup M]
145- [Module R M] [Free R M] [IsNoetherian R M] (φ : End R M) :
146- IsNilpotent φ ↔ charpoly φ = X ^ finrank R M :=
147- (LinearMap.charpoly_nilpotent_tfae φ).out 0 1
148-
149135lemma LinearMap.charpoly_baseChange {R M} [CommRing R] [AddCommGroup M] [Module R M]
150136 [Module.Free R M] [Module.Finite R M]
151137 {A} [CommRing A] [Algebra R A] (f : M →ₗ[R] M) :
@@ -179,7 +165,7 @@ lemma isNilpotent_tensor_residueField_iff
179165 simp only [Algebra.TensorProduct.algebraMap_apply, Algebra.id.map_eq_id, RingHom.id_apply,
180166 Algebra.coe_lmul_eq_mul, Algebra.TensorProduct.comm_tmul]
181167 rw [← IsNilpotent.map_iff (Algebra.lmul_injective (R := I.ResidueField)),
182- LinearMap.nilpotent_iff_charpoly , ← Algebra.baseChange_lmul, LinearMap.charpoly_baseChange]
168+ LinearMap.isNilpotent_iff_charpoly , ← Algebra.baseChange_lmul, LinearMap.charpoly_baseChange]
183169 simp_rw [this, ← ((LinearMap.mul R A) f).charpoly_natDegree]
184170 constructor
185171 · intro e i hi
@@ -290,107 +276,107 @@ lemma foo_induction
290276 (degree ∘ e, ¬ ∃ i, IsUnit (e i).leadingCoeff ∧ ∀ j, e j ≠ 0 →
291277 (e i).degree ≤ (e j).degree) with hv
292278 clear_value v
293- induction v using wellFounded_lt (α := (Fin (n + 1 ) → WithBot ℕ) ×ₗ Prop ).induction generalizing R with
294- | h v H_IH =>
295- by_cases he0 : e = 0
296- · rw [he0, Set.range_zero, Ideal.span_singleton_zero]; exact hP₁ R
297- cases subsingleton_or_nontrivial R
298- · rw [Subsingleton.elim (Ideal.span (Set.range e)) ⊥]; exact hP₁ R
299- simp only [funext_iff, Pi.zero_apply, not_forall] at he0
300- -- Case I : The `e i ≠ 0` with minimal degree has invertible leading coefficient
301- by_cases H : ∃ i, IsUnit (e i).leadingCoeff ∧ ∀ j, e j ≠ 0 → (e i).degree ≤ (e j).degree
302- · obtain ⟨i, hi, i_min⟩ := H
303- -- Case I.ii : `e j = 0` for all `j ≠ i`.
304- by_cases H' : ∀ j ≠ i, e j = 0
305- -- then `I = Ideal.span {e i}`
306- · convert hP₀ R (C ((hi.unit⁻¹ : Rˣ) : R) * e i) ?_ using 1
307- · refine le_antisymm ?_ ?_ <;>
308- simp only [Ideal.span_le, Set.range_subset_iff, Set.singleton_subset_iff]
309- · intro j
310- by_cases hij : i = j
311- · simp only [SetLike.mem_coe, Ideal.mem_span_singleton]
312- use C (e i).leadingCoeff
313- rw [mul_comm, ← mul_assoc, ← map_mul, IsUnit.mul_val_inv, map_one, one_mul, hij]
314- · rw [H' j (.symm hij)]
315- exact Ideal.zero_mem _
316- · exact Ideal.mul_mem_left _ _ (Ideal.subset_span (Set.mem_range_self i))
317- exact Polynomial.monic_unit_leadingCoeff_inv_smul _ _
318- -- Case I.i : There is another `e j ≠ 0`
319- · simp only [ne_eq, not_forall, Classical.not_imp] at H'
320- obtain ⟨j, hj, hj'⟩ := H'
321- replace i_min := i_min j hj'
322- -- then we can replace `e j` with `e j %ₘ (C h.unit⁻¹ * e i) `
323- -- with `h : IsUnit (e i).leadingCoeff`.
324- rw [← Ideal.span_range_update_divByMonic e i j (.symm hj) hi]
325- refine H_IH _ ?_ _ rfl
326- refine .left _ _ (lt_of_le_of_ne (b := (ofLex v).1 ) ?_ ?_)
327- · intro k
328- simp only [Function.comp_apply, Function.update_apply, hv, ne_eq, not_exists, not_and,
329- not_forall, Classical.not_imp, not_le, ofLex_toLex]
330- split_ifs with hjk
331- · rw [hjk]
332- refine (degree_modByMonic_le _
333- (monic_unit_leadingCoeff_inv_smul _ _)).trans
334- ((degree_C_mul_eq_of_mul_ne_zero _ _ ?_).trans_le i_min)
335- rw [IsUnit.val_inv_mul]
336- exact one_ne_zero
337- · exact le_rfl
338- · simp only [hv, ne_eq, not_exists, not_and, not_forall, not_le, funext_iff,
339- Function.comp_apply, exists_prop, ofLex_toLex]
340- use j
341- simp only [Function.update_same]
342- refine ((degree_modByMonic_lt _ (monic_unit_leadingCoeff_inv_smul _ _)).trans_le
343- ((degree_C_mul_eq_of_mul_ne_zero _ _ ?_).trans_le i_min)).ne
279+ induction' v using WellFoundedLT.induction with v H_IH generalizing R
280+ by_cases he0 : e = 0
281+ · rw [he0, Set.range_zero, Ideal.span_singleton_zero]; exact hP₁ R
282+ cases subsingleton_or_nontrivial R
283+ · rw [Subsingleton.elim (Ideal.span (Set.range e)) ⊥]; exact hP₁ R
284+ simp only [funext_iff, Pi.zero_apply, not_forall] at he0
285+ -- Case I : The `e i ≠ 0` with minimal degree has invertible leading coefficient
286+ by_cases H : ∃ i, IsUnit (e i).leadingCoeff ∧ ∀ j, e j ≠ 0 → (e i).degree ≤ (e j).degree
287+ · obtain ⟨i, hi, i_min⟩ := H
288+ -- Case I.ii : `e j = 0` for all `j ≠ i`.
289+ by_cases H' : ∀ j ≠ i, e j = 0
290+ -- then `I = Ideal.span {e i}`
291+ · convert hP₀ R (C ((hi.unit⁻¹ : Rˣ) : R) * e i) ?_ using 1
292+ · refine le_antisymm ?_ ?_ <;>
293+ simp only [Ideal.span_le, Set.range_subset_iff, Set.singleton_subset_iff]
294+ · intro j
295+ by_cases hij : i = j
296+ · simp only [SetLike.mem_coe, Ideal.mem_span_singleton]
297+ use C (e i).leadingCoeff
298+ rw [mul_comm, ← mul_assoc, ← map_mul, IsUnit.mul_val_inv, map_one, one_mul, hij]
299+ · rw [H' j (.symm hij)]
300+ exact Ideal.zero_mem _
301+ · exact Ideal.mul_mem_left _ _ (Ideal.subset_span (Set.mem_range_self i))
302+ exact Polynomial.monic_unit_leadingCoeff_inv_smul _ _
303+ -- Case I.i : There is another `e j ≠ 0`
304+ · simp only [ne_eq, not_forall, Classical.not_imp] at H'
305+ obtain ⟨j, hj, hj'⟩ := H'
306+ replace i_min := i_min j hj'
307+ -- then we can replace `e j` with `e j %ₘ (C h.unit⁻¹ * e i) `
308+ -- with `h : IsUnit (e i).leadingCoeff`.
309+ rw [← Ideal.span_range_update_divByMonic e i j (.symm hj) hi]
310+ refine H_IH _ ?_ _ rfl
311+ refine .left _ _ (lt_of_le_of_ne (b := (ofLex v).1 ) ?_ ?_)
312+ · intro k
313+ simp only [Function.comp_apply, Function.update_apply, hv, ne_eq, not_exists, not_and,
314+ not_forall, Classical.not_imp, not_le, ofLex_toLex]
315+ split_ifs with hjk
316+ · rw [hjk]
317+ refine (degree_modByMonic_le _
318+ (monic_unit_leadingCoeff_inv_smul _ _)).trans
319+ ((degree_C_mul_eq_of_mul_ne_zero _ _ ?_).trans_le i_min)
344320 rw [IsUnit.val_inv_mul]
345321 exact one_ne_zero
346- -- Case II : The `e i ≠ 0` with minimal degree has non-invertible leading coefficient
347- obtain ⟨i, hi, i_min⟩ : ∃ i, e i ≠ 0 ∧ ∀ j, e j ≠ 0 → (e i).degree ≤ (e j).degree := by
348- have : ∃ n : ℕ, ∃ i, (e i).degree = n ∧ (e i) ≠ 0 := by
349- obtain ⟨i, hi⟩ := he0; exact ⟨(e i).natDegree, i, degree_eq_natDegree hi, hi⟩
350- let m := Nat.find this
351- obtain ⟨i, hi, hi'⟩ : ∃ i, (e i).degree = m ∧ (e i) ≠ 0 := Nat.find_spec this
352- refine ⟨i, hi', fun j hj ↦ ?_⟩
353- refine hi.le.trans ?_
354- rw [degree_eq_natDegree hj, Nat.cast_le]
355- exact Nat.find_min' _ ⟨j, degree_eq_natDegree hj, hj⟩
356- have : ¬ IsUnit (e i).leadingCoeff := fun HH ↦ H ⟨i, HH, i_min⟩
357- -- We replace `R` by `R ⧸ Ideal.span {(e i).leadingCoeff}` where `(e i).degree` is lowered
358- -- and `Localization.Away (e i).leadingCoeff` where `(e i).leadingCoeff` becomes invertible.
359- apply hP _ (e i).leadingCoeff
360- · rw [Ideal.map_span, ← Set.range_comp]
361- refine H_IH _ ?_ _ rfl
362- rw [hv, Prod.Lex.lt_iff']
363- constructor
364- · intro j; simpa using degree_map_le _ _
365- simp only [coe_mapRingHom, Function.comp_apply, ne_eq, hv, ofLex_toLex,
366- not_exists, not_and, not_forall, Classical.not_imp, not_le, H, not_false_eq_true]
367- intro h_eq
368- rw [lt_iff_le_not_le]
369- simp only [exists_prop, le_Prop_eq, implies_true, true_implies, not_forall, Classical.not_imp,
370- not_exists, not_and, not_lt, true_and]
371- refine ⟨i, ?_, ?_⟩
372- · replace h_eq := congr_fun h_eq i
373- simp only [Function.comp_apply] at h_eq
374- have := IsLocalization.Away.algebraMap_isUnit (S := Localization.Away (e i).leadingCoeff)
375- (e i).leadingCoeff
376- convert this
377- nth_rw 2 [← coeff_natDegree]
378- rw [natDegree_eq_of_degree_eq h_eq, coeff_map, coeff_natDegree]
379- · intro j hj
380- refine le_trans ?_ ((i_min j (fun e ↦ hj (by simp [e]))).trans_eq (congr_fun h_eq j).symm)
381- simpa using degree_map_le _ _
382- · rw [Ideal.map_span, ← Set.range_comp]
383- refine H_IH _ ?_ _ rfl
384- rw [hv]
385- refine .left _ _ (lt_of_le_of_ne ?_ ?_)
386- · intro j; simpa using degree_map_le _ _
387- simp only [coe_mapRingHom, Function.comp_apply, ne_eq, hv, ofLex_toLex,
388- not_exists, not_and, not_forall, Classical.not_imp, not_le, H, not_false_eq_true]
389- intro h_eq
390- replace h_eq := congr_fun h_eq i
391- simp only [Ideal.Quotient.algebraMap_eq, Function.comp_apply, degree_map_eq_iff,
392- Ideal.Quotient.mk_singleton_self, ne_eq, not_true_eq_false, false_or] at h_eq
393- exact hi h_eq
322+ · exact le_rfl
323+ · simp only [hv, ne_eq, not_exists, not_and, not_forall, not_le, funext_iff,
324+ Function.comp_apply, exists_prop, ofLex_toLex]
325+ use j
326+ simp only [Function.update_same]
327+ refine ((degree_modByMonic_lt _ (monic_unit_leadingCoeff_inv_smul _ _)).trans_le
328+ ((degree_C_mul_eq_of_mul_ne_zero _ _ ?_).trans_le i_min)).ne
329+ rw [IsUnit.val_inv_mul]
330+ exact one_ne_zero
331+ -- Case II : The `e i ≠ 0` with minimal degree has non-invertible leading coefficient
332+ obtain ⟨i, hi, i_min⟩ : ∃ i, e i ≠ 0 ∧ ∀ j, e j ≠ 0 → (e i).degree ≤ (e j).degree := by
333+ have : ∃ n : ℕ, ∃ i, (e i).degree = n ∧ (e i) ≠ 0 := by
334+ obtain ⟨i, hi⟩ := he0; exact ⟨(e i).natDegree, i, degree_eq_natDegree hi, hi⟩
335+ let m := Nat.find this
336+ obtain ⟨i, hi, hi'⟩ : ∃ i, (e i).degree = m ∧ (e i) ≠ 0 := Nat.find_spec this
337+ refine ⟨i, hi', fun j hj ↦ ?_⟩
338+ refine hi.le.trans ?_
339+ rw [degree_eq_natDegree hj, Nat.cast_le]
340+ exact Nat.find_min' _ ⟨j, degree_eq_natDegree hj, hj⟩
341+ have : ¬ IsUnit (e i).leadingCoeff := fun HH ↦ H ⟨i, HH, i_min⟩
342+ -- We replace `R` by `R ⧸ Ideal.span {(e i).leadingCoeff}` where `(e i).degree` is lowered
343+ -- and `Localization.Away (e i).leadingCoeff` where `(e i).leadingCoeff` becomes invertible.
344+ apply hP _ (e i).leadingCoeff
345+ · rw [Ideal.map_span, ← Set.range_comp]
346+ refine H_IH _ ?_ _ rfl
347+ rw [hv, Prod.Lex.lt_iff']
348+ constructor
349+ · intro j; simpa using degree_map_le _ _
350+ simp only [coe_mapRingHom, Function.comp_apply, ne_eq, hv, ofLex_toLex,
351+ not_exists, not_and, not_forall, Classical.not_imp, not_le, H, not_false_eq_true]
352+ intro h_eq
353+ rw [lt_iff_le_not_le]
354+ simp only [exists_prop, le_Prop_eq, implies_true, true_implies, not_forall, Classical.not_imp,
355+ not_exists, not_and, not_lt, true_and]
356+ refine ⟨i, ?_, ?_⟩
357+ · replace h_eq := congr_fun h_eq i
358+ simp only [Function.comp_apply] at h_eq
359+ have := IsLocalization.Away.algebraMap_isUnit (S := Localization.Away (e i).leadingCoeff)
360+ (e i).leadingCoeff
361+ convert this
362+ nth_rw 2 [← coeff_natDegree]
363+ rw [natDegree_eq_of_degree_eq h_eq, coeff_map, coeff_natDegree]
364+ · intro j hj
365+ refine le_trans ?_ ((i_min j (fun e ↦ hj (by simp [e]))).trans_eq (congr_fun h_eq j).symm)
366+ simpa using degree_map_le _ _
367+ · rw [Ideal.map_span, ← Set.range_comp]
368+ refine H_IH _ ?_ _ rfl
369+ rw [hv]
370+ refine .left _ _ (lt_of_le_of_ne ?_ ?_)
371+ · intro j; simpa using degree_map_le _ _
372+ simp only [coe_mapRingHom, Function.comp_apply, ne_eq, hv, ofLex_toLex,
373+ not_exists, not_and, not_forall, Classical.not_imp, not_le, H, not_false_eq_true]
374+ intro h_eq
375+ replace h_eq := congr_fun h_eq i
376+ simp only [Ideal.Quotient.algebraMap_eq, Function.comp_apply, degree_map_eq_iff,
377+ Ideal.Quotient.mk_singleton_self, ne_eq, not_true_eq_false, false_or] at h_eq
378+ exact hi h_eq
379+ · sorry
394380
395381universe v
396382
0 commit comments