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