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 Mathlib.Algebra.Homology.Single |
| 2 | import Mathlib.Algebra.Homology.Linear |
| 3 | |
| 4 | /-! # Three Complex -/ |
| 5 | |
| 6 | namespace OAI.NumberTheory.PadicHodge.GeometricComparison.FirstThree.ThreeComplex.FirstThreeComplex |
| 7 | |
| 8 | noncomputable section |
| 9 | |
| 10 | /-! The native quotient complex retaining degrees zero, one and two. -/ |
| 11 | |
| 12 | open _root_.CategoryTheory _root_.CategoryTheory.Limits ZeroObject |
| 13 | |
| 14 | universe u v |
| 15 | |
| 16 | variable {C : Type u} [Category.{v} C] [Preadditive C] [HasZeroObject C] |
| 17 | |
| 18 | def term (K : CochainComplex C ℕ) : ℕ → C |
| 19 | | 0 => K.X 0 |
| 20 | | 1 => K.X 1 |
| 21 | | 2 => K.X 2 |
| 22 | | _ + 3 => 0 |
| 23 | |
| 24 | def differential (K : CochainComplex C ℕ) : ∀ n, term K n ⟶ term K (n + 1) |
| 25 | | 0 => K.d 0 1 |
| 26 | | 1 => K.d 1 2 |
| 27 | | _ + 2 => 0 |
| 28 | |
| 29 | def complex (K : CochainComplex C ℕ) : CochainComplex C ℕ := |
| 30 | CochainComplex.of (term K) (differential K) (by |
| 31 | intro n |
| 32 | rcases n with _ | (_ | n) |
| 33 | · exact K.d_comp_d 0 1 2 |
| 34 | · exact comp_zero |
| 35 | · exact zero_comp) |
| 36 | |
| 37 | def projectionTerm (K : CochainComplex C ℕ) : ∀ n, K.X n ⟶ term K n |
| 38 | | 0 => 𝟙 _ |
| 39 | | 1 => 𝟙 _ |
| 40 | | 2 => 𝟙 _ |
| 41 | | _ + 3 => 0 |
| 42 | |
| 43 | def projection (K : CochainComplex C ℕ) : K ⟶ complex K where |
| 44 | f n := projectionTerm K n |
| 45 | comm' n m hnm := by |
| 46 | change n + 1 = m at hnm |
| 47 | subst m |
| 48 | rw [show (complex K).d n (n + 1) = differential K n from CochainComplex.of_d _ _ n] |
| 49 | rcases n with _ | (_ | n) |
| 50 | · exact (Category.id_comp _).trans (Category.comp_id _).symm |
| 51 | · exact (Category.id_comp _).trans (Category.comp_id _).symm |
| 52 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 53 | |
| 54 | def mapTerm {K L : CochainComplex C ℕ} (f : K ⟶ L) : ∀ n, term K n ⟶ term L n |
| 55 | | 0 => f.f 0 |
| 56 | | 1 => f.f 1 |
| 57 | | 2 => f.f 2 |
| 58 | | _ + 3 => 0 |
| 59 | |
| 60 | def map {K L : CochainComplex C ℕ} (f : K ⟶ L) : complex K ⟶ complex L where |
| 61 | f n := mapTerm f n |
| 62 | comm' n m hnm := by |
| 63 | change n + 1 = m at hnm |
| 64 | subst m |
| 65 | rw [show (complex K).d n (n + 1) = differential K n from CochainComplex.of_d _ _ n, |
| 66 | show (complex L).d n (n + 1) = differential L n from CochainComplex.of_d _ _ n] |
| 67 | rcases n with _ | (_ | n) |
| 68 | · exact f.comm 0 1 |
| 69 | · exact f.comm 1 2 |
| 70 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 71 | |
| 72 | theorem projection_naturality {K L : CochainComplex C ℕ} (f : K ⟶ L) : |
| 73 | projection K ≫ FirstThreeComplex.map f = f ≫ projection L := by |
| 74 | apply HomologicalComplex.Hom.ext |
| 75 | funext n |
| 76 | rcases n with _ | (_ | (_ | n)) |
| 77 | · exact (Category.id_comp _).trans (Category.comp_id _).symm |
| 78 | · exact (Category.id_comp _).trans (Category.comp_id _).symm |
| 79 | · exact (Category.id_comp _).trans (Category.comp_id _).symm |
| 80 | · exact zero_comp.trans comp_zero.symm |
| 81 | |
| 82 | def functor (C : Type u) [Category.{v} C] [Preadditive C] [HasZeroObject C] : |
| 83 | CochainComplex C ℕ ⥤ CochainComplex C ℕ where |
| 84 | obj := complex |
| 85 | map := FirstThreeComplex.map |
| 86 | map_id K := by |
| 87 | apply HomologicalComplex.Hom.ext |
| 88 | funext n |
| 89 | rcases n with _ | (_ | (_ | n)) |
| 90 | · rfl |
| 91 | · rfl |
| 92 | · rfl |
| 93 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 94 | map_comp f g := by |
| 95 | apply HomologicalComplex.Hom.ext |
| 96 | funext n |
| 97 | rcases n with _ | (_ | (_ | n)) |
| 98 | · rfl |
| 99 | · rfl |
| 100 | · rfl |
| 101 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 102 | |
| 103 | instance additive : (functor C).Additive where |
| 104 | map_add {K L} f g := by |
| 105 | apply HomologicalComplex.Hom.ext |
| 106 | funext n |
| 107 | rcases n with _ | (_ | (_ | n)) |
| 108 | · rfl |
| 109 | · rfl |
| 110 | · rfl |
| 111 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 112 | |
| 113 | instance linear (R : Type*) [CommRing R] [Linear R C] : (functor C).Linear R where |
| 114 | map_smul {K L} f r := by |
| 115 | apply HomologicalComplex.Hom.ext |
| 116 | funext n |
| 117 | rcases n with _ | (_ | (_ | n)) |
| 118 | · rfl |
| 119 | · rfl |
| 120 | · rfl |
| 121 | · exact (isZero_zero C).eq_of_tgt _ _ |
| 122 | |
| 123 | end |
| 124 | |
| 125 | end OAI.NumberTheory.PadicHodge.GeometricComparison.FirstThree.ThreeComplex.FirstThreeComplex |