|
1 | 1 | import Mathlib |
2 | 2 | import LeanCamCombi.Mathlib.Data.Prod.Lex |
| 3 | +import LeanCamCombi.GrowthInGroups.ConstructibleSorries |
3 | 4 |
|
4 | 5 | variable {R M A} [CommRing R] [AddCommGroup M] [Module R M] [CommRing A] [Algebra R A] |
5 | 6 |
|
@@ -127,6 +128,16 @@ lemma image_comap_C_basicOpen (f : R[X]) : |
127 | 128 | rw [mem_image_comap_basicOpen_iff_map_ne_zero, ← not_iff_not] |
128 | 129 | simp [Polynomial.ext_iff, Set.range_subset_iff] |
129 | 130 |
|
| 131 | +lemma isOpenMap_comap_C : IsOpenMap (comap (R := R) C) := by |
| 132 | + intro U hU |
| 133 | + obtain ⟨S, hS, rfl⟩ := isTopologicalBasis_basic_opens.open_eq_sUnion hU |
| 134 | + rw [Set.image_sUnion] |
| 135 | + apply isOpen_sUnion |
| 136 | + rintro _ ⟨t, ht, rfl⟩ |
| 137 | + obtain ⟨r, rfl⟩ := hS ht |
| 138 | + simp only [image_comap_C_basicOpen] |
| 139 | + exact (isClosed_zeroLocus _).isOpen_compl |
| 140 | + |
130 | 141 |
|
131 | 142 | open Module in |
132 | 143 | lemma LinearMap.nilpotent_iff_charpoly {R M} [CommRing R] [IsDomain R] [AddCommGroup M] |
@@ -202,6 +213,19 @@ lemma exists_image_comap_of_monic (f g : R[X]) (hg : g.Monic) : |
202 | 213 | · exact .of_basis (AdjoinRoot.powerBasis' hg).basis |
203 | 214 | · exact .of_basis (AdjoinRoot.powerBasis' hg).basis |
204 | 215 |
|
| 216 | +lemma isCompact_image_comap_of_monic (f g : R[X]) (hg : g.Monic) : |
| 217 | + IsCompact (comap C '' (zeroLocus {g} \ zeroLocus {f})) := by |
| 218 | + obtain ⟨t, ht⟩ := exists_image_comap_of_monic f g hg |
| 219 | + rw [ht, ← t.toSet.iUnion_of_singleton_coe, zeroLocus_iUnion, Set.compl_iInter] |
| 220 | + apply isCompact_iUnion |
| 221 | + exact fun _ ↦ by simpa using isCompact_basicOpen _ |
| 222 | + |
| 223 | +lemma isOpen_image_comap_of_monic (f g : R[X]) (hg : g.Monic) : |
| 224 | + IsOpen (comap C '' (zeroLocus {g} \ zeroLocus {f})) := by |
| 225 | + obtain ⟨t, ht⟩ := exists_image_comap_of_monic f g hg |
| 226 | + rw [ht] |
| 227 | + exact (isClosed_zeroLocus (R := R) t).isOpen_compl |
| 228 | + |
205 | 229 | universe u |
206 | 230 |
|
207 | 231 | lemma Prod.Lex.lt_iff' {α β} [PartialOrder α] [Preorder β] (x y : α) (w z : β) : |
@@ -258,11 +282,11 @@ lemma Ideal.span_range_update_divByMonic {ι : Type*} [DecidableEq ι] |
258 | 282 |
|
259 | 283 | lemma foo_induction |
260 | 284 | (P : ∀ (R : Type u) [CommRing R], Ideal R[X] → Prop) |
| 285 | + (hP₀ : ∀ (R) [CommRing R] (g : R[X]), g.Monic → P R (Ideal.span {g})) |
| 286 | + (hP₁ : ∀ (R) [CommRing R], P R ⊥) |
261 | 287 | (hP : ∀ (R) [CommRing R] (c : R) (I : Ideal R[X]), |
262 | 288 | P (Localization.Away c) (I.map (mapRingHom (algebraMap _ _))) → |
263 | 289 | P (R ⧸ Ideal.span {c}) (I.map (mapRingHom (algebraMap _ _))) → P R I) |
264 | | - (hP₀ : ∀ (R) [CommRing R] (g : R[X]), g.Monic → P R (Ideal.span {g})) |
265 | | - (hP₁ : ∀ (R) [CommRing R], P R ⊥) |
266 | 290 | {R} [CommRing R] (I : Ideal R[X]) (hI : I.FG) : P R I := by |
267 | 291 | classical |
268 | 292 | obtain ⟨n, e, rfl⟩ : ∃ (n : ℕ) (e : Fin (n + 1) → R[X]), I = Ideal.span (Set.range e) := by |
@@ -417,3 +441,130 @@ lemma RingHom.FinitePresentation.polynomial_induction |
417 | 441 | congr 1 |
418 | 442 | ext : 1 |
419 | 443 | simp [e] |
| 444 | + |
| 445 | +lemma PrimeSpectrum.isRetroCompact_iff {U : Set (PrimeSpectrum R)} (hU : IsOpen U) : |
| 446 | + IsRetroCompact U ↔ IsCompact U := by |
| 447 | + refine isRetroCompact_iff_isCompact_of_isTopologicalBasis _ isTopologicalBasis_basic_opens ?_ hU |
| 448 | + intro i j |
| 449 | + rw [← TopologicalSpace.Opens.coe_inf, ← basicOpen_mul] |
| 450 | + exact isCompact_basicOpen _ |
| 451 | + |
| 452 | +lemma Polynomial.ker_mapRingHom' {R S} [CommRing R] [CommRing S] (f : R →+* S) : |
| 453 | + RingHom.ker (mapRingHom f) = (RingHom.ker f).map C := by |
| 454 | + rw [← Polynomial.ker_mapRingHom] |
| 455 | + rfl |
| 456 | + |
| 457 | +lemma mapRingHom_comp_C {R S} [CommRing R] [CommRing S] (f : R →+* S) : |
| 458 | + (mapRingHom f).comp C = C.comp f := by ext; simp |
| 459 | + |
| 460 | +lemma Polynomial.isLocalization {R} [CommRing R] (S : Submonoid R) (A) [CommRing A] [Algebra R A] |
| 461 | + [IsLocalization S A] : |
| 462 | + letI := (mapRingHom (algebraMap R A)).toAlgebra; IsLocalization (S.map C) A[X] := by |
| 463 | + letI := (mapRingHom (algebraMap R A)).toAlgebra |
| 464 | + constructor |
| 465 | + · rintro ⟨_, r, hr, rfl⟩ |
| 466 | + simpa [RingHom.algebraMap_toAlgebra] using (IsLocalization.map_units A ⟨r, hr⟩).map C |
| 467 | + · intro z |
| 468 | + obtain ⟨b, hb⟩ := IsLocalization.integerNormalization_spec S z |
| 469 | + refine ⟨⟨IsLocalization.integerNormalization S z, _, b, b.2, rfl⟩, ?_⟩ |
| 470 | + ext i |
| 471 | + simp only [RingHom.algebraMap_toAlgebra, coe_mapRingHom, map_C, coeff_mul_C, coeff_map, hb, |
| 472 | + mul_comm, Algebra.smul_def] |
| 473 | + · intros x y e |
| 474 | + rw [← sub_eq_zero, ← map_sub, RingHom.algebraMap_toAlgebra, ← RingHom.mem_ker, |
| 475 | + Polynomial.ker_mapRingHom', Ideal.mem_map_C_iff] at e |
| 476 | + simp only [coeff_sub, RingHom.mem_ker, map_sub, sub_eq_zero, |
| 477 | + IsLocalization.eq_iff_exists S] at e |
| 478 | + choose c hc using e |
| 479 | + refine ⟨⟨_, _, ((x.support ∪ y.support).prod c).2, rfl⟩, ?_⟩ |
| 480 | + ext i |
| 481 | + simp only [coeff_C_mul] |
| 482 | + by_cases hi : i ∈ x.support ∪ y.support |
| 483 | + · obtain ⟨k, e⟩ := Finset.dvd_prod_of_mem c hi |
| 484 | + simp only [e, mul_comm _ k, Submonoid.coe_mul _ k, mul_assoc, hc] |
| 485 | + · simp only [Finset.mem_union, mem_support_iff, ne_eq, not_or, not_not] at hi |
| 486 | + simp [hi.1, hi.2] |
| 487 | + |
| 488 | +lemma comap_C_eq_comap_quotient_union_comap_localization (s : Set (PrimeSpectrum R[X])) (c : R) : |
| 489 | + comap C '' s = |
| 490 | + comap (Ideal.Quotient.mk (.span {c})) '' (comap C '' |
| 491 | + (comap (mapRingHom (Ideal.Quotient.mk _)) ⁻¹' s)) ∪ |
| 492 | + comap (algebraMap R (Localization.Away c)) '' (comap C '' |
| 493 | + (comap (mapRingHom (algebraMap R (Localization.Away c))) ⁻¹' s)) := by |
| 494 | + simp_rw [← Set.image_comp, ← ContinuousMap.coe_comp, ← comap_comp, ← mapRingHom_comp_C, |
| 495 | + comap_comp, ContinuousMap.coe_comp, Set.image_comp, Set.image_preimage_eq_inter_range, |
| 496 | + ← Set.image_union, ← Set.inter_union_distrib_left] |
| 497 | + letI := (mapRingHom (algebraMap R (Localization.Away c))).toAlgebra |
| 498 | + suffices Set.range (comap (mapRingHom (Ideal.Quotient.mk (.span {c})))) = |
| 499 | + (Set.range (comap (algebraMap R[X] (Localization.Away c)[X])))ᶜ by |
| 500 | + rw [this, RingHom.algebraMap_toAlgebra, Set.compl_union_self, Set.inter_univ] |
| 501 | + have := Polynomial.isLocalization (.powers c) (Localization.Away c) |
| 502 | + rw [Submonoid.map_powers] at this |
| 503 | + have surj : Function.Surjective (mapRingHom (Ideal.Quotient.mk (.span {c}))) := |
| 504 | + Polynomial.map_surjective _ Ideal.Quotient.mk_surjective |
| 505 | + rw [range_comap_of_surjective _ _ surj, localization_away_comap_range _ (C c)] |
| 506 | + simp [Polynomial.ker_mapRingHom', Ideal.map_span] |
| 507 | + |
| 508 | +lemma isConstructible_comap_C_zeroLocus_sdiff_zeroLocus {R} [CommRing R] |
| 509 | + (I : Ideal R[X]) (hI : I.FG) (f : R[X]) : |
| 510 | + IsConstructible (comap C '' (zeroLocus I \ zeroLocus {f})) := by |
| 511 | + revert f |
| 512 | + apply foo_induction (hI := hI) |
| 513 | + · intros R _ g hg f |
| 514 | + simp only [zeroLocus_span] |
| 515 | + exact ((isRetroCompact_iff (isOpen_image_comap_of_monic f g hg)).mpr |
| 516 | + (isCompact_image_comap_of_monic f g hg)).isConstructible (isOpen_image_comap_of_monic f g hg) |
| 517 | + · intro R _ f |
| 518 | + simp only [Submodule.bot_coe, zeroLocus_singleton_zero, ← Set.compl_eq_univ_diff, |
| 519 | + ← basicOpen_eq_zeroLocus_compl] |
| 520 | + exact ((isRetroCompact_iff (isOpenMap_comap_C _ (basicOpen f).2)).mpr |
| 521 | + ((isCompact_basicOpen f).image (comap C).2)).isConstructible |
| 522 | + (isOpenMap_comap_C _ (basicOpen f).2) |
| 523 | + · intro R _ c I H₁ H₂ f |
| 524 | + replace H₁ := (H₁ (mapRingHom (algebraMap _ _) f)).image_of_isOpenEmbedding |
| 525 | + _ (localization_away_isOpenEmbedding (Localization.Away c) c) |
| 526 | + (by rw [localization_away_comap_range _ c] |
| 527 | + exact (isRetroCompact_iff (basicOpen c).2).mpr (isCompact_basicOpen c)) |
| 528 | + replace H₂ := (H₂ (mapRingHom (Ideal.Quotient.mk _) f)).image_of_isClosedEmbedding |
| 529 | + _ (isClosedEmbedding_comap_of_surjective _ _ Ideal.Quotient.mk_surjective) |
| 530 | + (by rw [range_comap_of_surjective _ _ Ideal.Quotient.mk_surjective] |
| 531 | + simp only [Ideal.mk_ker, zeroLocus_span, ← basicOpen_eq_zeroLocus_compl] |
| 532 | + exact (isRetroCompact_iff (basicOpen c).2).mpr (isCompact_basicOpen c)) |
| 533 | + rw [comap_C_eq_comap_quotient_union_comap_localization _ c] |
| 534 | + simp_rw [Set.preimage_diff, preimage_comap_zeroLocus, Set.image_singleton] |
| 535 | + convert H₂.union H₁ using 5 <;> |
| 536 | + simp only [Ideal.map, zeroLocus_span, coe_mapRingHom, Ideal.Quotient.algebraMap_eq] |
| 537 | + |
| 538 | +lemma isConstructible_image_comap_C {R} [CommRing R] (s : Set (PrimeSpectrum R[X])) |
| 539 | + (hs : IsConstructible s) : |
| 540 | + IsConstructible (comap C '' s) := by |
| 541 | + apply hs.induction_of_isTopologicalBasis _ isTopologicalBasis_basic_opens |
| 542 | + · intros i s hs |
| 543 | + simp only [basicOpen_eq_zeroLocus_compl, ← Set.compl_iInter₂, |
| 544 | + compl_sdiff_compl, ← zeroLocus_iUnion₂, Set.biUnion_of_singleton] |
| 545 | + rw [← zeroLocus_span] |
| 546 | + apply isConstructible_comap_C_zeroLocus_sdiff_zeroLocus |
| 547 | + exact ⟨hs.toFinset, by simp⟩ |
| 548 | + · intros s t hs ht |
| 549 | + rw [Set.image_union] |
| 550 | + exact hs.union ht |
| 551 | + |
| 552 | +lemma isConstructible_image_comap {R S} [CommRing R] [CommRing S] (f : R →+* S) |
| 553 | + (hf : RingHom.FinitePresentation f) |
| 554 | + (s : Set (PrimeSpectrum S)) (hs : IsConstructible s) : |
| 555 | + IsConstructible (comap f '' s) := by |
| 556 | + apply hf.polynomial_induction |
| 557 | + (P := fun _ _ _ _ f ↦ ∀ s, IsConstructible s → IsConstructible (comap f '' s)) |
| 558 | + (Q := fun _ _ _ _ f ↦ ∀ s, IsConstructible s → IsConstructible (comap f '' s)) |
| 559 | + · exact fun _ ↦ isConstructible_image_comap_C |
| 560 | + · intro R _ S _ f hf hf' s hs |
| 561 | + refine hs.image_of_isClosedEmbedding _ (isClosedEmbedding_comap_of_surjective _ _ hf) ?_ |
| 562 | + rw [range_comap_of_surjective _ _ hf, isRetroCompact_iff (isClosed_zeroLocus _).isOpen_compl] |
| 563 | + obtain ⟨t, ht⟩ := hf' |
| 564 | + rw [← ht, ← t.toSet.iUnion_of_singleton_coe, zeroLocus_span, zeroLocus_iUnion, Set.compl_iInter] |
| 565 | + apply isCompact_iUnion |
| 566 | + exact fun _ ↦ by simpa using isCompact_basicOpen _ |
| 567 | + · intro R _ S _ T _ f g hf hg s hs |
| 568 | + simp only [comap_comp, ContinuousMap.coe_comp, Set.image_comp] |
| 569 | + exact hf _ (hg _ hs) |
| 570 | + · exact hs |
0 commit comments