math / data /lean /OAI /Geometry /DoublingHilbert /FiniteCompactness.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.09 kB
import Mathlib
namespace OAI
open Set Metric
noncomputable section
namespace CompactBanach
theorem normalized_embedding_of_finite
{X E : Type*} [MetricSpace X] [NormedAddCommGroup E] [ProperSpace E]
(o : X) {A : ℝ} (hA : 0 ≀ A)
(hfinite : βˆ€ s : Finset X, βˆƒ f : s β†’ E, βˆ€ x y : s,
dist x y ≀ dist (f x) (f y) ∧ dist (f x) (f y) ≀ A * dist x y) :
βˆƒ f : X β†’ E, βˆ€ x y : X,
dist x y ≀ dist (f x) (f y) ∧ dist (f x) (f y) ≀ A * dist x y := by
classical
let Q : Set (X β†’ E) := {f | βˆ€ x, f x ∈ closedBall 0 (A * dist o x)}
have hQ : IsCompact Q := isCompact_pi_infinite fun x => isCompact_closedBall _ _
let C : X Γ— X β†’ Set (X β†’ E) := fun p => {f |
dist p.1 p.2 ≀ dist (f p.1) (f p.2) ∧
dist (f p.1) (f p.2) ≀ A * dist p.1 p.2}
have hC (p : X Γ— X) : IsClosed (C p) :=
(isClosed_le continuous_const ((continuous_apply p.1).dist (continuous_apply p.2))).inter
(isClosed_le ((continuous_apply p.1).dist (continuous_apply p.2)) continuous_const)
have hFIP (u : Finset (X Γ— X)) : (Q ∩ β‹‚ p ∈ u, C p).Nonempty := by
let s : Finset X := insert o (u.image Prod.fst βˆͺ u.image Prod.snd)
have ho : o ∈ s := by simp [s]
obtain ⟨f, hf⟩ := hfinite s
let g : X β†’ E := fun x => if hx : x ∈ s then f ⟨x, hx⟩ - f ⟨o, ho⟩ else 0
refine ⟨g, ?_, ?_⟩
Β· intro x
by_cases hx : x ∈ s
Β· simp only [g, dite_eq_left hx, mem_closedBall, dist_zero_right]
simpa only [dist_eq_norm, Subtype.dist_eq, dist_comm o x] using (hf ⟨x, hx⟩ ⟨o, ho⟩).2
Β· simp only [g, dite_eq_right hx, mem_closedBall, dist_self]
exact mul_nonneg hA dist_nonneg
Β· simp only [mem_iInter]
intro p hp
have hx : p.1 ∈ s := by simp [s, Finset.mem_image_of_mem _ hp]
have hy : p.2 ∈ s := by simp [s, Finset.mem_image_of_mem _ hp]
change dist p.1 p.2 ≀ dist (g p.1) (g p.2) ∧
dist (g p.1) (g p.2) ≀ A * dist p.1 p.2
simpa only [g, dite_eq_left hx, dite_eq_left hy, dist_sub_right, Subtype.dist_eq] using
hf ⟨p.1, hx⟩ ⟨p.2, hy⟩
obtain ⟨f, _, hf⟩ := hQ.inter_iInter_nonempty C hC hFIP
refine ⟨f, fun x y => ?_⟩
exact mem_iInter.mp hf (x, y)
theorem normalized_embedding_of_scaled
{X E : Type*} [MetricSpace X] [NormedAddCommGroup E] [NormedSpace ℝ E]
{f : X β†’ E} {a A : ℝ} (ha : 0 < a)
(hf : βˆ€ x y, a * dist x y ≀ dist (f x) (f y) ∧
dist (f x) (f y) ≀ A * a * dist x y) :
βˆƒ g : X β†’ E, βˆ€ x y,
dist x y ≀ dist (g x) (g y) ∧ dist (g x) (g y) ≀ A * dist x y := by
let g : X β†’ E := fun x => a⁻¹ β€’ f x
have hd (x y : X) : dist (g x) (g y) = a⁻¹ * dist (f x) (f y) := by
simp only [g, dist_smulβ‚€, Real.norm_eq_abs, abs_inv, abs_of_pos ha]
refine ⟨g, fun x y => ?_⟩
rw [hd]
constructor
Β· calc
dist x y = a⁻¹ * (a * dist x y) := by field_simp
_ ≀ _ := mul_le_mul_of_nonneg_left (hf x y).1 (inv_nonneg.mpr ha.le)
Β· calc
a⁻¹ * dist (f x) (f y) ≀ a⁻¹ * (A * a * dist x y) :=
mul_le_mul_of_nonneg_left (hf x y).2 (inv_nonneg.mpr ha.le)
_ = A * dist x y := by field_simp
theorem finite_witness_of_no_embedding
{X E : Type*} [MetricSpace X] [NormedAddCommGroup E] [NormedSpace ℝ E]
[ProperSpace E] (o : X) {A : ℝ} (hA : 0 ≀ A)
(hno : Β¬ βˆƒ f : X β†’ E, βˆ€ x y,
dist x y ≀ dist (f x) (f y) ∧ dist (f x) (f y) ≀ A * dist x y) :
βˆƒ s : Finset X, Β¬ βˆƒ f : s β†’ E, βˆƒ a : ℝ, 0 < a ∧
βˆ€ x y : s, a * dist x y ≀ dist (f x) (f y) ∧
dist (f x) (f y) ≀ A * a * dist x y := by
classical
by_contra! h
apply hno
apply normalized_embedding_of_finite o hA
intro s
obtain ⟨f, a, ha, hf⟩ := h s
exact normalized_embedding_of_scaled ha hf
end CompactBanach
end
end OAI