cfahlgren1/math / lean /ComparatorChallenges /RecursivePotentials.lean
cfahlgren1's picture
download
raw
37.7 kB
import Mathlib
namespace OAI
noncomputable section
/-!
The final claim constructs the spaces and states all eleven original results.
`Analysis.RecursivePotentials.Challenge.main_iff_original` verifies statement preservation.
-/
universe uIndex uSpace uOther uDomain uTarget uFiber
open scoped BigOperators
namespace RecursivePotentials
def leastPair (x a b : ℝ) : ℝ × ℝ := (max a (x + b), max b (-x + a))
structure FiniteRootedTree (ι : Type uIndex) where
root : ι
parent : ι → ι
depth : ι → ℕ
parent_root : parent root = root
depth_root : depth root = 0
parent_depth : ∀ i, i ≠ root → depth (parent i) < depth i
namespace FiniteRootedTree
section
variable {ι : Type uIndex} [indexFinite : Fintype ι] [indexDecidable : DecidableEq ι]
(T : FiniteRootedTree ι)
def children (s : ι) : Finset ι :=
Finset.univ.filter fun c => c ≠ T.root ∧ T.parent c = s
def maxDepth : ℕ := Finset.univ.sup T.depth
noncomputable def fields (v : ι → ℝ) (s : ι) : ℝ × ℝ :=
leastPair (v s)
(Real.sqrt (∑ c : {c // c ∈ T.children s}, (fields v c.1).1 ^ 2))
(Real.sqrt (∑ c : {c // c ∈ T.children s}, (fields v c.1).2 ^ 2))
termination_by T.maxDepth - T.depth s
decreasing_by
all_goals
have hc := (Finset.mem_filter.mp c.2).2
have hd := T.parent_depth c.1 hc.1
rw [hc.2] at hd
have hm : T.depth c.1 ≤ T.maxDepth := Finset.le_sup (Finset.mem_univ c.1)
omega
def Initial (H : Finset ι) : Prop := T.root ∈ H ∧ ∀ s ∈ H, T.parent s ∈ H
end
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
def ancestors (s : ι) : Finset ι :=
if _hs : s = T.root then {s} else insert s (ancestors (T.parent s))
termination_by T.depth s
decreasing_by exact T.parent_depth s _hs
def ancestorClosure (S : Finset ι) : Finset ι :=
insert T.root (S.biUnion T.ancestors)
def restrict (H : Finset ι) (hH : T.Initial H) : FiniteRootedTree H where
root := ⟨T.root, hH.1⟩
parent s := ⟨T.parent s, hH.2 s.1 s.2⟩
depth s := T.depth s
parent_root := Subtype.ext T.parent_root
depth_root := T.depth_root
parent_depth s hs := T.parent_depth s (fun h => hs (Subtype.ext h))
noncomputable def extend (H : Finset ι) (f : H → ℝ) : ι →₀ ℝ :=
Finsupp.onFinset H (fun s => if hs : s ∈ H then f ⟨s, hs⟩ else 0)
(fun s hs => by by_contra hh; simp [hh] at hs)
def head (v : ι →₀ ℝ) : Finset ι := T.ancestorClosure v.support
def projectHead (_T : FiniteRootedTree ι) (H : Finset ι) (v : ι →₀ ℝ) : ι →₀ ℝ := v.filter (· ∈ H)
end FiniteRootedTree
structure CofiniteSubspace (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E] where
space : Submodule ℝ E
closed : IsClosed (space : Set E)
finiteQuotient : Module.Finite ℝ (E ⧸ space)
section Moduli
variable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E]
noncomputable def averagedGain (x : E) (t : ℝ) (y : E) : ℝ := (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1
noncomputable def averagedInner (x : E) (t : ℝ) (F : CofiniteSubspace E) : ℝ :=
sInf {r : ℝ | ∃ y ∈ F.space, 1 ≤ ‖y‖ ∧ r = averagedGain x t y}
noncomputable def averagedModulus (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E]
(t : ℝ) : ℝ :=
sInf {r : ℝ | ∃ x : E, ‖x‖ = 1 ∧ r = sSup (Set.range (averagedInner x t))}
end Moduli
def sequenceTree : FiniteRootedTree (List ℕ) where
root := []
parent := List.dropLast
depth := List.length
parent_root := rfl
depth_root := rfl
parent_depth s hs := by
rw [List.length_dropLast]
have h := List.length_pos_iff_ne_nil.mpr hs
omega
abbrev ComponentNode (h : ℕ+) := {s : List ℕ // s.length ≤ h.val}
abbrev JoinedNode := Option (Σ h : ℕ+, ComponentNode h)
def joinedTree : FiniteRootedTree JoinedNode where
root := none
parent
| none => none
| some ⟨h, s⟩ => if s.1 = [] then none else
some ⟨h, ⟨s.1.dropLast, by rw [List.length_dropLast]; have := s.2; omega⟩⟩
depth
| none => 0
| some ⟨_, s⟩ => s.1.length + 1
parent_root := rfl
depth_root := rfl
parent_depth s hs := by
cases s with
| none => exact (hs rfl).elim
| some s =>
obtain ⟨h, s⟩ := s
dsimp
by_cases he : s.1 = []
· simp [he]
· rw [ite_eq_right he]
dsimp
rw [List.length_dropLast]
have hpos := List.length_pos_iff_ne_nil.mpr he
omega
open Filter Topology
def WeaklyNull {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E] (d : ℕ → E) : Prop :=
∀ f : E →L[ℝ] ℝ, Tendsto (fun k => f (d k)) atTop (𝓝 0)
structure EquivalentNorm (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E] where
N : Seminorm ℝ E
lower : ℝ
upper : ℝ
lower_pos : 0 < lower
lower_le_upper : lower ≤ upper
lower_bound : ∀ x, lower * ‖x‖ ≤ N x
upper_bound : ∀ x, N x ≤ upper * ‖x‖
namespace EquivalentNorm
variable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E] (A : EquivalentNorm E)
noncomputable def inner (x : E) (t : ℝ) (F : CofiniteSubspace E) : ℝ :=
sInf {r : ℝ | ∃ y ∈ F.space, A.N y = 1 ∧ r = A.N (x + t • y) - 1}
noncomputable def modulus (t : ℝ) : ℝ :=
sInf {r : ℝ | ∃ x : E, A.N x = 1 ∧ r = sSup (Set.range (A.inner x t))}
def AUC : Prop := ∀ t : ℝ, 0 < t → 0 < A.modulus t
end EquivalentNorm
open scoped ENNReal
def IsReflexive (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E] : Prop :=
Function.Surjective (NormedSpace.inclusionInDoubleDual ℝ E)
namespace SquareSum
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (E : ι → Type uFiber)
[∀ i, NormedAddCommGroup (E i)] [fiberNormedSpace : ∀ i, NormedSpace ℝ (E i)]
abbrev Space : Type _ := ↥(lp E 2)
end SquareSum
open UniformSpace
def completionEquivOfDense {E : Type uSpace} {F : Type uOther} [NormedAddCommGroup E]
[NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] (f : E →L[ℝ] F)
(K : NNReal) (hK : ∀ x, ‖x‖ ≤ K * ‖f x‖) (hdense : DenseRange f) : Completion E ≃L[ℝ] F := by
let g := f.fromCompletion
have hbound : ∀ x : Completion E, ‖x‖ ≤ K * ‖g x‖ := by
intro x
induction x using Completion.induction_on with
| hp => exact isClosed_le continuous_norm (continuous_const.mul (g.continuous.norm))
| ih x => simpa only [g, ContinuousLinearMap.fromCompletion_apply_coe, Completion.norm_coe] using hK x
have hanti := g.antilipschitz_of_bound hbound
have hclosed := hanti.isClosed_range g.uniformContinuous
have hsurj : Function.Surjective g := by
intro y
have hh : y ∈ closure (Set.range f) := hdense y
have hsub : Set.range f ⊆ Set.range g := by
rintro _ ⟨x, rfl⟩
exact ⟨(x : Completion E), ContinuousLinearMap.fromCompletion_apply_coe f x⟩
have hm := closure_mono hsub hh
rw [hclosed.closure_eq] at hm
exact hm
exact ContinuousLinearEquiv.ofBijective g (LinearMap.ker_eq_bot.mpr hanti.injective)
(LinearMap.range_eq_top.mpr hsurj)
def componentTree (h : ℕ+) : FiniteRootedTree (ComponentNode h) where
root := ⟨[], by simp⟩
parent s := ⟨s.1.dropLast, by rw [List.length_dropLast]; have := s.2; omega⟩
depth s := s.1.length
parent_root := Subtype.ext rfl
depth_root := rfl
parent_depth s hs := by
rw [List.length_dropLast]
have hne : s.1 ≠ [] := fun h => hs (Subtype.ext h)
have hp := List.length_pos_iff_ne_nil.mpr hne
omega
def logarithmicGamma (M β : ℝ) : ℝ :=
let h := β ^ 2 / (2 * M ^ 2)
let c := β * Real.sqrt h / 8
let H := 1 + Real.log (M / c)
let K := 4 * (2 + Real.sqrt 6) * H / h
β * h / 8 * Real.exp (-K)
open Filter
open scoped Topology
structure ChildExponent where
val : ℝ
one_le : 1 ≤ val
namespace ChildExponent
variable (p : ChildExponent)
def agg {ι : Type uIndex} (s : Finset ι) (f : ι → ℝ) : ℝ :=
(∑ i ∈ s, |f i| ^ p.val) ^ (1 / p.val)
end ChildExponent
section
variable {ι : Type uIndex} [indexFinite : Fintype ι] [indexDecidable : DecidableEq ι]
(T : FiniteRootedTree ι) (p : ChildExponent)
def FiniteRootedTree.pfields (v : ι → ℝ) (s : ι) : ℝ × ℝ :=
leastPair (v s)
(p.agg Finset.univ (fun c : {c // c ∈ T.children s} => (pfields v c.1).1))
(p.agg Finset.univ (fun c : {c // c ∈ T.children s} => (pfields v c.1).2))
termination_by T.maxDepth - T.depth s
decreasing_by
all_goals
have hc := (Finset.mem_filter.mp c.2).2
have hd := T.parent_depth c.1 hc.1
rw [hc.2] at hd
have hm : T.depth c.1 ≤ T.maxDepth := Finset.le_sup (Finset.mem_univ c.1)
omega
end
namespace VariableExponent
def heightExponent (h : ℕ+) : ℝ := 1 + 1 / (h.val : ℝ)
def cubicConstant : ℝ := (6 * Real.exp 1)⁻¹ ^ 3
def sixthConstant : ℝ := 2 * Real.exp (-(Real.exp 1 - 1)) * (4 : ℝ)⁻¹ ^ 6
end VariableExponent
open Filter Topology TopologicalSpace
end RecursivePotentials
namespace ComparatorModel
open scoped BigOperators
namespace RecursivePotentials
section
noncomputable abbrev leastPair := @_root_.OAI.RecursivePotentials.leastPair
noncomputable abbrev FiniteRootedTree := @_root_.OAI.RecursivePotentials.FiniteRootedTree
namespace FiniteRootedTree
section
variable {ι : Type uIndex} [indexFinite : Fintype ι] [indexDecidable : DecidableEq ι]
(T : FiniteRootedTree ι)
noncomputable abbrev Initial (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.Initial T
end
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
noncomputable abbrev restrict (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.restrict T
noncomputable abbrev extend (H : Finset ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.extend H
noncomputable abbrev head (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.head T
class Heads : Prop where
initial : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) (v : ι →₀ ℝ),
T.Initial (T.head v)
variable [ComparatorModel.RecursivePotentials.FiniteRootedTree.Heads]
noncomputable def P (v : ι →₀ ℝ) : ι →₀ ℝ :=
extend (T.head v) (fun s => ((T.restrict (T.head v) (FiniteRootedTree.Heads.initial T v)).fields
(fun s => v s.1) s).1)
noncomputable def Q (v : ι →₀ ℝ) : ι →₀ ℝ :=
extend (T.head v) (fun s => ((T.restrict (T.head v) (FiniteRootedTree.Heads.initial T v)).fields
(fun s => v s.1) s).2)
noncomputable def normSum (v : ι →₀ ℝ) : ℝ := T.P v T.root + T.Q v T.root
noncomputable abbrev projectHead (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.projectHead T
end FiniteRootedTree
variable [ComparatorModel.RecursivePotentials.FiniteRootedTree.Heads]
def TreeVector {ι : Type uIndex} (_T : FiniteRootedTree ι) := ι →₀ ℝ
namespace TreeVector
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
instance : AddCommGroup (TreeVector T) := inferInstanceAs (AddCommGroup (ι →₀ ℝ))
instance : Module ℝ (TreeVector T) := inferInstanceAs (Module ℝ (ι →₀ ℝ))
instance : CoeFun (TreeVector T) (fun _ => ι → ℝ) := ⟨fun v => (show ι →₀ ℝ from v)⟩
noncomputable instance : Norm (TreeVector T) := ⟨fun v => T.normSum v⟩
class Construction : Prop where
core : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι),
NormedSpace.Core ℝ (TreeVector T)
coordinate_bound : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(v : ι →₀ ℝ) (s : ι), |v s| ≤ T.normSum v
projection_bound : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(H : Finset ι), T.Initial H → ∀ v, T.normSum (T.projectHead H v) ≤ T.normSum v
variable [ComparatorModel.RecursivePotentials.TreeVector.Construction]
noncomputable instance : NormedAddCommGroup (TreeVector T) :=
NormedAddCommGroup.ofCore (TreeVector.Construction.core T)
noncomputable instance : NormedSpace ℝ (TreeVector T) := NormedSpace.ofCore (TreeVector.Construction.core T)
def coordinateLinear (s : ι) : TreeVector T →ₗ[ℝ] ℝ where
toFun v := v s
map_add' _v _w := rfl
map_smul' _a _v := rfl
noncomputable def coordinate (s : ι) : TreeVector T →L[ℝ] ℝ :=
(coordinateLinear T s).mkContinuous 1 (fun v => by
change ‖v s‖ ≤ 1 * T.normSum v
rw [Real.norm_eq_abs, one_mul]
exact TreeVector.Construction.coordinate_bound T v s)
def projectionLinear (H : Finset ι) : TreeVector T →ₗ[ℝ] TreeVector T where
toFun := T.projectHead H
map_add' v w := by
change ι →₀ ℝ at v w
apply Finsupp.ext
intro s
change T.projectHead H (v + w) s = (T.projectHead H v + T.projectHead H w) s
by_cases hs : s ∈ H <;> simp [FiniteRootedTree.projectHead, _root_.OAI.RecursivePotentials.FiniteRootedTree.projectHead, hs]
map_smul' a v := by
change ι →₀ ℝ at v
apply Finsupp.ext
intro s
change T.projectHead H (a • v) s = (a • T.projectHead H v) s
by_cases hs : s ∈ H <;> simp [FiniteRootedTree.projectHead, _root_.OAI.RecursivePotentials.FiniteRootedTree.projectHead, hs]
noncomputable def projection (H : Finset ι) (hH : T.Initial H) :
TreeVector T →L[ℝ] TreeVector T :=
(projectionLinear T H).mkContinuous 1 (fun v => by
change T.normSum (T.projectHead H v) ≤ 1 * T.normSum v
rw [one_mul]
exact TreeVector.Construction.projection_bound T H hH v)
end TreeVector
variable [ComparatorModel.RecursivePotentials.TreeVector.Construction]
abbrev TreeSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) :=
UniformSpace.Completion (TreeVector T)
namespace TreeSpace
open UniformSpace
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
def coordinate (s : ι) : TreeSpace T →L[ℝ] ℝ := (TreeVector.coordinate T s).fromCompletion
def P (s : ι) : TreeSpace T → ℝ :=
Completion.extension (fun v : TreeVector T => T.P v s)
def Q (s : ι) : TreeSpace T → ℝ :=
Completion.extension (fun v : TreeVector T => T.Q v s)
def projection (H : Finset ι) (hH : T.Initial H) : TreeSpace T →L[ℝ] TreeSpace T :=
(TreeVector.projection T H hH).completion
def tail (H : Finset ι) (hH : T.Initial H) : Submodule ℝ (TreeSpace T) :=
(projection T H hH).ker
end TreeSpace
section Moduli
variable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E]
noncomputable abbrev averagedModulus := @_root_.OAI.RecursivePotentials.averagedModulus
end Moduli
noncomputable abbrev sequenceTree := @_root_.OAI.RecursivePotentials.sequenceTree
noncomputable abbrev ComponentNode := @_root_.OAI.RecursivePotentials.ComponentNode
noncomputable abbrev JoinedNode := @_root_.OAI.RecursivePotentials.JoinedNode
noncomputable abbrev joinedTree := @_root_.OAI.RecursivePotentials.joinedTree
abbrev XSigma := TreeSpace sequenceTree
abbrev XJoined := TreeSpace joinedTree
def ZeroTreeVector {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) : Type _ :=
↥((TreeVector.coordinate T T.root).ker)
namespace ZeroTreeVector
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
instance : AddCommGroup (ZeroTreeVector T) :=
inferInstanceAs (AddCommGroup (TreeVector.coordinate T T.root).ker)
instance : Module ℝ (ZeroTreeVector T) :=
inferInstanceAs (Module ℝ (TreeVector.coordinate T T.root).ker)
def toTree : ZeroTreeVector T →ₗ[ℝ] TreeVector T :=
(TreeVector.coordinate T T.root).ker.subtype
instance : Norm (ZeroTreeVector T) := ⟨fun v => T.P (toTree T v) T.root⟩
class Construction : Prop where
core : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι),
NormedSpace.Core ℝ (ZeroTreeVector T)
half : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(v : ZeroTreeVector T), ‖v‖ = ‖toTree T v‖ / 2
variable [ComparatorModel.RecursivePotentials.ZeroTreeVector.Construction]
instance : NormedAddCommGroup (ZeroTreeVector T) := NormedAddCommGroup.ofCore (ZeroTreeVector.Construction.core T)
instance : NormedSpace ℝ (ZeroTreeVector T) := NormedSpace.ofCore (ZeroTreeVector.Construction.core T)
def inclusion : ZeroTreeVector T →L[ℝ] TreeVector T :=
(toTree T).mkContinuous 2 (fun v => by rw [ZeroTreeVector.Construction.half]; exact le_of_eq (by ring))
def projectionLinear (H : Finset ι) (hH : T.Initial H) : ZeroTreeVector T →ₗ[ℝ] ZeroTreeVector T :=
(((TreeVector.projection T H hH).toLinearMap).comp (toTree T)).codRestrict
(TreeVector.coordinate T T.root).ker (fun v => by
change TreeVector.coordinate T T.root (TreeVector.projection T H hH (toTree T v)) = 0
change T.projectHead H (toTree T v) T.root = 0
change (if T.root ∈ H then toTree T v T.root else 0) = 0
rw [ite_eq_left hH.1]
exact v.2)
def projection (H : Finset ι) (hH : T.Initial H) : ZeroTreeVector T →L[ℝ] ZeroTreeVector T :=
(projectionLinear T H hH).mkContinuous 1 (fun v => by
rw [one_mul, ZeroTreeVector.Construction.half, ZeroTreeVector.Construction.half]
exact (div_le_div_iff_of_pos_right (by norm_num : (0 : ℝ) < 2)).mpr
(TreeVector.Construction.projection_bound T H hH (toTree T v)))
end ZeroTreeVector
variable [ComparatorModel.RecursivePotentials.ZeroTreeVector.Construction]
abbrev ZeroTreeSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) :=
UniformSpace.Completion (ZeroTreeVector T)
namespace ZeroTreeSpace
open UniformSpace
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
def inclusion : ZeroTreeSpace T →L[ℝ] TreeSpace T := (ZeroTreeVector.inclusion T).completion
def projection (H : Finset ι) (hH : T.Initial H) : ZeroTreeSpace T →L[ℝ] ZeroTreeSpace T :=
(ZeroTreeVector.projection T H hH).completion
def tail (H : Finset ι) (hH : T.Initial H) : Submodule ℝ (ZeroTreeSpace T) :=
(projection T H hH).ker
end ZeroTreeSpace
abbrev XZero := ZeroTreeSpace joinedTree
section
open UniformSpace
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
def ZeroTreeSpace.coordinate (s : ι) : ZeroTreeSpace T →L[ℝ] ℝ :=
(TreeSpace.coordinate T s).comp (inclusion T)
def ZeroTreeSpace.P (s : ι) (x : ZeroTreeSpace T) : ℝ := TreeSpace.P T s (inclusion T x)
def ZeroTreeSpace.Q (s : ι) (x : ZeroTreeSpace T) : ℝ := TreeSpace.Q T s (inclusion T x)
end
open Filter Topology
noncomputable abbrev WeaklyNull := @_root_.OAI.RecursivePotentials.WeaklyNull
noncomputable abbrev EquivalentNorm := @_root_.OAI.RecursivePotentials.EquivalentNorm
namespace EquivalentNorm
variable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E] (A : EquivalentNorm E)
noncomputable abbrev modulus (A : EquivalentNorm E) := _root_.OAI.RecursivePotentials.EquivalentNorm.modulus A
noncomputable abbrev AUC (A : EquivalentNorm E) := _root_.OAI.RecursivePotentials.EquivalentNorm.AUC A
end EquivalentNorm
open scoped ENNReal
noncomputable abbrev IsReflexive := @_root_.OAI.RecursivePotentials.IsReflexive
namespace SquareSum
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (E : ι → Type uFiber)
[∀ i, NormedAddCommGroup (E i)] [fiberNormedSpace : ∀ i, NormedSpace ℝ (E i)]
noncomputable abbrev Space := @_root_.OAI.RecursivePotentials.SquareSum.Space
end SquareSum
open UniformSpace
noncomputable abbrev completionEquivOfDense := @_root_.OAI.RecursivePotentials.completionEquivOfDense
noncomputable abbrev componentTree := @_root_.OAI.RecursivePotentials.componentTree
noncomputable abbrev logarithmicGamma := @_root_.OAI.RecursivePotentials.logarithmicGamma
open Filter
open scoped Topology
def XJoined_separated_familiesStatement : Prop := ∀ {ε : ℝ} (_hε : 0 < ε),
∃ η : ℝ, 0 < η ∧ η < 1 ∧
(ε ≤ 2 → η = min (1/2) (logarithmicGamma 2 (ε/16))) ∧
∀ (x : XJoined) (z : ℕ → XJoined),
(∀ n, ‖x+z n‖ ≤ 1) → (∀ n, ‖x-z n‖ ≤ 1) →
(∀ i j, i ≠ j → ε ≤ ‖z i-z j‖) → ‖x‖ ≤ 1-η
noncomputable abbrev ChildExponent := @_root_.OAI.RecursivePotentials.ChildExponent
namespace VariableExponent
noncomputable abbrev heightExponent := @_root_.OAI.RecursivePotentials.VariableExponent.heightExponent
noncomputable abbrev cubicConstant := @_root_.OAI.RecursivePotentials.VariableExponent.cubicConstant
noncomputable abbrev sixthConstant := @_root_.OAI.RecursivePotentials.VariableExponent.sixthConstant
end VariableExponent
namespace VariableTree
open FiniteRootedTree
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
noncomputable def P (v : ι →₀ ℝ) : ι →₀ ℝ :=
extend (T.head v) (fun s => ((T.restrict (T.head v) (FiniteRootedTree.Heads.initial T v)).pfields e
(fun s => v s.1) s).1)
noncomputable def Q (v : ι →₀ ℝ) : ι →₀ ℝ :=
extend (T.head v) (fun s => ((T.restrict (T.head v) (FiniteRootedTree.Heads.initial T v)).pfields e
(fun s => v s.1) s).2)
noncomputable def normSum (v : ι →₀ ℝ) : ℝ := P T e v T.root + Q T e v T.root
end VariableTree
def AggregationVector {ι : Type uIndex} (_T : FiniteRootedTree ι) (_e : ChildExponent) := ι →₀ ℝ
namespace AggregationVector
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
instance : AddCommGroup (AggregationVector T e) := inferInstanceAs (AddCommGroup (ι →₀ ℝ))
instance : Module ℝ (AggregationVector T e) := inferInstanceAs (Module ℝ (ι →₀ ℝ))
instance : CoeFun (AggregationVector T e) (fun _ => ι → ℝ) := ⟨fun v => (show ι →₀ ℝ from v)⟩
noncomputable instance : Norm (AggregationVector T e) := ⟨fun v => VariableTree.normSum T e v⟩
class Construction : Prop where
core : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) (e : ChildExponent),
NormedSpace.Core ℝ (AggregationVector T e)
coordinate_bound : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent) (v : ι →₀ ℝ) (s : ι), |v s| ≤ VariableTree.normSum T e v
variable [ComparatorModel.RecursivePotentials.AggregationVector.Construction]
noncomputable instance : NormedAddCommGroup (AggregationVector T e) :=
NormedAddCommGroup.ofCore (AggregationVector.Construction.core T e)
noncomputable instance : NormedSpace ℝ (AggregationVector T e) := NormedSpace.ofCore (AggregationVector.Construction.core T e)
def coordinateLinear (s : ι) : AggregationVector T e →ₗ[ℝ] ℝ where
toFun v := v s
map_add' _v _w := rfl
map_smul' _a _v := rfl
noncomputable def coordinate (s : ι) : AggregationVector T e →L[ℝ] ℝ :=
(coordinateLinear T e s).mkContinuous 1 (fun v => by
change ‖v s‖ ≤ 1 * VariableTree.normSum T e v
rw [Real.norm_eq_abs, one_mul]
exact AggregationVector.Construction.coordinate_bound T e v s)
end AggregationVector
variable [ComparatorModel.RecursivePotentials.AggregationVector.Construction]
abbrev AggregationSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent) :=
UniformSpace.Completion (AggregationVector T e)
namespace AggregationSpace
open UniformSpace
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
def coordinate (s : ι) :
AggregationSpace T e →L[ℝ] ℝ := (AggregationVector.coordinate T e s).fromCompletion
def P (s : ι) : AggregationSpace T e → ℝ :=
Completion.extension (fun v : AggregationVector T e => VariableTree.P T e v s)
def Q (s : ι) : AggregationSpace T e → ℝ :=
Completion.extension (fun v : AggregationVector T e => VariableTree.Q T e v s)
end AggregationSpace
section
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
def AggregationVector.basisVector (s : ι) : AggregationVector T e := Finsupp.single s 1
end
open Filter Topology TopologicalSpace
namespace ChildExponent
instance (e : ChildExponent) : Fact (1 ≤ ENNReal.ofReal e.val) :=
⟨by simpa using ENNReal.ofReal_le_ofReal e.one_le⟩
end ChildExponent
section
open scoped ENNReal
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
abbrev AggregationVector.CoordinateLp (ι : Type uIndex) (e : ChildExponent) := ↥(lp (fun _ : ι => ℝ) (ENNReal.ofReal e.val))
def AggregationVector.toLpLinear : AggregationVector T e →ₗ[ℝ] CoordinateLp ι e :=
Finsupp.lsum ℝ (fun s => lp.lsingle (𝕜 := ℝ) (E := fun _ : ι => ℝ) (ENNReal.ofReal e.val) s)
class AggregationVector.LpConstruction : Prop where
bounds : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent), 1 < e.val →
(∀ c, c ≠ T.root → T.depth c = T.depth (T.parent c) + 1) →
∀ h : ℕ, (∀ s, T.depth s ≤ h) → ∀ v : AggregationVector T e,
‖v‖ ≤ (2*(h+1:ℝ)^(1-1/e.val))*‖toLpLinear T e v‖ ∧
‖toLpLinear T e v‖ ≤ (h+1:ℝ)^(1/e.val)*‖v‖
dense : ∀ {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent), DenseRange (toLpLinear T e)
variable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]
def AggregationVector.toLp (hp : 1 < e.val)
(hstep : ∀ c, c ≠ T.root → T.depth c = T.depth (T.parent c) + 1)
(h : ℕ) (hh : ∀ s, T.depth s ≤ h) : AggregationVector T e →L[ℝ] CoordinateLp ι e :=
(toLpLinear T e).mkContinuous ((h+1:ℝ)^(1/e.val))
(fun v => (LpConstruction.bounds T e hp hstep h hh v).2)
end
section
open AggregationVector
variable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)
(e : ChildExponent)
variable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]
def AggregationSpace.lpEquiv (hp : 1 < e.val)
(hstep : ∀ c, c ≠ T.root → T.depth c = T.depth (T.parent c) + 1)
(h : ℕ) (hh : ∀ s, T.depth s ≤ h) : AggregationSpace T e ≃L[ℝ] CoordinateLp ι e :=
completionEquivOfDense (AggregationVector.toLp T e hp hstep h hh)
⟨2*(h+1:ℝ)^(1-1/e.val),by positivity⟩
(fun v => (AggregationVector.LpConstruction.bounds T e hp hstep h hh v).1)
(AggregationVector.LpConstruction.dense T e)
end
namespace Variable
section
open UniformSpace VariableExponent Filter Topology TopologicalSpace
variable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]
def exponent (h : ℕ+) : ChildExponent := ⟨heightExponent h,(by
dsimp [heightExponent]
have hh : (0 : ℝ) < h.val := by exact_mod_cast h.pos
exact le_add_of_nonneg_right (le_of_lt (one_div_pos.mpr hh)))⟩
abbrev Component (h : ℕ+) := AggregationSpace (componentTree h) (exponent h)
abbrev Xv := SquareSum.Space Component
abbrev Node := Σ h : ℕ+, ComponentNode h
def componentEquiv (h : ℕ+) :
Component h ≃L[ℝ] AggregationVector.CoordinateLp (ComponentNode h) (exponent h) :=
AggregationSpace.lpEquiv (componentTree h) (exponent h) (by
dsimp [exponent, heightExponent]
have hh : (0 : ℝ) < h.val := by exact_mod_cast h.pos
exact lt_add_of_pos_right _ (one_div_pos.mpr hh))
(by
intro c hc
change c.1.length = c.1.dropLast.length + 1
rw [List.length_dropLast]
have hp := List.length_pos_iff_ne_nil.mpr (show c.1 ≠ [] from fun he => hc (Subtype.ext he))
omega) h.val (fun c => c.2)
def componentCoordinate (h : ℕ+) (s : ComponentNode h) : Component h →L[ℝ] ℝ :=
AggregationSpace.coordinate (componentTree h) (exponent h) s
def coordinate (s : Node) : Xv →L[ℝ] ℝ :=
(componentCoordinate s.1 s.2).comp (lp.evalCLM ℝ Component 2 s.1)
def basis (s : Node) : Xv := lp.single 2 s.1
((AggregationVector.basisVector (componentTree s.1) (exponent s.1) s.2 : AggregationVector (componentTree s.1) (exponent s.1)) : Component s.1)
def FiniteTotalSupport (x : Xv) : Prop := ∃ S : Finset Node, ∀ s ∉ S, coordinate s x = 0
def projection (S : Finset Node) : Xv →L[ℝ] Xv := ∑ s ∈ S, (coordinate s).smulRight (basis s)
def AdmissibleHeads (x y : Xv) (A : ∀ h, Finset (ComponentNode h)) : Prop :=
∀ h, x h ≠ 0 → (componentTree h).Initial (A h) ∧
(∀ s ∉ A h, componentCoordinate h s (x h) = 0) ∧
(∀ s ∈ A h, componentCoordinate h s (y h) = 0)
def cubic_stabilityStatement : Prop := ∀ (x y : Xv) (_hx : FiniteTotalSupport x) (A : ∀ h, Finset (ComponentNode h))
(_hA : AdmissibleHeads x y A) {R : ℝ} (_hR : 0 < R) (_hp : ‖x+y‖ ≤ R) (_hm : ‖x-y‖ ≤ R),
‖x‖^2+cubicConstant/(2*Real.sqrt 2*R)*‖y‖^3 ≤ R^2
def sixth_stabilityStatement : Prop := ∀ (x y : Xv) (_hx : FiniteTotalSupport x) (A : ∀ h, Finset (ComponentNode h))
(_hA : AdmissibleHeads x y A),
sixthConstant*‖y‖^6/(‖x+y‖^2+‖x-y‖^2)^2 ≤ ‖x+y‖^2+‖x-y‖^2-2*‖x‖^2
open UniformSpace VariableExponent Filter Topology TopologicalSpace
def weakTailConstant : ℝ := cubicConstant/(2*Real.sqrt 2)
def theta (ε : ℝ) : ℝ := Real.sqrt (1-weakTailConstant*ε^3)
def weak_tailStatement : Prop := ∀ (x : Xv) {ε : ℝ} (_hε : 0 < ε) (_hε1 : ε ≤ 1)
(y : ℕ → Xv) (_hy : WeaklyNull y) (_hyε : ∀ j, ε ≤ ‖y j‖)
(_hp : ∀ j, ‖x+y j‖ ≤ 1) (_hm : ∀ j, ‖x-y j‖ ≤ 1),
‖x‖ ≤ theta ε ∧ theta ε < 1
end
open UniformSpace VariableExponent Filter Topology
variable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]
def one_sided_modulus_zeroStatement : Prop := ∀ (A : EquivalentNorm Xv),
A.modulus (A.lower/A.upper) = 0
def no_equivalent_AUCStatement : Prop := ∀ (A : EquivalentNorm Xv),
¬A.AUC
end Variable
variable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]
structure RootSumCompletionStatement {ι : Type uIndex} [DecidableEq ι]
(T : FiniteRootedTree ι) : Prop where
complete : CompleteSpace (TreeSpace T)
infinite_dimensional : ¬Module.Finite ℝ (TreeSpace T)
coordinate_continuous : ∀ s, Continuous (TreeSpace.coordinate T s)
coordinate_extends : ∀ s (v : TreeVector T), TreeSpace.coordinate T s (v : TreeSpace T) = v s
fields_continuous : ∀ s, Continuous (TreeSpace.P T s) ∧ Continuous (TreeSpace.Q T s)
fields_extend : ∀ s (v : TreeVector T),
TreeSpace.P T s (v : TreeSpace T) = T.P v s ∧ TreeSpace.Q T s (v : TreeSpace T) = T.Q v s
root_formula : ∀ x : TreeSpace T, ‖x‖ = TreeSpace.P T T.root x + TreeSpace.Q T T.root x
projections : ∀ (H : Finset ι) (hH : T.Initial H),
(∀ x : TreeSpace T, ‖TreeSpace.projection T H hH x‖ ≤ ‖x‖) ∧
(∀ x : TreeSpace T, TreeSpace.projection T H hH (TreeSpace.projection T H hH x) = TreeSpace.projection T H hH x) ∧
(∀ (s : ι) (x : TreeSpace T), TreeSpace.coordinate T s (TreeSpace.projection T H hH x) =
if s ∈ H then TreeSpace.coordinate T s x else 0) ∧
FiniteDimensional ℝ (TreeSpace.projection T H hH).range ∧
IsClosed (TreeSpace.tail T H hH : Set (TreeSpace T)) ∧
Module.Finite ℝ (TreeSpace T ⧸ TreeSpace.tail T H hH) ∧
∀ x ∈ TreeSpace.tail T H hH, ∀ ε : ℝ, 0 < ε →
∃ v : TreeVector T, TreeVector.projection T H hH v = 0 ∧ ‖(v : TreeSpace T)-x‖ < ε
structure ZeroRootCompletionStatement {ι : Type uIndex} [DecidableEq ι]
(T : FiniteRootedTree ι) : Prop where
complete : CompleteSpace (ZeroTreeSpace T)
infinite_dimensional : ¬Module.Finite ℝ (ZeroTreeSpace T)
coordinate_continuous : ∀ s, Continuous (ZeroTreeSpace.coordinate T s)
coordinate_extends : ∀ s (v : ZeroTreeVector T),
ZeroTreeSpace.coordinate T s (v : ZeroTreeSpace T) = ZeroTreeVector.toTree T v s
fields_continuous : ∀ s, Continuous (ZeroTreeSpace.P T s) ∧ Continuous (ZeroTreeSpace.Q T s)
fields_extend : ∀ s (v : ZeroTreeVector T),
ZeroTreeSpace.P T s (v : ZeroTreeSpace T) = T.P (ZeroTreeVector.toTree T v) s ∧
ZeroTreeSpace.Q T s (v : ZeroTreeSpace T) = T.Q (ZeroTreeVector.toTree T v) s
root_fixed : ∀ x : ZeroTreeSpace T, ZeroTreeSpace.coordinate T T.root x = 0
root_formula : ∀ x : ZeroTreeSpace T, ‖x‖ = ZeroTreeSpace.P T T.root x ∧ ‖x‖ = ZeroTreeSpace.Q T T.root x
projections : ∀ (H : Finset ι) (hH : T.Initial H),
(∀ x : ZeroTreeSpace T, ‖ZeroTreeSpace.projection T H hH x‖ ≤ ‖x‖) ∧
(∀ x : ZeroTreeSpace T, ZeroTreeSpace.projection T H hH (ZeroTreeSpace.projection T H hH x) = ZeroTreeSpace.projection T H hH x) ∧
(∀ (s : ι) (x : ZeroTreeSpace T), ZeroTreeSpace.coordinate T s (ZeroTreeSpace.projection T H hH x) =
if s ∈ H then ZeroTreeSpace.coordinate T s x else 0) ∧
FiniteDimensional ℝ (ZeroTreeSpace.projection T H hH).range ∧
IsClosed (ZeroTreeSpace.tail T H hH : Set (ZeroTreeSpace T)) ∧
Module.Finite ℝ (ZeroTreeSpace T ⧸ ZeroTreeSpace.tail T H hH) ∧
∀ x ∈ ZeroTreeSpace.tail T H hH, ∀ ε : ℝ, 0 < ε →
∃ v : ZeroTreeVector T, ZeroTreeVector.projection T H hH v = 0 ∧ ‖(v : ZeroTreeSpace T)-x‖ < ε
def rec_completionStatement : Prop := RootSumCompletionStatement sequenceTree ∧
ZeroRootCompletionStatement joinedTree ∧ RootSumCompletionStatement joinedTree ∧
IsReflexive XZero ∧ IsReflexive XJoined
def rec_mainStatement : Prop := (∀ t : ℝ, 0 < t → t < 1 → t^3/128 ≤ averagedModulus XSigma t ∧ t^3/128 ≤ averagedModulus XJoined t) ∧
(∀ (H : Finset JoinedNode), joinedTree.Initial H → ∀ x : XZero,
(∀ s ∉ H, ZeroTreeSpace.coordinate joinedTree s x = 0) → ∀ z : XZero,
(∀ s ∈ H, ZeroTreeSpace.coordinate joinedTree s z = 0) → z ≠ 0 →
(‖x+z‖+‖x-z‖)/2 ≥ ‖x‖+‖z‖^3/(8*(2*‖x‖+‖z‖)^2)) ∧
(∀ A : EquivalentNorm XSigma, ¬A.AUC) ∧
(∀ A : EquivalentNorm XZero, ¬A.AUC) ∧
(∀ A : EquivalentNorm XJoined, ¬A.AUC)
def stop_all_radiiStatement : Prop := ∀ {t : ℝ} (_ht : 0 < t),
0 < averagedModulus XSigma t
open VariableExponent
def Variable.nu (h : ℕ+) (v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h)) : ℝ :=
AggregationSpace.P (componentTree h) (exponent h) (componentTree h).root ((componentEquiv h).symm v) +
AggregationSpace.Q (componentTree h) (exponent h) (componentTree h).root ((componentEquiv h).symm v)
structure Variable.SourceNormStatement (h : ℕ+) : Prop where
nonneg : ∀ v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h), 0 ≤ nu h v
definite : ∀ v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h), nu h v = 0 ↔ v = 0
triangle : ∀ v w : AggregationVector.CoordinateLp (ComponentNode h) (exponent h),
nu h (v+w) ≤ nu h v + nu h w
homogeneous : ∀ (a : ℝ) (v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h)),
nu h (a • v) = |a| * nu h v
def Variable.spaceStatement : Prop := (∀ h : ℕ+, CompleteSpace (Component h) ∧ IsReflexive (Component h) ∧
SeparableSpace (Component h →L[ℝ] ℝ) ∧ SourceNormStatement h ∧
∀ v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h),
(h.val+1:ℝ)^(-1/heightExponent h)*‖v‖ ≤ nu h v ∧
nu h v ≤ 2*(h.val+1:ℝ)^(1-1/heightExponent h)*‖v‖) ∧
CompleteSpace Xv ∧ IsReflexive Xv ∧ SeparableSpace (Xv →L[ℝ] ℝ) ∧
Dense {x : Xv | FiniteTotalSupport x} ∧
∀ S : Finset Node, Continuous (projection S) ∧ FiniteDimensional ℝ (projection S).range ∧
(∀ x : Xv, projection S (projection S x) = projection S x) ∧
∀ (s : Node) (x : Xv), coordinate s (projection S x) = if s ∈ S then coordinate s x else 0
def Variable.aggregateChildren (h : ℕ+) (s : ComponentNode h) (f : ComponentNode h → ℝ) : ℝ :=
(∑' c, if c ≠ (componentTree h).root ∧ (componentTree h).parent c = s then
f c ^ heightExponent h else 0) ^ (1/heightExponent h)
def Variable.lpPotentials (h : ℕ+) (v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h))
(s : ComponentNode h) : ℝ × ℝ :=
(AggregationSpace.P (componentTree h) (exponent h) s ((componentEquiv h).symm v),
AggregationSpace.Q (componentTree h) (exponent h) s ((componentEquiv h).symm v))
def Variable.lp_model_exactStatement : Prop := ∀ (h : ℕ+)
(v : AggregationVector.CoordinateLp (ComponentNode h) (exponent h))
(f : ComponentNode h → ℝ × ℝ)
(_hf : ∀ s, f s = leastPair (v s)
(aggregateChildren h s (fun c => (f c).1))
(aggregateChildren h s (fun c => (f c).2))),
f = lpPotentials h v ∧ nu h v = (f (componentTree h).root).1+(f (componentTree h).root).2
end
def MainClaim : Prop :=
∃ h0 : FiniteRootedTree.Heads.{0}, letI := h0;
∃ h1 : TreeVector.Construction.{0}, letI := h1;
∃ h2 : ZeroTreeVector.Construction.{0}, letI := h2;
∃ h3 : AggregationVector.Construction.{0}, letI := h3;
∃ h4 : AggregationVector.LpConstruction.{0}, letI := h4;
rec_mainStatement ∧
rec_completionStatement ∧
stop_all_radiiStatement ∧
XJoined_separated_familiesStatement ∧
Variable.spaceStatement ∧
Variable.lp_model_exactStatement ∧
Variable.one_sided_modulus_zeroStatement ∧
Variable.no_equivalent_AUCStatement ∧
Variable.sixth_stabilityStatement ∧
Variable.cubic_stabilityStatement ∧
Variable.weak_tailStatement
theorem main : MainClaim := by
sorry
end RecursivePotentials
end ComparatorModel
end
end OAI

Xet Storage Details

Size:
37.7 kB
·
Xet hash:
71b48f81389160d5af93a819fde85a18bda3279a7db43eda8eb2e35f85192864

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.