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 | Derived from Formal Conjectures: |
| 3 | HodgeConjecture/Mathlib/Geometry/Convex/StdSimplexMetric.lean |
| 4 | The upstream Formal Conjectures repository is licensed under Apache 2.0. |
| 5 | This file has been modified. |
| 6 | -/ |
| 7 | import Mathlib.Geometry.Convex.ConvexSpace.CompactSpaceStdSimplex |
| 8 | import Mathlib.Topology.MetricSpace.Basic |
| 9 | import Mathlib.Topology.MetricSpace.Isometry |
| 10 | import Mathlib.Topology.Algebra.Monoid.FunOnFinite |
| 11 | import Mathlib.Analysis.Convex.Contractible |
| 12 | import Mathlib.Topology.Algebra.Module.LocallyConvex |
| 13 | import Mathlib.Topology.Instances.Real.Lemmas |
| 14 | |
| 15 | /-! # Convex Std Simplex Metric -/ |
| 16 | |
| 17 | namespace OAI.Geometry.Foundations.ConvexStdSimplexMetric.Convexity.StdSimplex |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | open _root_.Convexity |
| 22 | open _root_.Convexity.StdSimplex |
| 23 | |
| 24 | /-! The finite real standard simplex carries the metric on its barycentric weights. -/ |
| 25 | |
| 26 | /-- The sup metric on barycentric coordinates, preserving the standard simplex topology. -/ |
| 27 | instance metricSpace (ι : Type*) [Fintype ι] : MetricSpace (StdSimplex ℝ ι) := |
| 28 | (isEmbedding_toFun_comp_weights ℝ ι).comapMetricSpace (fun x => (x.weights : ι → ℝ)) |
| 29 | |
| 30 | /-- Barycentric coordinates of a real simplex point. -/ |
| 31 | scoped instance coeFn (ι : Type*) : CoeFun (StdSimplex ℝ ι) (fun _ => ι → ℝ) := |
| 32 | ⟨fun x => x.weights⟩ |
| 33 | |
| 34 | /-- Construct a finite simplex from nonnegative coordinates summing to one. -/ |
| 35 | def ofCoordinates {ι : Type*} [Fintype ι] (x : ι → ℝ) |
| 36 | (hn : ∀ i, 0 ≤ x i) (ht : ∑ i, x i = 1) : StdSimplex ℝ ι where |
| 37 | weights := Finsupp.equivFunOnFinite.symm x |
| 38 | nonneg i := by simpa using hn i |
| 39 | total := by simpa [Finsupp.sum_fintype] using ht |
| 40 | |
| 41 | @[simp] |
| 42 | theorem ofCoordinates_weights {ι : Type*} [Fintype ι] (x : ι → ℝ) |
| 43 | (hn : ∀ i, 0 ≤ x i) (ht : ∑ i, x i = 1) (i : ι) : |
| 44 | (ofCoordinates x hn ht).weights i = x i := by simp [ofCoordinates] |
| 45 | |
| 46 | /-- Coordinates of a finite simplex after identifying vertices. -/ |
| 47 | theorem weights_map_sum {X Y : Type*} [Fintype X] [DecidableEq Y] |
| 48 | (f : X → Y) (w : StdSimplex ℝ X) (y : Y) : |
| 49 | (map f w).weights y = ∑ x with f x = y, w.weights x := by |
| 50 | classical |
| 51 | simp [map, Finsupp.mapDomain_apply, Finsupp.sum_fintype, |
| 52 | Finsupp.single_apply, Finset.sum_filter] |
| 53 | |
| 54 | /-- Finite barycentric coordinate vectors form a convex set. -/ |
| 55 | theorem convex_range_weights (ι : Type*) [Fintype ι] : |
| 56 | Convex ℝ (Set.range (fun x : StdSimplex ℝ ι => (x.weights : ι → ℝ))) := by |
| 57 | rintro _ ⟨u, rfl⟩ _ ⟨v, rfl⟩ c d hc hd hcd |
| 58 | refine ⟨ofCoordinates (c • (u.weights : ι → ℝ) + d • (v.weights : ι → ℝ)) ?_ ?_, ?_⟩ |
| 59 | · intro i |
| 60 | exact add_nonneg (mul_nonneg hc (u.weights_nonneg i)) |
| 61 | (mul_nonneg hd (v.weights_nonneg i)) |
| 62 | · simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, Finset.sum_add_distrib, |
| 63 | ← Finset.mul_sum, total_of_fintype, mul_one, hcd] |
| 64 | · funext i |
| 65 | simp |
| 66 | |
| 67 | /-- A nonempty finite standard simplex is contractible through its coordinates. -/ |
| 68 | instance contractibleSpace (ι : Type*) [Fintype ι] [Nonempty ι] : |
| 69 | ContractibleSpace (StdSimplex ℝ ι) := by |
| 70 | classical |
| 71 | let coord : StdSimplex ℝ ι → ι → ℝ := fun x => x.weights |
| 72 | let a : StdSimplex ℝ ι := single (Classical.choice ‹Nonempty ι›) |
| 73 | let : ContractibleSpace (Set.range coord) := |
| 74 | (convex_range_weights ι).contractibleSpace ⟨coord a, ⟨a, rfl⟩⟩ |
| 75 | exact (isEmbedding_toFun_comp_weights ℝ ι).toHomeomorph.contractibleSpace |
| 76 | |
| 77 | /-- The finite-coordinate linear map agrees with mapping barycentric weights. -/ |
| 78 | theorem map_coordinates {X Y : Type*} [Fintype X] [Fintype Y] |
| 79 | (f : X → Y) (w : StdSimplex ℝ X) : |
| 80 | ((map f w).weights : Y → ℝ) = FunOnFinite.linearMap ℝ ℝ f (w.weights : X → ℝ) := by |
| 81 | simp [map, FunOnFinite.linearMap] |
| 82 | rfl |
| 83 | |
| 84 | /-- Distance is the sup distance between the barycentric coordinate vectors. -/ |
| 85 | theorem dist_eq_weights {ι : Type*} [Fintype ι] (x y : StdSimplex ℝ ι) : |
| 86 | dist x y = dist (x.weights : ι → ℝ) (y.weights : ι → ℝ) := rfl |
| 87 | |
| 88 | /-- Recover a simplex from a vector known to be its barycentric coordinates. -/ |
| 89 | def ofMemRange {ι : Type*} (x : ι → ℝ) |
| 90 | (hx : x ∈ Set.range (fun y : StdSimplex ℝ ι => (y.weights : ι → ℝ))) : |
| 91 | StdSimplex ℝ ι := Classical.choose hx |
| 92 | |
| 93 | @[simp] |
| 94 | theorem ofMemRange_weights {ι : Type*} (x : ι → ℝ) |
| 95 | (hx : x ∈ Set.range (fun y : StdSimplex ℝ ι => (y.weights : ι → ℝ))) : |
| 96 | ((ofMemRange x hx).weights : ι → ℝ) = x := Classical.choose_spec hx |
| 97 | |
| 98 | /-- Finite real simplices inherit local path connectedness from their coordinate range. -/ |
| 99 | instance locallyPathConnectedSpace (ι : Type*) [Fintype ι] : |
| 100 | LocallyPathConnectedSpace (StdSimplex ℝ ι) := by |
| 101 | let : LocallyPathConnectedSpace |
| 102 | (Set.range (fun x : StdSimplex ℝ ι => (x.weights : ι → ℝ))) := |
| 103 | (convex_range_weights ι).locallyPathConnectedSpace |
| 104 | exact (isEmbedding_toFun_comp_weights ℝ ι).toHomeomorph.symm.locallyPathConnectedSpace |
| 105 | |
| 106 | /-- Barycentric coordinates realize the chosen metric isometrically. -/ |
| 107 | theorem isometry_weights (ι : Type*) [Fintype ι] : |
| 108 | Isometry (fun x : StdSimplex ℝ ι => (x.weights : ι → ℝ)) := |
| 109 | Isometry.of_dist_eq fun x y => (dist_eq_weights x y).symm |
| 110 | |
| 111 | end |
| 112 | |
| 113 | end OAI.Geometry.Foundations.ConvexStdSimplexMetric.Convexity.StdSimplex |