Hodge conjecture: the CM case in Lean, read and discussed
OpenAI's Lean proof of the Hodge conjecture for CM abelian varieties: rerun it, read its statement, and keep the open questions with their sources. The conjecture is open

| 1 | import OAI.AlgebraicGeometry.IntersectionTheory.ProjectionFormula.Smooth.EqualDimensionEtale |
| 2 | import Mathlib.RingTheory.Etale.Locus |
| 3 | import Mathlib.AlgebraicGeometry.Morphisms.Etale |
| 4 | |
| 5 | /-! # Stalk Neighborhood -/ |
| 6 | |
| 7 | namespace OAI.AlgebraicGeometry.IntersectionTheory.ProjectionFormula.Etale.StalkNeighborhood |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | /-! Formal etaleness of a stalk of a finitely presented morphism |
| 12 | extends to an actual affine etale neighborhood. -/ |
| 13 | |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | set_option backward.isDefEq.respectTransparency.types false |
| 16 | |
| 17 | open _root_.CategoryTheory _root_.AlgebraicGeometry |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | theorem ringHom_iff {R S : Type u} [CommRing R] [CommRing S] (f : R →+* S) : |
| 22 | f.FormallyEtale ↔ f.FormallyUnramified ∧ f.FormallySmooth := by |
| 23 | let := f.toAlgebra |
| 24 | exact Algebra.FormallyEtale.iff_formallyUnramified_and_formallySmooth |
| 25 | |
| 26 | theorem stalk_iff {X Y : Scheme.{u}} (f : X ⟶ Y) (x : X) |
| 27 | (U : Y.Opens) (hU : IsAffineOpen U) (V : X.Opens) (hV : IsAffineOpen V) |
| 28 | (hVU : V ≤ f ⁻¹ᵁ U) (hx : x ∈ V) : |
| 29 | letI := (f.appLE U V hVU).hom.toAlgebra |
| 30 | (f.stalkMap x).hom.FormallyEtale ↔ |
| 31 | Algebra.IsEtaleAt Γ(Y, U) (hV.primeIdealOf ⟨x, hx⟩).asIdeal := by |
| 32 | let := (f.appLE U V hVU).hom.toAlgebra |
| 33 | let p := (hU.primeIdealOf ⟨f x, hVU hx⟩).asIdeal |
| 34 | let q := (hV.primeIdealOf ⟨x, hx⟩).asIdeal |
| 35 | have : q.LiesOver p := |
| 36 | ⟨congr($(IsAffineOpen.comap_primeIdealOf_appLE U hU V hV hVU hx).1).symm⟩ |
| 37 | let := Localization.AtPrime.algebraOfLiesOver p q |
| 38 | trans Algebra.FormallyEtale (Localization.AtPrime p) (Localization.AtPrime q) |
| 39 | · rw [← RingHom.formallyEtale_algebraMap, ringHom_iff, ringHom_iff] |
| 40 | exact and_congr |
| 41 | (RingHom.FormallyUnramified.respectsIso.arrow_mk_iso_iff |
| 42 | (IsAffineOpen.arrowStalkMapIso f U hU V hV hVU hx)) |
| 43 | (RingHom.FormallySmooth.respectsIso.arrow_mk_iso_iff |
| 44 | (IsAffineOpen.arrowStalkMapIso f U hU V hV hVU hx)) |
| 45 | · exact Algebra.FormallyEtale.iff_restrictScalars.symm |
| 46 | |
| 47 | theorem exists_affine {X Y : Scheme.{u}} (f : X ⟶ Y) [LocallyOfFinitePresentation f] |
| 48 | (x : X) (H : (f.stalkMap x).hom.FormallyEtale) : |
| 49 | ∃ (U : Y.Opens) (_ : IsAffineOpen U) (V : X.Opens) (_ : IsAffineOpen V) (hVU : V ≤ f ⁻¹ᵁ U), |
| 50 | x ∈ V ∧ (f.appLE U V hVU).hom.Etale := by |
| 51 | obtain ⟨_, ⟨U, hU, rfl⟩, hxU, -⟩ := |
| 52 | Y.isBasis_affineOpens.exists_subset_of_mem_open (Set.mem_univ (f x)) isOpen_univ |
| 53 | obtain ⟨_, ⟨V, hV, rfl⟩, hxV, hVU⟩ := |
| 54 | X.isBasis_affineOpens.exists_subset_of_mem_open hxU (U.2.preimage f.continuous) |
| 55 | have := f.finitePresentation_appLE hU hV hVU |
| 56 | algebraize [(f.appLE U V hVU).hom] |
| 57 | have : Algebra.IsEtaleAt Γ(Y, U) (hV.primeIdealOf ⟨x, hxV⟩).asIdeal := |
| 58 | (stalk_iff f x U hU V hV hVU hxV).mp H |
| 59 | obtain ⟨r, hrx, hr⟩ := Algebra.exists_etale_of_isEtaleAt (R := Γ(Y, U)) (hV.primeIdealOf ⟨x, hxV⟩).asIdeal |
| 60 | refine ⟨_, hU, _, hV.basicOpen r, (X.basicOpen_le r).trans hVU, ?_, ?_⟩ |
| 61 | · rwa [← PrimeSpectrum.mem_basicOpen, IsAffineOpen.primeIdealOf, |
| 62 | ← hV.fromSpec_preimage_basicOpen, Scheme.Hom.mem_preimage, ← Scheme.Hom.comp_apply, |
| 63 | IsAffineOpen.isoSpec_hom, IsAffineOpen.toSpecΓ_fromSpec] at hrx |
| 64 | · have := hV.isLocalization_basicOpen r |
| 65 | rw [← RingHom.etale_algebraMap] at hr |
| 66 | convert! RingHom.Etale.propertyIsLocal.respectsIso.1 _ |
| 67 | (IsLocalization.algEquiv (.powers r) _ Γ(X, X.basicOpen r)).toRingEquiv hr |
| 68 | ext c |
| 69 | dsimp |
| 70 | rw [IsScalarTower.algebraMap_apply Γ(Y, U) Γ(X, V) (Localization _), |
| 71 | (IsLocalization.algEquiv (.powers r) (Localization.Away r) Γ(X, X.basicOpen r)).commutes] |
| 72 | change (f.appLE U (X.basicOpen r) _) c = |
| 73 | (f.appLE U V hVU ≫ X.presheaf.map (homOfLE (X.basicOpen_le r)).op) c |
| 74 | rw [Scheme.Hom.appLE_map] |
| 75 | |
| 76 | theorem exists_open {X Y : Scheme.{u}} (f : X ⟶ Y) [LocallyOfFinitePresentation f] |
| 77 | (x : X) (H : (f.stalkMap x).hom.FormallyEtale) : |
| 78 | ∃ V : X.Opens, x ∈ V ∧ Etale (V.ι ≫ f) := by |
| 79 | obtain ⟨U, hU, V, hV, hVU, hx, Hφ⟩ := exists_affine f x H |
| 80 | let : IsAffine U.toScheme := hU |
| 81 | let : IsAffine V.toScheme := hV |
| 82 | have hres : Etale (f.resLE U V hVU) := by |
| 83 | apply (HasRingHomProperty.iff_of_isAffine (P := @Etale)).mpr |
| 84 | change RingHom.Etale ((f.resLE U V hVU).app ⊤).hom |
| 85 | rw [Scheme.Hom.resLE_app_top] |
| 86 | exact ((RingHom.Etale.respectsIso.cancel_left_isIso U.topIso.hom |
| 87 | (f.appLE U V hVU ≫ V.topIso.inv)).trans |
| 88 | (RingHom.Etale.respectsIso.cancel_right_isIso (f.appLE U V hVU) V.topIso.inv)).mpr Hφ |
| 89 | let := hres |
| 90 | refine ⟨V, hx, ?_⟩ |
| 91 | rw [← Scheme.Hom.resLE_comp_ι f hVU] |
| 92 | infer_instance |
| 93 | |
| 94 | end |
| 95 | |
| 96 | end OAI.AlgebraicGeometry.IntersectionTheory.ProjectionFormula.Etale.StalkNeighborhood |