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 Paul Lezeau and 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 | This file has been modified. |
| 16 | -/ |
| 17 | import OAI.AlgebraicTopology.Singular.SubdivisionAffineMesh |
| 18 | import Mathlib.Analysis.Normed.Module.Basic |
| 19 | import Mathlib.Analysis.Normed.Module.Convex |
| 20 | import OAI.AlgebraicTopology.Singular.ExcisionLebesgue |
| 21 | |
| 22 | /-! # Subdivision Affine Relative Mesh -/ |
| 23 | |
| 24 | namespace OAI.AlgebraicTopology.Singular.SubdivisionAffineRelativeMesh |
| 25 | |
| 26 | noncomputable section |
| 27 | |
| 28 | /-! |
| 29 | |
| 30 | # Relative mesh estimates for affine barycentric subdivision |
| 31 | |
| 32 | This file proves the relative mesh estimate, which bounds diameters in the image of an affine |
| 33 | parent simplex. If the vertices of that parent are `p i`, then the images of the barycenters in |
| 34 | any flag of nested nonempty faces have diameter at most `n / (n + 1)` times the diameter of the |
| 35 | parent vertices. |
| 36 | The result is stated first in an arbitrary real normed vector space and then specialized to the |
| 37 | affine self-maps used by iterated singular subdivision. |
| 38 | -/ |
| 39 | |
| 40 | open scoped OAI.Geometry.Foundations.ConvexStdSimplexMetric.Convexity.StdSimplex |
| 41 | |
| 42 | open _root_.CategoryTheory _root_.CategoryTheory.Limits PartialOrder Set Simplicial |
| 43 | |
| 44 | /-- The centroid of the vertices indexed by a nonempty face. -/ |
| 45 | noncomputable def affineParentFaceCentroid |
| 46 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 47 | {n : ℕ} (p : Fin (n + 1) → E) |
| 48 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) : E := |
| 49 | A.finset.centroid ℝ (fun i ↦ p i.down) |
| 50 | |
| 51 | theorem affineParentFaceCentroid_eq_smul_sum |
| 52 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 53 | {n : ℕ} (p : Fin (n + 1) → E) |
| 54 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) : |
| 55 | affineParentFaceCentroid p A = |
| 56 | (A.finset.card : ℝ)⁻¹ • ∑ i ∈ A.finset, p i.down := by |
| 57 | unfold affineParentFaceCentroid |
| 58 | rw [Finset.centroid_def, Finset.affineCombination_eq_linear_combination] |
| 59 | · simp only [Finset.centroidWeights_apply, Finset.smul_sum] |
| 60 | · exact A.finset.sum_centroidWeights_eq_one_of_nonempty ℝ A.nonempty |
| 61 | |
| 62 | /-- A face centroid belongs to the convex hull of the parent vertices. -/ |
| 63 | theorem affineParentFaceCentroid_mem_convexHull |
| 64 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 65 | {n : ℕ} (p : Fin (n + 1) → E) |
| 66 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) : |
| 67 | affineParentFaceCentroid p A ∈ convexHull ℝ (Set.range p) := by |
| 68 | unfold affineParentFaceCentroid |
| 69 | rw [Finset.centroid_def] |
| 70 | have h := affineCombination_mem_convexHull |
| 71 | (s := A.finset) (v := fun i ↦ p i.down) |
| 72 | (w := A.finset.centroidWeights ℝ) |
| 73 | (fun i hi ↦ by simp only [Finset.centroidWeights_apply]; positivity) |
| 74 | (A.finset.sum_centroidWeights_eq_one_of_nonempty ℝ A.nonempty) |
| 75 | have hrange : Set.range (fun i : ULift.{0} (Fin (n + 1)) ↦ p i.down) = |
| 76 | Set.range p := |
| 77 | ULift.down_surjective.range_comp p |
| 78 | rwa [hrange] at h |
| 79 | |
| 80 | /-- Translation formula for a parent-face centroid, in vector-space notation. -/ |
| 81 | theorem affineParentFaceCentroid_sub |
| 82 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 83 | {n : ℕ} (p : Fin (n + 1) → E) |
| 84 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) (c : E) : |
| 85 | affineParentFaceCentroid p A - c = |
| 86 | (A.finset.card : ℝ)⁻¹ • ∑ i ∈ A.finset, (p i.down - c) := by |
| 87 | calc |
| 88 | affineParentFaceCentroid p A - c = |
| 89 | affineParentFaceCentroid (fun i ↦ p i - c) A := by |
| 90 | unfold affineParentFaceCentroid |
| 91 | simpa only [vsub_eq_sub] using |
| 92 | (A.finset.centroid_vsub_const ℝ |
| 93 | (p := fun i ↦ p i.down) (p₀ := c) A.nonempty) |
| 94 | _ = _ := affineParentFaceCentroid_eq_smul_sum _ _ |
| 95 | |
| 96 | /-- The unnormalized displacement vectors from a face centroid sum to zero. -/ |
| 97 | theorem sum_sub_affineParentFaceCentroid_eq_zero |
| 98 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 99 | {n : ℕ} (p : Fin (n + 1) → E) |
| 100 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) : |
| 101 | ∑ i ∈ A.finset, (p i.down - affineParentFaceCentroid p A) = 0 := by |
| 102 | have h : (A.finset.card : ℝ)⁻¹ • |
| 103 | (∑ i ∈ A.finset, (p i.down - affineParentFaceCentroid p A)) = 0 := by |
| 104 | rw [← affineParentFaceCentroid_sub] |
| 105 | exact sub_self _ |
| 106 | have hcard : (A.finset.card : ℝ) ≠ 0 := by |
| 107 | exact_mod_cast (Nat.ne_of_gt A.nonempty.card_pos) |
| 108 | simpa [hcard] using h |
| 109 | |
| 110 | /-- The proportion of vertices introduced between nested nonempty faces is bounded by the |
| 111 | barycentric contraction factor. -/ |
| 112 | theorem card_sub_div_card_le_barycentricContractionFactor |
| 113 | (n a b : ℕ) (ha : 1 ≤ a) (hab : a ≤ b) (hb : b ≤ n + 1) : |
| 114 | ((b - a : ℕ) : ℝ) / (b : ℝ) ≤ SubdivisionAffineMesh.barycentricContractionFactor n := by |
| 115 | have haR : (1 : ℝ) ≤ a := by exact_mod_cast ha |
| 116 | have habR : (a : ℝ) ≤ b := by exact_mod_cast hab |
| 117 | have hbR : (b : ℝ) ≤ n + 1 := by exact_mod_cast hb |
| 118 | have hbpos : (0 : ℝ) < b := lt_of_lt_of_le zero_lt_one (haR.trans habR) |
| 119 | have hnpos : (0 : ℝ) < n + 1 := by positivity |
| 120 | have hone_div_b_le : (1 : ℝ) / b ≤ a / b := |
| 121 | div_le_div_of_nonneg_right haR hbpos.le |
| 122 | have hone_div_N_le : (1 : ℝ) / (n + 1) ≤ 1 / b := |
| 123 | one_div_le_one_div_of_le hbpos hbR |
| 124 | have hratio : (1 : ℝ) / (n + 1) ≤ a / b := |
| 125 | hone_div_N_le.trans hone_div_b_le |
| 126 | have hcast : ((b - a : ℕ) : ℝ) = (b : ℝ) - a := Nat.cast_sub hab |
| 127 | have hlhs : ((b : ℝ) - a) / b = 1 - a / b := by |
| 128 | field_simp |
| 129 | have hrhs : SubdivisionAffineMesh.barycentricContractionFactor n = 1 - 1 / (n + 1 : ℝ) := by |
| 130 | unfold SubdivisionAffineMesh.barycentricContractionFactor |
| 131 | field_simp |
| 132 | ring |
| 133 | rw [hcast, hlhs, hrhs] |
| 134 | linarith |
| 135 | |
| 136 | /-- Centroids of two nested nonempty faces contract by the standard barycentric factor, measured |
| 137 | relative to the diameter of the arbitrary affine parent vertex family. -/ |
| 138 | theorem dist_affineParentFaceCentroid_le |
| 139 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 140 | (n : ℕ) (p : Fin (n + 1) → E) |
| 141 | (A B : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) (hAB : A ≤ B) : |
| 142 | dist (affineParentFaceCentroid p A) (affineParentFaceCentroid p B) ≤ |
| 143 | SubdivisionAffineMesh.barycentricContractionFactor n * Metric.diam (Set.range p) := by |
| 144 | classical |
| 145 | let cA := affineParentFaceCentroid p A |
| 146 | let D := Metric.diam (Set.range p) |
| 147 | have hbpos : (0 : ℝ) < B.finset.card := by |
| 148 | exact_mod_cast B.nonempty.card_pos |
| 149 | have hbinv : 0 ≤ (B.finset.card : ℝ)⁻¹ := by positivity |
| 150 | have hAsum : ∑ i ∈ A.finset, (p i.down - cA) = 0 := |
| 151 | sum_sub_affineParentFaceCentroid_eq_zero p A |
| 152 | have hBsum : ∑ i ∈ B.finset, (p i.down - cA) = |
| 153 | ∑ i ∈ B.finset \ A.finset, (p i.down - cA) := by |
| 154 | rw [← Finset.sum_sdiff hAB, hAsum, add_zero] |
| 155 | have hconvexBounded : Bornology.IsBounded (convexHull ℝ (Set.range p)) := by |
| 156 | rw [isBounded_convexHull] |
| 157 | exact (Set.finite_range p).isBounded |
| 158 | have hterm (i : ULift.{0} (Fin (n + 1))) : |
| 159 | ‖p i.down - cA‖ ≤ D := by |
| 160 | have hp : p i.down ∈ convexHull ℝ (Set.range p) := |
| 161 | (subset_convexHull ℝ (Set.range p)) (Set.mem_range_self i.down) |
| 162 | have hc : cA ∈ convexHull ℝ (Set.range p) := |
| 163 | affineParentFaceCentroid_mem_convexHull p A |
| 164 | have hdist := Metric.dist_le_diam_of_mem hconvexBounded hp hc |
| 165 | rw [convexHull_diam] at hdist |
| 166 | simpa only [dist_eq_norm] using hdist |
| 167 | rw [dist_comm, dist_eq_norm, affineParentFaceCentroid_sub, hBsum, norm_smul, |
| 168 | Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hbpos)] |
| 169 | calc |
| 170 | (B.finset.card : ℝ)⁻¹ * |
| 171 | ‖∑ i ∈ B.finset \ A.finset, (p i.down - cA)‖ ≤ |
| 172 | (B.finset.card : ℝ)⁻¹ * |
| 173 | ∑ i ∈ B.finset \ A.finset, ‖p i.down - cA‖ := |
| 174 | mul_le_mul_of_nonneg_left (norm_sum_le _ _) hbinv |
| 175 | _ ≤ (B.finset.card : ℝ)⁻¹ * |
| 176 | ∑ _i ∈ B.finset \ A.finset, D := by |
| 177 | apply mul_le_mul_of_nonneg_left _ hbinv |
| 178 | exact Finset.sum_le_sum fun i _ ↦ hterm i |
| 179 | _ = (((B.finset \ A.finset).card : ℝ) / B.finset.card) * D := by |
| 180 | rw [Finset.sum_const, nsmul_eq_mul] |
| 181 | ring |
| 182 | _ = (((B.finset.card - A.finset.card : ℕ) : ℝ) / |
| 183 | B.finset.card) * D := by |
| 184 | rw [Finset.card_sdiff_of_subset hAB] |
| 185 | _ ≤ SubdivisionAffineMesh.barycentricContractionFactor n * D := by |
| 186 | apply mul_le_mul_of_nonneg_right _ (Metric.diam_nonneg) |
| 187 | exact card_sub_div_card_le_barycentricContractionFactor n |
| 188 | A.finset.card B.finset.card A.nonempty.card_pos |
| 189 | (Finset.card_le_card hAB) (by simpa using B.finset.card_le_univ) |
| 190 | |
| 191 | /-- The affine combination of a family in a real normed vector space. -/ |
| 192 | noncomputable def normedAffineCombination |
| 193 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 194 | {I : Type*} [Fintype I] (p : I → E) (w : Convexity.StdSimplex ℝ I) : E := |
| 195 | ∑ i, w i • p i |
| 196 | |
| 197 | /-- Evaluating an affine parent on a face barycenter gives the centroid of the corresponding |
| 198 | parent vertices. -/ |
| 199 | theorem normedAffineCombination_nonemptyFiniteChainBarycenter |
| 200 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 201 | {n : ℕ} (p : Fin (n + 1) → E) |
| 202 | (A : NonemptyFiniteChains (ULift.{0} (Fin (n + 1)))) : |
| 203 | normedAffineCombination p (SubdivisionAffine.nonemptyFiniteChainBarycenter A) = |
| 204 | affineParentFaceCentroid p A := by |
| 205 | classical |
| 206 | rw [affineParentFaceCentroid_eq_smul_sum] |
| 207 | unfold normedAffineCombination |
| 208 | simp only [SubdivisionAffine.nonemptyFiniteChainBarycenter_apply, ite_smul, zero_smul] |
| 209 | rw [Finset.sum_ite] |
| 210 | simp only [Finset.sum_const_zero, add_zero] |
| 211 | rw [Finset.smul_sum] |
| 212 | rw [← A.finset.sum_attach] |
| 213 | symm |
| 214 | apply Finset.sum_bij (fun i _ ↦ i.1.down) |
| 215 | · intro i hi |
| 216 | simp only [Finset.mem_filter, Finset.mem_univ, true_and] |
| 217 | exact i.2 |
| 218 | · intro i₁ hi₁ i₂ hi₂ h |
| 219 | apply Subtype.ext |
| 220 | exact ULift.down_injective h |
| 221 | · intro i hi |
| 222 | simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hi |
| 223 | exact ⟨⟨ULift.up i, hi⟩, Finset.mem_attach _ _, rfl⟩ |
| 224 | · intro i hi |
| 225 | rfl |
| 226 | |
| 227 | /-- Applying an affine parent after a flag simplex is the affine combination of the images of |
| 228 | the flag's barycenter vertices. -/ |
| 229 | theorem normedAffineCombination_affineFlagContinuousMap |
| 230 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 231 | (n k : ℕ) (p : Fin (n + 1) → E) |
| 232 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 233 | (Opposite.op (SimplexCategory.mk k))) |
| 234 | (w : Convexity.StdSimplex ℝ (Fin (k + 1))) : |
| 235 | normedAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w) = |
| 236 | normedAffineCombination |
| 237 | (fun j ↦ affineParentFaceCentroid p (F.obj j)) w := by |
| 238 | classical |
| 239 | unfold normedAffineCombination SubdivisionAffine.affineFlagContinuousMap |
| 240 | simp only [ContinuousMap.coe_mk, SubdivisionAffine.stdSimplexAffineCombination_apply] |
| 241 | change (∑ i, (∑ j, w j * SubdivisionAffine.nonemptyFiniteChainBarycenter (F.obj j) i) • p i) = |
| 242 | ∑ j, w j • affineParentFaceCentroid p (F.obj j) |
| 243 | simp_rw [← normedAffineCombination_nonemptyFiniteChainBarycenter p (F.obj _)] |
| 244 | unfold normedAffineCombination |
| 245 | simp only [Finset.sum_smul, Finset.smul_sum, mul_smul] |
| 246 | rw [Finset.sum_comm] |
| 247 | |
| 248 | /-- The parent images of the barycenter vertices in an affine flag. -/ |
| 249 | noncomputable def affineParentFlagVertexSet |
| 250 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 251 | (n k : ℕ) (p : Fin (n + 1) → E) |
| 252 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 253 | (Opposite.op (SimplexCategory.mk k))) : Set E := |
| 254 | Set.range fun j ↦ affineParentFaceCentroid p (F.obj j) |
| 255 | |
| 256 | /-- The vertices of a subdivided affine parent satisfy the relative mesh estimate. -/ |
| 257 | theorem diam_affineParentFlagVertexSet_le |
| 258 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 259 | (n k : ℕ) (p : Fin (n + 1) → E) |
| 260 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 261 | (Opposite.op (SimplexCategory.mk k))) : |
| 262 | Metric.diam (affineParentFlagVertexSet n k p F) ≤ |
| 263 | SubdivisionAffineMesh.barycentricContractionFactor n * Metric.diam (Set.range p) := by |
| 264 | apply Metric.diam_le_of_forall_dist_le |
| 265 | (mul_nonneg (SubdivisionAffineMesh.barycentricContractionFactor_nonneg n) Metric.diam_nonneg) |
| 266 | rintro _ ⟨i, rfl⟩ _ ⟨j, rfl⟩ |
| 267 | rcases le_total i j with hij | hji |
| 268 | · exact dist_affineParentFaceCentroid_le n p _ _ |
| 269 | (CategoryTheory.leOfHom (F.map (CategoryTheory.homOfLE hij))) |
| 270 | · simpa [dist_comm] using |
| 271 | dist_affineParentFaceCentroid_le n p _ _ |
| 272 | (CategoryTheory.leOfHom (F.map (CategoryTheory.homOfLE hji))) |
| 273 | |
| 274 | /-- Every point in the subdivided affine parent lies in the convex hull of its new vertices. -/ |
| 275 | theorem normedAffineCombination_affineFlag_mem_convexHull_vertices |
| 276 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 277 | (n k : ℕ) (p : Fin (n + 1) → E) |
| 278 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 279 | (Opposite.op (SimplexCategory.mk k))) |
| 280 | (w : Convexity.StdSimplex ℝ (Fin (k + 1))) : |
| 281 | normedAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w) ∈ |
| 282 | convexHull ℝ (affineParentFlagVertexSet n k p F) := by |
| 283 | rw [normedAffineCombination_affineFlagContinuousMap] |
| 284 | unfold normedAffineCombination |
| 285 | have hmem := (convex_convexHull ℝ (affineParentFlagVertexSet n k p F)).sum_mem |
| 286 | (t := Finset.univ) (w := fun j ↦ w j) |
| 287 | (z := fun j ↦ affineParentFaceCentroid p (F.obj j)) |
| 288 | (fun j _ ↦ Convexity.StdSimplex.weights_nonneg (w := w) j) w.total_of_fintype |
| 289 | (fun j _ ↦ subset_convexHull ℝ |
| 290 | (affineParentFlagVertexSet n k p F) ⟨j, rfl⟩) |
| 291 | simpa only [smul_eq_mul] using hmem |
| 292 | |
| 293 | /-- Diameter form of the relative mesh estimate for an arbitrary affine parent in a normed |
| 294 | vector space. -/ |
| 295 | theorem diam_range_normedAffineCombination_affineFlag_le |
| 296 | {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 297 | (n k : ℕ) (p : Fin (n + 1) → E) |
| 298 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 299 | (Opposite.op (SimplexCategory.mk k))) : |
| 300 | Metric.diam (Set.range fun w ↦ |
| 301 | normedAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w)) ≤ |
| 302 | SubdivisionAffineMesh.barycentricContractionFactor n * Metric.diam (Set.range p) := by |
| 303 | calc |
| 304 | Metric.diam (Set.range fun w ↦ |
| 305 | normedAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w)) ≤ |
| 306 | Metric.diam (convexHull ℝ (affineParentFlagVertexSet n k p F)) := by |
| 307 | apply Metric.diam_mono |
| 308 | · rintro _ ⟨w, rfl⟩ |
| 309 | exact normedAffineCombination_affineFlag_mem_convexHull_vertices n k p F w |
| 310 | · rw [isBounded_convexHull] |
| 311 | exact (Set.finite_range fun j ↦ affineParentFaceCentroid p (F.obj j)).isBounded |
| 312 | _ = Metric.diam (affineParentFlagVertexSet n k p F) := |
| 313 | convexHull_diam _ |
| 314 | _ ≤ _ := diam_affineParentFlagVertexSet_le n k p F |
| 315 | |
| 316 | /-- An affine combination evaluated at a standard-simplex vertex returns that vertex's image. -/ |
| 317 | @[simp] |
| 318 | theorem stdSimplexAffineCombination_vertex |
| 319 | {X Y : Type*} [Fintype X] [Fintype Y] [DecidableEq X] |
| 320 | (p : X → Convexity.StdSimplex ℝ Y) (i : X) : |
| 321 | SubdivisionAffine.stdSimplexAffineCombination p (Convexity.StdSimplex.single i) = p i := by |
| 322 | classical |
| 323 | ext y |
| 324 | simp [SubdivisionAffine.stdSimplexAffineCombination_apply, Finsupp.single_apply] |
| 325 | |
| 326 | /-- Coercing a standard-simplex affine combination to its ambient vector space gives the |
| 327 | corresponding normed-space affine combination. -/ |
| 328 | theorem coe_stdSimplexAffineCombination_eq_normedAffineCombination |
| 329 | {X Y : Type*} [Fintype X] [Fintype Y] |
| 330 | (p : X → Convexity.StdSimplex ℝ Y) (w : Convexity.StdSimplex ℝ X) : |
| 331 | (SubdivisionAffine.stdSimplexAffineCombination p w : Y → ℝ) = |
| 332 | normedAffineCombination (fun i ↦ (p i : Y → ℝ)) w := by |
| 333 | ext y |
| 334 | simp only [SubdivisionAffine.stdSimplexAffineCombination_apply, normedAffineCombination, |
| 335 | Finset.sum_apply, Pi.smul_apply, smul_eq_mul] |
| 336 | |
| 337 | /-- The affine map determined by vertices in a standard simplex. -/ |
| 338 | noncomputable def affineParentContinuousMap |
| 339 | {X Y : Type*} [Fintype X] [Fintype Y] |
| 340 | (p : X → Convexity.StdSimplex ℝ Y) : |
| 341 | C(Convexity.StdSimplex ℝ X, Convexity.StdSimplex ℝ Y) := |
| 342 | ⟨SubdivisionAffine.stdSimplexAffineCombination p, SubdivisionAffine.continuous_stdSimplexAffineCombination p⟩ |
| 343 | |
| 344 | /-- Subdividing an arbitrary affine parent simplex contracts its image diameter by at most the |
| 345 | standard barycentric factor. -/ |
| 346 | theorem diam_range_affineParentContinuousMap_comp_affineFlag_le |
| 347 | (n k : ℕ) (p : Fin (n + 1) → Convexity.StdSimplex ℝ (Fin (n + 1))) |
| 348 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 349 | (Opposite.op (SimplexCategory.mk k))) : |
| 350 | Metric.diam (Set.range |
| 351 | ((affineParentContinuousMap p).comp (SubdivisionAffine.affineFlagContinuousMap n k F))) ≤ |
| 352 | SubdivisionAffineMesh.barycentricContractionFactor n * |
| 353 | Metric.diam (Set.range (affineParentContinuousMap p)) := by |
| 354 | classical |
| 355 | let p' : Fin (n + 1) → (Fin (n + 1) → ℝ) := |
| 356 | fun i ↦ (p i : Fin (n + 1) → ℝ) |
| 357 | let s : Set (Fin (n + 1) → ℝ) := Set.range fun w ↦ |
| 358 | normedAffineCombination p' (SubdivisionAffine.affineFlagContinuousMap n k F w) |
| 359 | have hsbounded : Bornology.IsBounded s := by |
| 360 | apply (show Bornology.IsBounded |
| 361 | (convexHull ℝ (affineParentFlagVertexSet n k p' F)) by |
| 362 | rw [isBounded_convexHull] |
| 363 | exact (Set.finite_range fun j ↦ |
| 364 | affineParentFaceCentroid p' (F.obj j)).isBounded).subset |
| 365 | rintro _ ⟨w, rfl⟩ |
| 366 | exact normedAffineCombination_affineFlag_mem_convexHull_vertices n k p' F w |
| 367 | have hpoint (w w' : Convexity.StdSimplex ℝ (Fin (k + 1))) : |
| 368 | dist (normedAffineCombination p' (SubdivisionAffine.affineFlagContinuousMap n k F w)) |
| 369 | (normedAffineCombination p' (SubdivisionAffine.affineFlagContinuousMap n k F w')) ≤ |
| 370 | SubdivisionAffineMesh.barycentricContractionFactor n * Metric.diam (Set.range p') := |
| 371 | (Metric.dist_le_diam_of_mem hsbounded ⟨w, rfl⟩ ⟨w', rfl⟩).trans |
| 372 | (diam_range_normedAffineCombination_affineFlag_le n k p' F) |
| 373 | have hpdiam : Metric.diam (Set.range p') = Metric.diam (Set.range p) := by |
| 374 | have himage : |
| 375 | (fun x : Convexity.StdSimplex ℝ (Fin (n + 1)) => (x.weights : Fin (n + 1) → ℝ)) '' |
| 376 | Set.range p = Set.range p' := |
| 377 | (Set.range_comp _ p).symm |
| 378 | rw [← himage, (Geometry.Foundations.ConvexStdSimplexMetric.Convexity.StdSimplex.isometry_weights (Fin (n + 1))).diam_image] |
| 379 | have hvertices : Set.range p ⊆ Set.range (affineParentContinuousMap p) := by |
| 380 | rintro _ ⟨i, rfl⟩ |
| 381 | exact ⟨Convexity.StdSimplex.single i, stdSimplexAffineCombination_vertex p i⟩ |
| 382 | have hparentdiam : Metric.diam (Set.range p) ≤ |
| 383 | Metric.diam (Set.range (affineParentContinuousMap p)) := by |
| 384 | apply Metric.diam_mono hvertices |
| 385 | exact isCompact_univ.isBounded.subset (Set.subset_univ _) |
| 386 | apply Metric.diam_le_of_forall_dist_le |
| 387 | (mul_nonneg (SubdivisionAffineMesh.barycentricContractionFactor_nonneg n) Metric.diam_nonneg) |
| 388 | rintro _ ⟨w, rfl⟩ _ ⟨w', rfl⟩ |
| 389 | rw [Geometry.Foundations.ConvexStdSimplexMetric.Convexity.StdSimplex.dist_eq_weights] |
| 390 | change dist |
| 391 | (SubdivisionAffine.stdSimplexAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w) : |
| 392 | Fin (n + 1) → ℝ) |
| 393 | (SubdivisionAffine.stdSimplexAffineCombination p (SubdivisionAffine.affineFlagContinuousMap n k F w') : |
| 394 | Fin (n + 1) → ℝ) ≤ _ |
| 395 | rw [coe_stdSimplexAffineCombination_eq_normedAffineCombination, |
| 396 | coe_stdSimplexAffineCombination_eq_normedAffineCombination] |
| 397 | change dist |
| 398 | (normedAffineCombination p' (SubdivisionAffine.affineFlagContinuousMap n k F w)) |
| 399 | (normedAffineCombination p' (SubdivisionAffine.affineFlagContinuousMap n k F w')) ≤ _ |
| 400 | exact (hpoint w w').trans <| by |
| 401 | rw [hpdiam] |
| 402 | exact mul_le_mul_of_nonneg_left hparentdiam |
| 403 | (SubdivisionAffineMesh.barycentricContractionFactor_nonneg n) |
| 404 | |
| 405 | /-- Associativity of standard-simplex affine combinations. -/ |
| 406 | theorem stdSimplexAffineCombination_assoc |
| 407 | {I J K : Type*} [Fintype I] [Fintype J] [Fintype K] |
| 408 | (p : I → Convexity.StdSimplex ℝ K) (q : J → Convexity.StdSimplex ℝ I) |
| 409 | (w : Convexity.StdSimplex ℝ J) : |
| 410 | SubdivisionAffine.stdSimplexAffineCombination p (SubdivisionAffine.stdSimplexAffineCombination q w) = |
| 411 | SubdivisionAffine.stdSimplexAffineCombination |
| 412 | (fun j ↦ SubdivisionAffine.stdSimplexAffineCombination p (q j)) w := by |
| 413 | classical |
| 414 | ext z |
| 415 | simp only [SubdivisionAffine.stdSimplexAffineCombination_apply] |
| 416 | simp_rw [Finset.sum_mul, Finset.mul_sum] |
| 417 | rw [Finset.sum_comm] |
| 418 | exact Finset.sum_congr rfl fun j _ ↦ Finset.sum_congr rfl fun i _ ↦ by ring |
| 419 | |
| 420 | /-- Composition of two explicitly affine standard-simplex maps is explicitly affine. -/ |
| 421 | theorem affineParentContinuousMap_comp |
| 422 | {I J K : Type*} [Fintype I] [Fintype J] [Fintype K] |
| 423 | (p : I → Convexity.StdSimplex ℝ K) (q : J → Convexity.StdSimplex ℝ I) : |
| 424 | (affineParentContinuousMap p).comp (affineParentContinuousMap q) = |
| 425 | affineParentContinuousMap |
| 426 | (fun j ↦ affineParentContinuousMap p (q j)) := |
| 427 | ContinuousMap.ext (stdSimplexAffineCombination_assoc p q) |
| 428 | |
| 429 | /-- The flag map itself is the affine map determined by its face-barycenter vertices. -/ |
| 430 | theorem affineFlagContinuousMap_eq_affineParentContinuousMap |
| 431 | (n k : ℕ) |
| 432 | (F : (SimplexCategory.sd.{0}.obj (SimplexCategory.mk n)).obj |
| 433 | (Opposite.op (SimplexCategory.mk k))) : |
| 434 | SubdivisionAffine.affineFlagContinuousMap n k F = |
| 435 | affineParentContinuousMap |
| 436 | (fun j ↦ SubdivisionAffine.nonemptyFiniteChainBarycenter (F.obj j)) := |
| 437 | rfl |
| 438 | |
| 439 | /-- An iterated affine cell is still the affine map determined by the images of the original |
| 440 | vertices. -/ |
| 441 | theorem iteratedAffineCellMap_eq_affineParentContinuousMap_vertices |
| 442 | (n : ℕ) (ancestry : List (SubdivisionAffineMesh.TopAffineFlag n)) : |
| 443 | SubdivisionAffineMesh.iteratedAffineCellMap n ancestry = |
| 444 | affineParentContinuousMap |
| 445 | (fun i ↦ SubdivisionAffineMesh.iteratedAffineCellMap n ancestry (Convexity.StdSimplex.single i)) := by |
| 446 | classical |
| 447 | induction ancestry with |
| 448 | | nil => |
| 449 | apply ContinuousMap.ext |
| 450 | intro w |
| 451 | ext y |
| 452 | simp [affineParentContinuousMap, SubdivisionAffine.stdSimplexAffineCombination_apply, |
| 453 | Finsupp.single_apply] |
| 454 | | cons F ancestry ih => |
| 455 | rw [SubdivisionAffineMesh.iteratedAffineCellMap_cons, ih, |
| 456 | affineFlagContinuousMap_eq_affineParentContinuousMap, |
| 457 | affineParentContinuousMap_comp] |
| 458 | congr 1 |
| 459 | funext i |
| 460 | simp [affineParentContinuousMap] |
| 461 | |
| 462 | /-- The relative mesh contraction estimate required by the iterated-cell argument: subdividing |
| 463 | inside an affine parent cell built from a flag ancestry multiplies that parent's diameter by at |
| 464 | most the standard barycentric factor. It holds unconditionally for every standard simplex. -/ |
| 465 | theorem affineFlagRelativeMeshContraction |
| 466 | (n : ℕ) (ancestry : List (SubdivisionAffineMesh.TopAffineFlag n)) (F : SubdivisionAffineMesh.TopAffineFlag n) : |
| 467 | Metric.diam (Set.range |
| 468 | ((SubdivisionAffineMesh.iteratedAffineCellMap n ancestry).comp |
| 469 | (SubdivisionAffine.affineFlagContinuousMap n n F))) ≤ |
| 470 | SubdivisionAffineMesh.barycentricContractionFactor n * |
| 471 | Metric.diam (Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry)) := by |
| 472 | rw [iteratedAffineCellMap_eq_affineParentContinuousMap_vertices n ancestry] |
| 473 | exact diam_range_affineParentContinuousMap_comp_affineFlag_le n n |
| 474 | (fun i ↦ SubdivisionAffineMesh.iteratedAffineCellMap n ancestry (Convexity.StdSimplex.single i)) F |
| 475 | |
| 476 | /-- An affine cell at ancestry depth `m` has diameter at most the `m`th power of the barycentric |
| 477 | factor. -/ |
| 478 | theorem diam_range_iteratedAffineCellMap_le_pow |
| 479 | (n : ℕ) (hn : 1 ≤ n) (ancestry : List (SubdivisionAffineMesh.TopAffineFlag n)) : |
| 480 | Metric.diam (Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry)) ≤ |
| 481 | SubdivisionAffineMesh.barycentricContractionFactor n ^ ancestry.length := by |
| 482 | induction ancestry with |
| 483 | | nil => |
| 484 | rw [SubdivisionAffineMesh.iteratedAffineCellMap_nil, List.length_nil, pow_zero, |
| 485 | ContinuousMap.coe_id, Set.range_id, SubdivisionAffineMesh.diam_univ_stdSimplex n hn] |
| 486 | | cons F ancestry ih => |
| 487 | calc |
| 488 | Metric.diam (Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n (F :: ancestry))) ≤ |
| 489 | SubdivisionAffineMesh.barycentricContractionFactor n * |
| 490 | Metric.diam (Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry)) := by |
| 491 | simpa only [SubdivisionAffineMesh.iteratedAffineCellMap_cons] using |
| 492 | affineFlagRelativeMeshContraction n ancestry F |
| 493 | _ ≤ SubdivisionAffineMesh.barycentricContractionFactor n * |
| 494 | SubdivisionAffineMesh.barycentricContractionFactor n ^ ancestry.length := |
| 495 | mul_le_mul_of_nonneg_left ih (SubdivisionAffineMesh.barycentricContractionFactor_nonneg n) |
| 496 | _ = SubdivisionAffineMesh.barycentricContractionFactor n ^ (F :: ancestry).length := by |
| 497 | simp only [List.length_cons, pow_succ] |
| 498 | ring |
| 499 | |
| 500 | /-- At a common sufficiently large ancestry depth, every iterated affine cell of a fixed singular |
| 501 | simplex is carried into one member of an arbitrary open cover. -/ |
| 502 | theorem exists_iteratedAffineCell_depth_subordinate |
| 503 | {ι : Type} (X : TopCat.{0}) (U : ι → Set X) |
| 504 | (hUopen : ∀ i, IsOpen (U i)) (hUcover : ⋃ i, U i = Set.univ) |
| 505 | (n : ℕ) (hn : 1 ≤ n) |
| 506 | (x : (TopCat.toSSet.obj X).obj |
| 507 | (Opposite.op (SimplexCategory.mk n))) : |
| 508 | ∃ m : ℕ, ∀ ancestry : List (SubdivisionAffineMesh.TopAffineFlag n), ancestry.length = m → |
| 509 | ∃ i, X.toSSetObjEquiv _ x '' |
| 510 | Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry) ⊆ U i := by |
| 511 | obtain ⟨δ, hδ, hLeb⟩ := |
| 512 | ExcisionLebesgue.singularSimplex_openCover_lebesgueNumber X U hUopen hUcover n x |
| 513 | obtain ⟨m, hm⟩ := SubdivisionAffineMesh.exists_barycentricContractionFactor_pow_lt n hδ |
| 514 | refine ⟨m, fun ancestry hlength ↦ ?_⟩ |
| 515 | let s : Set (Convexity.StdSimplex ℝ (Fin (n + 1))) := |
| 516 | Set.range (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry) |
| 517 | let w₀ : Convexity.StdSimplex ℝ (Fin (n + 1)) := Classical.arbitrary _ |
| 518 | obtain ⟨i, hi⟩ := hLeb (SubdivisionAffineMesh.iteratedAffineCellMap n ancestry w₀) |
| 519 | refine ⟨i, ?_⟩ |
| 520 | rintro _ ⟨y, ⟨w, rfl⟩, rfl⟩ |
| 521 | apply hi |
| 522 | rw [Metric.mem_ball] |
| 523 | have hsbounded : Bornology.IsBounded s := |
| 524 | isCompact_univ.isBounded.subset (Set.subset_univ s) |
| 525 | exact (Metric.dist_le_diam_of_mem hsbounded |
| 526 | (show SubdivisionAffineMesh.iteratedAffineCellMap n ancestry w ∈ s from ⟨w, rfl⟩) |
| 527 | (show SubdivisionAffineMesh.iteratedAffineCellMap n ancestry w₀ ∈ s from ⟨w₀, rfl⟩)).trans_lt |
| 528 | ((diam_range_iteratedAffineCellMap_le_pow n hn ancestry).trans_lt |
| 529 | (hlength.symm ▸ hm)) |
| 530 | |
| 531 | end |
| 532 | |
| 533 | end OAI.AlgebraicTopology.Singular.SubdivisionAffineRelativeMesh |