import Mathlibnamespace OAInoncomputable 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 uFiberopen scoped BigOperatorsnamespace RecursivePotentialsdef 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 inamespace FiniteRootedTreesectionvariable {ι : Type uIndex} [indexFinite : Fintype ι] [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)def children (s : ι) : Finset ι := Finset.univ.filter fun c => c ≠ T.root ∧ T.parent c = sdef maxDepth : ℕ := Finset.univ.sup T.depthnoncomputable 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 sdecreasing_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) omegadef Initial (H : Finset ι) : Prop := T.root ∈ H ∧ ∀ s ∈ H, T.parent s ∈ Hendvariable {ι : 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 sdecreasing_by exact T.parent_depth s _hsdef 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.supportdef projectHead (_T : FiniteRootedTree ι) (H : Finset ι) (v : ι →₀ ℝ) : ι →₀ ℝ := v.filter (· ∈ H)end FiniteRootedTreestructure CofiniteSubspace (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E] where space : Submodule ℝ E closed : IsClosed (space : Set E) finiteQuotient : Module.Finite ℝ (E ⧸ space)section Modulivariable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E]noncomputable def averagedGain (x : E) (t : ℝ) (y : E) : ℝ := (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1noncomputable 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 Modulidef 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 omegaabbrev 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 omegaopen Filter Topologydef 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 EquivalentNormvariable {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 tend EquivalentNormopen scoped ENNRealdef IsReflexive (E : Type uSpace) [NormedAddCommGroup E] [NormedSpace ℝ E] : Prop := Function.Surjective (NormedSpace.inclusionInDoubleDual ℝ E)namespace SquareSumvariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (E : ι → Type uFiber) [∀ i, NormedAddCommGroup (E i)] [fiberNormedSpace : ∀ i, NormedSpace ℝ (E i)]abbrev Space : Type _ := ↥(lp E 2)end SquareSumopen UniformSpacedef 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 omegadef 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 Filteropen scoped Topologystructure ChildExponent where val : ℝ one_le : 1 ≤ valnamespace ChildExponentvariable (p : ChildExponent)def agg {ι : Type uIndex} (s : Finset ι) (f : ι → ℝ) : ℝ := (∑ i ∈ s, |f i| ^ p.val) ^ (1 / p.val)end ChildExponentsectionvariable {ι : 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 sdecreasing_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) omegaendnamespace VariableExponentdef heightExponent (h : ℕ+) : ℝ := 1 + 1 / (h.val : ℝ)def cubicConstant : ℝ := (6 * Real.exp 1)⁻¹ ^ 3def sixthConstant : ℝ := 2 * Real.exp (-(Real.exp 1 - 1)) * (4 : ℝ)⁻¹ ^ 6end VariableExponentopen Filter Topology TopologicalSpaceend RecursivePotentialsnamespace ComparatorModelopen scoped BigOperatorsnamespace RecursivePotentialssectionnoncomputable abbrev leastPair := @_root_.OAI.RecursivePotentials.leastPairnoncomputable abbrev FiniteRootedTree := @_root_.OAI.RecursivePotentials.FiniteRootedTreenamespace FiniteRootedTreesectionvariable {ι : Type uIndex} [indexFinite : Fintype ι] [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)noncomputable abbrev Initial (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.Initial Tendvariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)noncomputable abbrev restrict (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.restrict Tnoncomputable abbrev extend (H : Finset ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.extend Hnoncomputable abbrev head (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.head Tclass 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.rootnoncomputable abbrev projectHead (T : FiniteRootedTree ι) := _root_.OAI.RecursivePotentials.FiniteRootedTree.projectHead Tend FiniteRootedTreevariable [ComparatorModel.RecursivePotentials.FiniteRootedTree.Heads]def TreeVector {ι : Type uIndex} (_T : FiniteRootedTree ι) := ι →₀ ℝnamespace TreeVectorvariable {ι : 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 vvariable [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 := rflnoncomputable 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 TreeVectorvariable [ComparatorModel.RecursivePotentials.TreeVector.Construction]abbrev TreeSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) := UniformSpace.Completion (TreeVector T)namespace TreeSpaceopen UniformSpacevariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)def coordinate (s : ι) : TreeSpace T →L[ℝ] ℝ := (TreeVector.coordinate T s).fromCompletiondef 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).completiondef tail (H : Finset ι) (hH : T.Initial H) : Submodule ℝ (TreeSpace T) := (projection T H hH).kerend TreeSpacesection Modulivariable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E]noncomputable abbrev averagedModulus := @_root_.OAI.RecursivePotentials.averagedModulusend Modulinoncomputable abbrev sequenceTree := @_root_.OAI.RecursivePotentials.sequenceTreenoncomputable abbrev ComponentNode := @_root_.OAI.RecursivePotentials.ComponentNodenoncomputable abbrev JoinedNode := @_root_.OAI.RecursivePotentials.JoinedNodenoncomputable abbrev joinedTree := @_root_.OAI.RecursivePotentials.joinedTreeabbrev XSigma := TreeSpace sequenceTreeabbrev XJoined := TreeSpace joinedTreedef ZeroTreeVector {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) : Type _ := ↥((TreeVector.coordinate T T.root).ker)namespace ZeroTreeVectorvariable {ι : 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.subtypeinstance : 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‖ / 2variable [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 ZeroTreeVectorvariable [ComparatorModel.RecursivePotentials.ZeroTreeVector.Construction]abbrev ZeroTreeSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) := UniformSpace.Completion (ZeroTreeVector T)namespace ZeroTreeSpaceopen UniformSpacevariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι)def inclusion : ZeroTreeSpace T →L[ℝ] TreeSpace T := (ZeroTreeVector.inclusion T).completiondef projection (H : Finset ι) (hH : T.Initial H) : ZeroTreeSpace T →L[ℝ] ZeroTreeSpace T := (ZeroTreeVector.projection T H hH).completiondef tail (H : Finset ι) (hH : T.Initial H) : Submodule ℝ (ZeroTreeSpace T) := (projection T H hH).kerend ZeroTreeSpaceabbrev XZero := ZeroTreeSpace joinedTreesectionopen UniformSpacevariable {ι : 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)endopen Filter Topologynoncomputable abbrev WeaklyNull := @_root_.OAI.RecursivePotentials.WeaklyNullnoncomputable abbrev EquivalentNorm := @_root_.OAI.RecursivePotentials.EquivalentNormnamespace EquivalentNormvariable {E : Type uSpace} [NormedAddCommGroup E] [NormedSpace ℝ E] (A : EquivalentNorm E)noncomputable abbrev modulus (A : EquivalentNorm E) := _root_.OAI.RecursivePotentials.EquivalentNorm.modulus Anoncomputable abbrev AUC (A : EquivalentNorm E) := _root_.OAI.RecursivePotentials.EquivalentNorm.AUC Aend EquivalentNormopen scoped ENNRealnoncomputable abbrev IsReflexive := @_root_.OAI.RecursivePotentials.IsReflexivenamespace SquareSumvariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (E : ι → Type uFiber) [∀ i, NormedAddCommGroup (E i)] [fiberNormedSpace : ∀ i, NormedSpace ℝ (E i)]noncomputable abbrev Space := @_root_.OAI.RecursivePotentials.SquareSum.Spaceend SquareSumopen UniformSpacenoncomputable abbrev completionEquivOfDense := @_root_.OAI.RecursivePotentials.completionEquivOfDensenoncomputable abbrev componentTree := @_root_.OAI.RecursivePotentials.componentTreenoncomputable abbrev logarithmicGamma := @_root_.OAI.RecursivePotentials.logarithmicGammaopen Filteropen scoped Topologydef 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.ChildExponentnamespace VariableExponentnoncomputable abbrev heightExponent := @_root_.OAI.RecursivePotentials.VariableExponent.heightExponentnoncomputable abbrev cubicConstant := @_root_.OAI.RecursivePotentials.VariableExponent.cubicConstantnoncomputable abbrev sixthConstant := @_root_.OAI.RecursivePotentials.VariableExponent.sixthConstantend VariableExponentnamespace VariableTreeopen FiniteRootedTreevariable {ι : 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.rootend VariableTreedef AggregationVector {ι : Type uIndex} (_T : FiniteRootedTree ι) (_e : ChildExponent) := ι →₀ ℝnamespace AggregationVectorvariable {ι : 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 vvariable [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 := rflnoncomputable 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 AggregationVectorvariable [ComparatorModel.RecursivePotentials.AggregationVector.Construction]abbrev AggregationSpace {ι : Type uIndex} [DecidableEq ι] (T : FiniteRootedTree ι) (e : ChildExponent) := UniformSpace.Completion (AggregationVector T e)namespace AggregationSpaceopen UniformSpacevariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι) (e : ChildExponent)def coordinate (s : ι) : AggregationSpace T e →L[ℝ] ℝ := (AggregationVector.coordinate T e s).fromCompletiondef 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 AggregationSpacesectionvariable {ι : Type uIndex} [indexDecidable : DecidableEq ι] (T : FiniteRootedTree ι) (e : ChildExponent)def AggregationVector.basisVector (s : ι) : AggregationVector T e := Finsupp.single s 1endopen Filter Topology TopologicalSpacenamespace ChildExponentinstance (e : ChildExponent) : Fact (1 ≤ ENNReal.ofReal e.val) := ⟨by simpa using ENNReal.ofReal_le_ofReal e.one_le⟩end ChildExponentsectionopen scoped ENNRealvariable {ι : 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)endsectionopen AggregationVectorvariable {ι : 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)endnamespace Variablesectionopen UniformSpace VariableExponent Filter Topology TopologicalSpacevariable [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 Componentabbrev Node := Σ h : ℕ+, ComponentNode hdef 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) sdef 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 = 0def 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^2def 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‖^2open UniformSpace VariableExponent Filter Topology TopologicalSpacedef 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 ε < 1endopen UniformSpace VariableExponent Filter Topologyvariable [ComparatorModel.RecursivePotentials.AggregationVector.LpConstruction]def one_sided_modulus_zeroStatement : Prop := ∀ (A : EquivalentNorm Xv), A.modulus (A.lower/A.upper) = 0def no_equivalent_AUCStatement : Prop := ∀ (A : EquivalentNorm Xv), ¬A.AUCend Variablevariable [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 XJoineddef 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 topen VariableExponentdef 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 vdef 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 0def 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).2enddef 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_tailStatementtheorem main : MainClaim := by sorryend RecursivePotentialsend ComparatorModelendend OAI