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 | /- |
| 2 | Copyright 2026 The Formal Conjectures Authors. |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | This file has been modified. |
| 17 | -/ |
| 18 | |
| 19 | import Mathlib.Algebra.Homology.Embedding.StupidTrunc |
| 20 | |
| 21 | namespace OAI.Algebra.Homology.StupidTruncation |
| 22 | |
| 23 | open _root_.HomologicalComplex |
| 24 | |
| 25 | /-! |
| 26 | # Inclusion of a stupid truncation |
| 27 | |
| 28 | For an embedding of complex shapes whose image is closed under the next differential, the stupid |
| 29 | truncation is canonically a subcomplex. This file constructs its inclusion into the original |
| 30 | complex and proves naturality. It supplies the inclusion noted as missing in Mathlib's |
| 31 | `Embedding.StupidTrunc`. |
| 32 | -/ |
| 33 | |
| 34 | noncomputable section |
| 35 | |
| 36 | open _root_.CategoryTheory _root_.CategoryTheory.Limits |
| 37 | |
| 38 | universe u v |
| 39 | |
| 40 | variable {I J : Type*} {c : ComplexShape I} {c' : ComplexShape J} |
| 41 | |
| 42 | namespace HomologicalComplex |
| 43 | open _root_.HomologicalComplex |
| 44 | |
| 45 | variable {C : Type u} [Category.{v} C] [HasZeroMorphisms C] [HasZeroObject C] |
| 46 | variable (K : HomologicalComplex C c') (e : c.Embedding c') [e.IsTruncGE] |
| 47 | |
| 48 | open scoped Classical in |
| 49 | /-- The component of the inclusion from a stupid truncation. It is the canonical isomorphism in |
| 50 | the image of the embedding and the zero morphism outside that image. -/ |
| 51 | def stupidTruncInclusionApp (j : J) : (K.stupidTrunc e).X j ⟶ K.X j := |
| 52 | if h : ∃ i, e.f i = j then |
| 53 | (K.stupidTruncXIso e h.choose_spec).hom |
| 54 | else 0 |
| 55 | |
| 56 | lemma stupidTruncInclusionApp_eq {i : I} {j : J} (h : e.f i = j) : |
| 57 | stupidTruncInclusionApp K e j = (K.stupidTruncXIso e h).hom := by |
| 58 | have hj : ∃ k, e.f k = j := ⟨i, h⟩ |
| 59 | have hchoice : hj.choose = i := e.injective_f (hj.choose_spec.trans h.symm) |
| 60 | grind [stupidTruncInclusionApp] |
| 61 | |
| 62 | set_option backward.isDefEq.respectTransparency false in |
| 63 | lemma stupidTrunc_d_comp_XIso {i j : I} : |
| 64 | (K.stupidTrunc e).d (e.f i) (e.f j) ≫ |
| 65 | (K.stupidTruncXIso e (i := j) rfl).hom = |
| 66 | (K.stupidTruncXIso e (i := i) rfl).hom ≫ K.d (e.f i) (e.f j) := by |
| 67 | simp [stupidTruncXIso, stupidTrunc, extend_d_eq (K.restriction e) e rfl rfl] |
| 68 | |
| 69 | /-- The canonical inclusion of a stupid truncation whose retained degrees are closed under the |
| 70 | next differential. -/ |
| 71 | def stupidTruncInclusion : K.stupidTrunc e ⟶ K where |
| 72 | f j := stupidTruncInclusionApp K e j |
| 73 | comm' i' j' hij := by |
| 74 | by_cases hi : ∃ i, e.f i = i' |
| 75 | · obtain ⟨i, hi⟩ := hi |
| 76 | obtain ⟨j, hj⟩ := e.mem_next (hi ▸ hij) |
| 77 | rw [stupidTruncInclusionApp_eq K e hi, stupidTruncInclusionApp_eq K e hj] |
| 78 | subst i' j' |
| 79 | exact (stupidTrunc_d_comp_XIso K e).symm |
| 80 | · exact (K.isZero_stupidTrunc_X e i' (by simpa using hi)).eq_of_src _ _ |
| 81 | |
| 82 | @[simp] lemma stupidTruncInclusion_f {i : I} {j : J} (h : e.f i = j) : |
| 83 | (stupidTruncInclusion K e).f j = (K.stupidTruncXIso e h).hom := |
| 84 | stupidTruncInclusionApp_eq K e h |
| 85 | |
| 86 | /-- The inclusion of the stupid truncation is an isomorphism when the original complex is already |
| 87 | strictly supported on the retained degrees. -/ |
| 88 | noncomputable instance stupidTruncInclusion_isIso [K.IsStrictlySupported e] : |
| 89 | IsIso (stupidTruncInclusion K e) := by |
| 90 | let componentIsIso (j : J) : IsIso ((stupidTruncInclusion K e).f j) := by |
| 91 | by_cases hj : ∃ i, e.f i = j |
| 92 | · obtain ⟨i, hi⟩ := hj |
| 93 | rw [stupidTruncInclusion_f K e hi] |
| 94 | infer_instance |
| 95 | · exact IsZero.isIso (K.isZero_stupidTrunc_X e j (by simpa using hj)) |
| 96 | (K.isZero_X_of_isStrictlySupported e j (by simpa using hj)) _ |
| 97 | exact @Hom.isIso_of_components J C _ _ c' _ _ |
| 98 | (stupidTruncInclusion K e) componentIsIso |
| 99 | |
| 100 | variable {K} {L : HomologicalComplex C c'} |
| 101 | |
| 102 | lemma stupidTruncMap_comp_stupidTruncInclusion (f : K ⟶ L) : |
| 103 | stupidTruncMap f e ≫ stupidTruncInclusion L e = |
| 104 | stupidTruncInclusion K e ≫ f := by |
| 105 | ext j |
| 106 | by_cases hj : ∃ i, e.f i = j |
| 107 | · obtain ⟨i, hi⟩ := hj |
| 108 | rw [HomologicalComplex.comp_f, HomologicalComplex.comp_f, |
| 109 | stupidTruncInclusion_f L e hi, stupidTruncInclusion_f K e hi, |
| 110 | stupidTruncMap_stupidTruncXIso_hom f e hi] |
| 111 | · exact (K.isZero_stupidTrunc_X e j (by simpa using hj)).eq_of_src _ _ |
| 112 | |
| 113 | end HomologicalComplex |
| 114 | |
| 115 | end |
| 116 | |
| 117 | end OAI.Algebra.Homology.StupidTruncation |