import OAI.Geometry.Hirsch.Main import Mathlib.Analysis.SpecialFunctions.Log.Basic import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Tactic /-! # My bridge proofs for the Hirsch check (desk task 430) All proofs in this file are mine. The file uses the definitions and the theorems of the claimant only as given constants. -/ open scoped Topology Pointwise namespace CheckHirsch open Set Module Filter open OAI.Geometry.Hirsch /-! ### 1. The graph for one move is the graph of the edges -/ section Skeleton variable {E : Type} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] {body face : Set E} /-- My lemma. A set of dimension at most 1 that contains two different extreme points of `body` is a subset of the segment between the two points. -/ theorem face_subset_segment {u v : E} (hsub : face ⊆ body) (hu : u ∈ body.extremePoints ℝ) (hv : v ∈ body.extremePoints ℝ) (huv : u ≠ v) (hfu : u ∈ face) (hfv : v ∈ face) (hdim : finrank ℝ (vectorSpan ℝ face) ≤ 1) : face ⊆ segment ℝ u v := by have hne : (v -ᵥ u : E) ≠ 0 := by intro h have h' : v - u = 0 := h exact huv (sub_eq_zero.1 h').symm have hle : Submodule.span ℝ {v -ᵥ u} ≤ vectorSpan ℝ face := Submodule.span_le.2 fun x hx => by rw [mem_singleton_iff.1 hx]; exact vsub_mem_vectorSpan ℝ hfv hfu have hfr : finrank ℝ (Submodule.span ℝ {v -ᵥ u}) = finrank ℝ (vectorSpan ℝ face) := le_antisymm (Submodule.finrank_mono hle) (by rw [finrank_span_singleton hne]; exact hdim) have heq : Submodule.span ℝ {v -ᵥ u} = vectorSpan ℝ face := Submodule.eq_of_le_of_finrank_eq hle hfr intro w hw have hwu : w -ᵥ u ∈ vectorSpan ℝ face := vsub_mem_vectorSpan ℝ hw hfu rw [← heq, Submodule.mem_span_singleton] at hwu obtain ⟨t, ht⟩ := hwu have ht' : w - u = t • (v - u) := ht.symm have hwu' : w = t • (v - u) + u := by rw [sub_eq_iff_eq_add] at ht'; exact ht' have hwb : w ∈ body := hsub hw have hub : u ∈ body := hu.1 have hvb : v ∈ body := hv.1 rcases lt_or_ge t 0 with ht0 | ht0 · exfalso have hmem : u ∈ openSegment ℝ w v := by rw [openSegment_eq_image_lineMap] refine ⟨-t / (1 - t), mem_Ioo.mpr ⟨div_pos (neg_pos.2 ht0) (by linarith), (div_lt_one (by linarith : (0 : ℝ) < 1 - t)).2 (by linarith)⟩, ?_⟩ rw [AffineMap.lineMap_apply_module'] have hexp : (((-t / (1 - t)) • (v - w) + w) - u) = (((-t / (1 - t)) * (1 - t) + t) • (v - u)) := by rw [hwu']; module rw [div_mul_cancel₀ (-t) (by linarith : (1 - t : ℝ) ≠ 0), show (-t + t : ℝ) = 0 by ring, zero_smul] at hexp rw [sub_eq_zero] at hexp exact hexp rw [hu.2 hwb hvb hmem] at ht' rcases smul_eq_zero.1 (ht'.symm.trans (sub_self u)) with h | h · linarith · exact huv (sub_eq_zero.1 h).symm · rcases le_or_gt t 1 with ht1 | ht1 · rw [segment_eq_image_lineMap] refine ⟨t, mem_Icc.mpr ⟨ht0, ht1⟩, ?_⟩ rw [AffineMap.lineMap_apply_module'] exact hwu'.symm · exfalso have hmem : v ∈ openSegment ℝ u w := by rw [openSegment_eq_image_lineMap] refine ⟨1 / t, mem_Ioo.mpr ⟨div_pos (by linarith) (by linarith), (div_lt_one (by linarith : (0 : ℝ) < t)).2 (by linarith)⟩, ?_⟩ rw [AffineMap.lineMap_apply_module'] have hexp : (((1 / t) • (w - u) + u) - v) = (((1 / t) * t - 1) • (v - u)) := by rw [hwu']; module rw [one_div_mul_cancel (by linarith : (t : ℝ) ≠ 0), show ((1 : ℝ) - 1) = 0 by ring, zero_smul] at hexp rw [sub_eq_zero] at hexp exact hexp exact huv (hv.2 hub hwb hmem) /-- My theorem. Two vertices are adjacent in the graph of the claimant for one move if and only if they are different and the segment between them is a face. So the graph is the graph of the vertices and the edges of the polytope. -/ theorem adj_one_iff {body : Set E} (u v : Vertex body) : (graph body 1).Adj u v ↔ u ≠ v ∧ IsFace body (segment ℝ u.val v.val) := by constructor · rintro ⟨hne, face, hface, hdim, hu, hv⟩ have hne' : (u.val : E) ≠ v.val := fun h => hne (Subtype.ext h) have hsub := face_subset_segment hface.2.1 u.property v.property hne' hu hv hdim have hseg : segment ℝ u.val v.val ⊆ face := hface.1.segment_subset hu hv have hext : IsExtreme ℝ body (segment ℝ u.val v.val) := by refine ⟨subset_trans hseg hface.2.1, ?_⟩ intro x hx y hy z hz hzseg exact hsub (hface.2.left_mem_of_mem_openSegment hx hy (hseg hz) hzseg) exact ⟨hne, convex_segment u.val v.val, hext⟩ · rintro ⟨hne, hseg⟩ have hvne : (v.val : E) -ᵥ u.val ≠ 0 := by intro h have h' : v.val - u.val = 0 := h exact hne (Subtype.ext (sub_eq_zero.1 h').symm) have hle : vectorSpan ℝ (segment ℝ u.val v.val) ≤ Submodule.span ℝ {v.val -ᵥ u.val} := by rw [vectorSpan_def, Submodule.span_le] rintro x ⟨p, hp, q, hq, rfl⟩ rw [segment_eq_image_lineMap] at hp hq obtain ⟨a, ha, rfl⟩ := (mem_image _ _ _).1 hp obtain ⟨b, hb, rfl⟩ := (mem_image _ _ _).1 hq refine Submodule.mem_span_singleton.2 ⟨a - b, ?_⟩ show (a - b) • (v.val - u.val) = AffineMap.lineMap u.val v.val a - AffineMap.lineMap u.val v.val b rw [AffineMap.lineMap_apply_module', AffineMap.lineMap_apply_module'] module have hu' : u.val ∈ segment ℝ u.val v.val := left_mem_segment ℝ u.val v.val have hv' : v.val ∈ segment ℝ u.val v.val := right_mem_segment ℝ u.val v.val refine ⟨hne, segment ℝ u.val v.val, hseg, ?_, hu', hv'⟩ show finrank ℝ (vectorSpan ℝ (segment ℝ u.val v.val)) ≤ 1 exact le_trans (Submodule.finrank_mono hle) (by rw [finrank_span_singleton hvne]) end Skeleton /-! ### 2. The diameter is the largest distance in a connected graph -/ /-- My lemma. It is also a check by `rfl` that the distance in the statement `not_polynomialHirsch` is the distance in the graph of the same statements. -/ theorem dist_one_is_graph_dist (poly : Polytope) (first last : poly.V) : poly.dist 1 first last = (graph poly.body 1).dist first last := rfl /-- My lemma. -/ theorem diam_le_of_dist_le {α : Type*} [Nonempty α] [Finite α] {G : SimpleGraph α} (hconn : G.Connected) {k : ℕ} (h : ∀ u v, G.dist u v ≤ k) : G.diam ≤ k := by have htop : G.ediam ≠ ⊤ := SimpleGraph.connected_iff_ediam_ne_top.1 hconn have hle : G.ediam ≤ (k : ℕ∞) := SimpleGraph.ediam_le_iff.2 fun u v => by rw [← (hconn.1 u v).coe_dist_eq_edist] exact_mod_cast h u v have hd : ((G.diam : ℕ) : ℕ∞) = G.ediam := SimpleGraph.natCast_diam_eq_ediam_iff.2 htop rw [← hd] at hle exact_mod_cast hle /-- My lemma. -/ theorem le_diam_of_dist_eq {α : Type*} [Nonempty α] [Finite α] {G : SimpleGraph α} (hconn : G.Connected) {u v : α} {k : ℕ} (h : G.dist u v = k) : k ≤ G.diam := by have htop : G.ediam ≠ ⊤ := SimpleGraph.connected_iff_ediam_ne_top.1 hconn rw [← h] exact SimpleGraph.dist_le_diam htop /-! ### 3. The two asymptotic definitions give the notation of the paper -/ /-- My theorem. If a sequence is `Superpolynomial`, then the ratio of its logarithm to the logarithm of `n` tends to infinity. -/ theorem tendsto_atTop_of_superpolynomial {seq : ℕ → ℕ} (h : Superpolynomial seq) : Tendsto (fun n => Real.log ((seq n : ℕ) : ℝ) / Real.log (n : ℝ)) atTop atTop := by refine Filter.tendsto_atTop.2 fun b => ?_ filter_upwards [h (max b 1), h 0, eventually_ge_atTop 2] with n hn1 hn0 hn2 have hn0' : (1 : ℝ) ≤ ((seq n : ℕ) : ℝ) := by rw [Real.rpow_zero] at hn0; exact_mod_cast hn0 have hn2' : (1 : ℝ) < n := by exact_mod_cast hn2 have hlog : (max b 1 : ℝ) * Real.log (n : ℝ) ≤ Real.log ((seq n : ℕ) : ℝ) := by rw [← Real.log_rpow (by positivity : (0 : ℝ) < (n : ℝ)) (max b 1)] exact Real.log_le_log (by positivity : (0 : ℝ) < ((n : ℕ) : ℝ) ^ (max b 1)) hn1 rw [le_div_iff₀ (Real.log_pos hn2')] have := mul_le_mul_of_nonneg_right (le_max_left b 1) (Real.log_nonneg (le_of_lt hn2')) linarith /-- My theorem. If a sequence is `Subpolynomial`, then the ratio of its logarithm to the logarithm of `n` tends to zero. -/ theorem tendsto_zero_of_subpolynomial {seq : ℕ → ℕ} (h : Subpolynomial seq) : Tendsto (fun n => Real.log ((seq n : ℕ) : ℝ) / Real.log (n : ℝ)) atTop (𝓝 0) := by refine Metric.tendsto_nhds.2 fun eps heps => ?_ filter_upwards [h (eps / 2) (by linarith), eventually_ge_atTop 2] with n hn hn2 have hn2' : (1 : ℝ) < n := by exact_mod_cast hn2 have hlogn : 0 < Real.log (n : ℝ) := Real.log_pos hn2' have hnn : (0 : ℝ) < n := by positivity have hge1 : (1 : ℝ) ≤ (n : ℝ) := le_of_lt hn2' have heps2 : (0 : ℝ) ≤ eps / 2 := by linarith rcases Nat.eq_zero_or_pos (seq n) with h0 | hpos · have hz : Real.log ((seq n : ℕ) : ℝ) = 0 := by rw [h0]; simp rw [hz, Real.dist_eq, sub_zero, zero_div, abs_zero] exact heps · have hcast : (0 : ℝ) < ((seq n : ℕ) : ℝ) := by exact_mod_cast hpos have hnneg : (0 : ℝ) ≤ Real.log ((seq n : ℕ) : ℝ) := Real.log_nonneg (by exact_mod_cast (by linarith : (1 : ℕ) ≤ seq n)) have hratio : Real.log ((seq n : ℕ) : ℝ) / Real.log (n : ℝ) ≤ eps / 2 := by rw [div_le_iff₀ hlogn, ← Real.log_rpow hnn (eps / 2)] exact Real.log_le_log hcast hn rw [Real.dist_eq, sub_zero, abs_of_nonneg (div_nonneg hnneg hlogn.le)] exact lt_of_le_of_lt hratio (by linarith) /-- My lemma. -/ theorem one_subpolynomial : Subpolynomial (fun _ : ℕ => 1) := by intro eps heps filter_upwards [eventually_ge_atTop 1] with n hn have : (1 : ℝ) ≤ (n : ℝ) ^ eps := Real.one_le_rpow (by exact_mod_cast hn) (le_of_lt heps) exact_mod_cast this /-! ### 4. The claim and the theorems of the claimant -/ /-- My theorem. The claim on the site is the theorem `theorem_1_1` of the claimant with the number of moves equal to 1 (the fourth part is not used). -/ theorem claim_of_theorem_1_1 : ∃ family : ℕ → Polytope, (∀ᶠ n in atTop, Simple (family n).body ∧ (graph (family n).body 1).Connected ∧ (family n).facetCount = n) ∧ Subpolynomial (fun n => (family n).dimension) ∧ Superpolynomial (fun n => (graph (family n).body 1).diam) := by obtain ⟨family, h1, h2, h3, -⟩ := OAI.Geometry.Hirsch.theorem_1_1 (fun _ => 1) (fun _ => Nat.zero_lt_one) one_subpolynomial refine ⟨fun n => (family n).poly, ?_, h2, h3⟩ filter_upwards [h1] with n hn exact hn /-- My theorem. The claim on the site gives the negation in the file of the claimant: no number `coeff` and no exponent `power` give a bound `coeff * (n + 1) ^ power` for the distance in all simple polytopes with `n` facets. The statement below is a copy of the statement `not_polynomialHirsch` of the claimant. -/ theorem not_polynomialHirsch_of_claim (H : ∃ family : ℕ → Polytope, (∀ᶠ n in atTop, Simple (family n).body ∧ (graph (family n).body 1).Connected ∧ (family n).facetCount = n) ∧ Subpolynomial (fun n => (family n).dimension) ∧ Superpolynomial (fun n => (graph (family n).body 1).diam)) : ¬ (∃ coeff power : ℕ, ∀ poly : Polytope, Simple poly.body → (graph poly.body 1).Connected → ∀ first last : poly.V, poly.dist 1 first last ≤ coeff * (poly.facetCount + 1) ^ power) := by rintro ⟨coeff, power, hbound⟩ obtain ⟨family, hfam, -, hdiam⟩ := H have hup : ∀ᶠ n in atTop, (graph (family n).body 1).diam ≤ coeff * (n + 1) ^ power := by filter_upwards [hfam] with n hn obtain ⟨hs, hc, hcount⟩ := hn have hb := diam_le_of_dist_le hc (k := coeff * ((family n).facetCount + 1) ^ power) (fun u v => hbound (family n) hs hc u v) rwa [hcount] at hb have hdown : ∀ᶠ n in atTop, n ^ (power + 1) ≤ (graph (family n).body 1).diam := by filter_upwards [hdiam (power + 1)] with n hn have hb : ((n ^ (power + 1) : ℕ) : ℝ) ≤ ((graph (family n).body 1).diam : ℝ) := by rw [Nat.cast_pow] exact_mod_cast hn exact_mod_cast hb have hup' : ∀ᶠ n in atTop, n ^ (power + 1) ≤ coeff * 2 ^ power * n ^ power := by filter_upwards [hup, hdown, eventually_ge_atTop 1] with n h1 h2 hn1 have h2n : (n + 1) ^ power ≤ (2 * n) ^ power := Nat.pow_le_pow_left (by omega) power calc n ^ (power + 1) = n * n ^ power := pow_succ' n power _ ≤ (graph (family n).body 1).diam := by rw [← pow_succ' n power]; exact h2 _ ≤ coeff * (n + 1) ^ power := h1 _ ≤ coeff * ((2 * n) ^ power) := Nat.mul_le_mul_left _ h2n _ = coeff * 2 ^ power * n ^ power := by rw [Nat.mul_pow, Nat.mul_assoc] obtain ⟨A, hA⟩ : ∃ A : ℕ, coeff * 2 ^ power = A := ⟨_, rfl⟩ rw [hA] at hup' have hfalse : ∀ᶠ n : ℕ in atTop, False := by filter_upwards [hup', eventually_ge_atTop (max 1 (A + 1))] with n hn hlarge have hn1 : 1 ≤ n := le_trans (le_max_left _ _) hlarge have hAl : A < n := lt_of_lt_of_le (lt_add_one _) (le_trans (le_max_right _ _) hlarge) have hmul : n * n ^ power ≤ A * n ^ power := by rw [← pow_succ' n power]; exact hn have hkey := Nat.le_of_mul_le_mul_right hmul (Nat.pow_pos (by omega : 0 < n)) omega obtain ⟨N, hN⟩ := Filter.eventually_atTop.1 hfalse exact hN N (le_refl N) end CheckHirsch #print axioms CheckHirsch.face_subset_segment #print axioms CheckHirsch.adj_one_iff #print axioms CheckHirsch.dist_one_is_graph_dist #print axioms CheckHirsch.diam_le_of_dist_le #print axioms CheckHirsch.le_diam_of_dist_eq #print axioms CheckHirsch.tendsto_atTop_of_superpolynomial #print axioms CheckHirsch.tendsto_zero_of_subpolynomial #print axioms CheckHirsch.one_subpolynomial #print axioms CheckHirsch.claim_of_theorem_1_1 #print axioms CheckHirsch.not_polynomialHirsch_of_claim