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.ArithmeticGeometry.OrdinaryLocus.Openness.AffineFiberFlatness |
| 2 | import Mathlib.CategoryTheory.MorphismProperty.Limits |
| 3 | |
| 4 | /-! # Relative Base Change -/ |
| 5 | |
| 6 | namespace OAI.ArithmeticGeometry.OrdinaryLocus.Openness.RelativeBaseChange.Construction |
| 7 | |
| 8 | noncomputable section |
| 9 | |
| 10 | section |
| 11 | |
| 12 | /-! Flatness and localization at scheme stalks for Openness. -/ |
| 13 | |
| 14 | open _root_.CategoryTheory _root_.CategoryTheory.Limits _root_.AlgebraicGeometry |
| 15 | |
| 16 | /-- The canonical morphism from the spectrum of a scheme stalk is flat. -/ |
| 17 | theorem flat_fromSpecStalk (X : Scheme) (x : X) : Flat (X.fromSpecStalk x) := by |
| 18 | let U := (X.affineCover.f (X.affineCover.idx x)).opensRange |
| 19 | have hU : IsAffineOpen U := isAffineOpen_opensRange _ |
| 20 | have hx : x ∈ U := X.affineCover.covers x |
| 21 | rw [← hU.fromSpecStalk_eq_fromSpecStalk hx, IsAffineOpen.fromSpecStalk] |
| 22 | have : Flat (Spec.map (X.presheaf.germ U x hx)) := by |
| 23 | let : Algebra Γ(X, U) (X.presheaf.stalk x) := (X.presheaf.germ U x hx).hom.toAlgebra |
| 24 | have := hU.isLocalization_stalk ⟨x, hx⟩ |
| 25 | apply Flat.SpecMap_iff.mpr |
| 26 | exact IsLocalization.flat (X.presheaf.stalk x) (hU.primeIdealOf ⟨x, hx⟩).asIdeal.primeCompl |
| 27 | infer_instance |
| 28 | |
| 29 | /-- Flatness of a composite can be cancelled across a monomorphism of |
| 30 | schemes, since the first map is a base change of the composite. -/ |
| 31 | theorem flat_of_comp_mono |
| 32 | {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) [Mono g] [Flat (f ≫ g)] : Flat f := by |
| 33 | have heq : f = inv (pullback.fst (f ≫ g) g) ≫ pullback.snd (f ≫ g) g := by |
| 34 | simp [← cancel_mono g, pullback.condition] |
| 35 | rw [heq] |
| 36 | infer_instance |
| 37 | |
| 38 | /-- A family that is flat over a scheme stays flat when its structural |
| 39 | map factors through the spectrum of a stalk of that scheme. -/ |
| 40 | theorem flat_of_comp_fromSpecStalk |
| 41 | {X S : Scheme} (s : S) (f : X ⟶ Spec (S.presheaf.stalk s)) |
| 42 | [Flat (f ≫ S.fromSpecStalk s)] : Flat f := |
| 43 | flat_of_comp_mono f (S.fromSpecStalk s) |
| 44 | |
| 45 | /-- Flatness can be tested after pulling back to the spectrum of every |
| 46 | target stalk. This form keeps finite morphisms finite under the test. -/ |
| 47 | theorem flat_iff_flat_targetStalk_baseChange |
| 48 | {X Y : Scheme} (f : X ⟶ Y) : |
| 49 | Flat f ↔ ∀ y : Y, Flat (pullback.snd f (Y.fromSpecStalk y)) := by |
| 50 | constructor |
| 51 | · intro hf y |
| 52 | have := hf |
| 53 | infer_instance |
| 54 | · intro hf |
| 55 | apply Flat.of_stalkMap |
| 56 | intro x |
| 57 | let i := Y.fromSpecStalk (f x) |
| 58 | let l := pullback.lift (X.fromSpecStalk x) (Spec.map (f.stalkMap x)) |
| 59 | (Scheme.SpecMap_stalkMap_fromSpecStalk f).symm |
| 60 | have : Flat (pullback.snd f i) := hf (f x) |
| 61 | have : Flat (l ≫ pullback.fst f i) := by |
| 62 | dsimp [l, i] |
| 63 | rw [pullback.lift_fst] |
| 64 | exact flat_fromSpecStalk X x |
| 65 | have : Flat l := flat_of_comp_mono l (pullback.fst f i) |
| 66 | have hcomp : Flat (l ≫ pullback.snd f i) := inferInstance |
| 67 | have hmap : Flat (Spec.map (f.stalkMap x)) := by |
| 68 | simpa only [l, i, pullback.lift_snd] using hcomp |
| 69 | exact Flat.SpecMap_iff.mp hmap |
| 70 | |
| 71 | end |
| 72 | |
| 73 | /-! Relative base-change squares for the Openness fiberwise flatness argument. -/ |
| 74 | |
| 75 | open _root_.CategoryTheory _root_.CategoryTheory.Limits _root_.AlgebraicGeometry |
| 76 | |
| 77 | /-- Flatness of a structural morphism is invariant under an isomorphism over the base. -/ |
| 78 | theorem flat_of_overIso {S : Scheme} {X Y : Over S} (e : X ≅ Y) [Flat Y.hom] : |
| 79 | Flat X.hom := by |
| 80 | have : IsIso e.hom.left := (Over.forget S).map_isIso e.hom |
| 81 | rw [← e.hom.w] |
| 82 | infer_instance |
| 83 | |
| 84 | /-- Either orientation of the same pullback gives the same flatness test. -/ |
| 85 | theorem flat_pullback_fst_iff_snd |
| 86 | {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) : |
| 87 | Flat (pullback.fst f g) ↔ Flat (pullback.snd g f) := by |
| 88 | constructor |
| 89 | · intro h |
| 90 | have := h |
| 91 | rw [← pullbackSymmetry_inv_comp_fst f g] |
| 92 | infer_instance |
| 93 | · intro h |
| 94 | have := h |
| 95 | rw [← pullbackSymmetry_hom_comp_snd f g] |
| 96 | infer_instance |
| 97 | |
| 98 | /-- Successive target base changes preserve a flatness result obtained |
| 99 | for their composite. -/ |
| 100 | theorem flat_iterated_targetBaseChange |
| 101 | {X Y Z W : Scheme} (f : X ⟶ Y) (i : Z ⟶ Y) (j : W ⟶ Z) |
| 102 | [Flat (pullback.snd f (j ≫ i))] : Flat (pullback.snd (pullback.snd f i) j) := by |
| 103 | have : Flat ((Over.pullback (j ≫ i)).obj (Over.mk f)).hom := |
| 104 | inferInstanceAs (Flat (pullback.snd f (j ≫ i))) |
| 105 | exact flat_of_overIso ((Over.pullbackComp j i).app (Over.mk f)).symm |
| 106 | |
| 107 | /-- The map between two base-changed S-schemes is the base change of the |
| 108 | original map along the projection from the new target. -/ |
| 109 | theorem isPullback_overPullback_map |
| 110 | {S Z : Scheme} {X Y : Over S} (f : X ⟶ Y) (t : Z ⟶ S) : |
| 111 | IsPullback (pullback.fst X.hom t) ((Over.pullback t).map f).left |
| 112 | f.left (pullback.fst Y.hom t) := by |
| 113 | refine IsPullback.of_bot ?_ ?_ (IsPullback.of_hasPullback Y.hom t) |
| 114 | · simpa only [Over.pullback_map_left, pullback.lift_snd, Over.w] using |
| 115 | IsPullback.of_hasPullback X.hom t |
| 116 | · simp only [Over.pullback_map_left, pullback.lift_fst] |
| 117 | |
| 118 | /-- If the relative morphism is flat after changing the base to `Z`, |
| 119 | it is flat after any target base change whose map to S factors through Z. -/ |
| 120 | theorem flat_targetBaseChange_of_factorization |
| 121 | {S Z W : Scheme} {X Y : Over S} (f : X ⟶ Y) (t : Z ⟶ S) |
| 122 | (u : W ⟶ Y.left) (v : W ⟶ Z) (h : u ≫ Y.hom = v ≫ t) |
| 123 | [Flat ((Over.pullback t).map f).left] : Flat (pullback.snd f.left u) := by |
| 124 | let l := pullback.lift u v h |
| 125 | have hp := isPullback_overPullback_map f t |
| 126 | have hq : IsPullback (pullback.fst f.left u) (pullback.snd f.left u) |
| 127 | f.left (l ≫ pullback.fst Y.hom t) := by |
| 128 | simpa only [l, pullback.lift_fst] using IsPullback.of_hasPullback f.left u |
| 129 | exact MorphismProperty.of_isPullback (IsPullback.of_right' hq hp) inferInstance |
| 130 | |
| 131 | end |
| 132 | |
| 133 | end OAI.ArithmeticGeometry.OrdinaryLocus.Openness.RelativeBaseChange.Construction |