import Mathlib import OAI.MeasureTheory.Falconer.Model import OAI.MeasureTheory.Falconer.Recursion.PolicyDescriptors import OAI.MeasureTheory.FalconerCompletion.Angular.SymbolMulDerivativeBound import OAI.MeasureTheory.FalconerCompletion.Recursion.PolicyAngular namespace OAI /-! Recursive policies and quantitative depth estimates. -/ open _root_.OAI.PlanarFalconer section section open Set MeasureTheory open scoped ComplexConjugate RealInnerProductSpace namespace GraphLiteralSupport namespace CurrentFalconer.TreeND open Set Metric MeasureTheory PlanarFalconer Filter open scoped ENNReal RealInnerProductSpace ContDiff Topology Classical variable {d : ℕ} noncomputable def actualSourceSymbol (A : ℕ → ℝ) (N q a t : ℕ) (L : PolicyDescriptor → List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) (f : EuclideanSpace ℝ (Fin d) → ℂ) (Q : SmoothFunctionND (EuclideanSpace ℝ (Fin d))) (x : EuclideanSpace ℝ (Fin d)) : SmoothFunctionND (EuclideanSpace ℝ (Fin d)) := ⟨fun w => f x*(Q.1 w*(actualPolicyAngular A N q a t L ρ m sig C J i x).1 w), contDiff_const.mul ((show ContDiff ℝ ∞ Q.1 from Q.2).mul (show ContDiff ℝ ∞ (actualPolicyAngular A N q a t L ρ m sig C J i x).1 from (actualPolicyAngular A N q a t L ρ m sig C J i x).2))⟩ lemma actualSourceSymbol_measurable (A : ℕ → ℝ) (N q a t : ℕ) (L : PolicyDescriptor → List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) (f : EuclideanSpace ℝ (Fin d) → ℂ) (hf : Measurable f) (Q : SmoothFunctionND (EuclideanSpace ℝ (Fin d))) : Measurable (fun z : EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin d) => (actualSourceSymbol A N q a t L ρ m sig C J i f Q z.1).1 z.2) := by exact (hf.comp measurable_fst).mul (((show ContDiff ℝ ∞ Q.1 from Q.2).continuous.measurable.comp measurable_snd).mul (actualPolicyAngular_measurable A N q a t L ρ m sig C J i)) lemma actualSourceSymbol_support (A : ℕ → ℝ) (N q a t : ℕ) (L : PolicyDescriptor → List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) (f : EuclideanSpace ℝ (Fin d) → ℂ) (Q : SmoothFunctionND (EuclideanSpace ℝ (Fin d))) (k : ℕ) (x : EuclideanSpace ℝ (Fin d)) : tsupport (iteratedFDeriv ℝ k (actualSourceSymbol A N q a t L ρ m sig C J i f Q x).1) ⊆ tsupport (actualPolicyAngular A N q a t L ρ m sig C J i x).1 := (tsupport_iteratedFDeriv_subset k).trans (tsupport_mul_subset_right.trans tsupport_mul_subset_right) noncomputable def actualPolicyAmbientGood (A : ℕ → ℝ) (N q a t : ℕ) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) (x : EuclideanSpace ℝ (Fin d)) : Set (EuclideanSpace ℝ (Fin d)) := {w | ‖w‖≠1 ∨ ∀ b∈policyDescriptorList A N q a t, (x,w)∈endpointGood ρ m N sig C J i b} lemma actualPolicyAmbientGood_even (A : ℕ → ℝ) (N q a t : ℕ) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) (x : EuclideanSpace ℝ (Fin d)) {w : EuclideanSpace ℝ (Fin d)} (hw : w∈actualPolicyAmbientGood A N q a t ρ m sig C J i x) : -w∈actualPolicyAmbientGood A N q a t ρ m sig C J i x := by rcases hw with hn | hg · exact Or.inl (by simpa only [norm_neg] using hn) · right intro b hb P hP hx exact descriptorGood_neg ρ m N sig C J i P b (hg b hb P hP hx) lemma actualPolicyAmbientGood_measurable (A : ℕ → ℝ) (N q a t : ℕ) (ρ : Measure (EuclideanSpace ℝ (Fin d))) [IsFiniteMeasure ρ] (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) : MeasurableSet {z : EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin d) | z.2∈actualPolicyAmbientGood A N q a t ρ m sig C J i z.1} := by change MeasurableSet ({z | ‖z.2‖≠1} ∪ {z | ∀ b∈policyDescriptorList A N q a t, z∈endpointGood ρ m N sig C J i b}) refine ((measurable_snd.norm (measurableSet_singleton 1)).compl).union ?_ simp only [ofPred_forall] exact Finset.measurableSet_biInter _ (fun b hb => measurable_endpointGood ρ m N sig C J i b) lemma uniform_actualSourceSymbol_support {sig : ℝ} (hsig : 0 (hQ k (hk.trans hj) w hw).trans (le_mul_of_one_le_right hCq (one_le_pow₀ hscale))) (fun k hk => hDb A q a t hq L ρ m C J i hL htotal x k (hk.trans hj) w hw) have hh := symbol_const_mul_derivative_boundND (smoothMulND Q Z) (f x) (hf x) j w apply hh.trans (hb.trans ?_) rw [mul_pow] change Cq*D^total*(2^j*scale^j) ≤ Cq*D^total*2^M*scale^j rw [mul_assoc (Cq*D^total) (2^M)] exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num : (1:ℝ)≤2) hj) (pow_nonneg (zero_le_one.trans hscale) j)) (mul_nonneg hCq (pow_nonneg (zero_le_one.trans hD) total)) end CurrentFalconer.TreeND end GraphLiteralSupport end end section section open Set MeasureTheory open scoped ComplexConjugate RealInnerProductSpace namespace GraphLiteralSupport namespace CurrentFalconer.TreeND open Set Metric MeasureTheory PlanarFalconer open scoped ENNReal RealInnerProductSpace ContDiff Topology Classical variable {d : ℕ} lemma actualEndpointSmooth_reached (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (N : ℕ) (sig C : ℝ) (J i : ℕ) (b : PolicyDescriptor) {P : CellPath d} (ha : descriptorAnchor b ≤ P.length) {x y : EuclideanSpace ℝ (Fin d)} (hx : x∈treeCell P) (hy : y∈treeCell P) : actualEndpointSmooth ρ m N sig C J i b x = actualEndpointSmooth ρ m N sig C J i b y := by have hP : P.take (descriptorAnchor b) ∈ dyadicPaths (descriptorAnchor b) := by simp only [mem_dyadicPaths,List.length_take,Nat.min_eq_left ha] rw [actualEndpointSmooth_of_mem ρ m N sig C J i b hP (treeCell_subset_take P _ hx), actualEndpointSmooth_of_mem ρ m N sig C J i b hP (treeCell_subset_take P _ hy)] lemma actualEndpointAngular_reached (L : List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (N : ℕ) (sig C : ℝ) (J i : ℕ) (b : PolicyDescriptor) {P : CellPath d} (ha : descriptorAnchor b ≤ P.length) {x y : EuclideanSpace ℝ (Fin d)} (hx : x∈treeCell P) (hy : y∈treeCell P) : actualEndpointAngular L ρ m N sig C J i b x = actualEndpointAngular L ρ m N sig C J i b y := by unfold actualEndpointAngular rw [actualEndpointSmooth_reached ρ m N sig C J i b ha hx hy] lemma actualAngularProduct_reached {ι : Type*} [DecidableEq ι] (S : Finset ι) (b : ι → PolicyDescriptor) (L : ι → List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (N : ℕ) (sig C : ℝ) (J i : ℕ) {P : CellPath d} (ha : ∀ e∈S, descriptorAnchor (b e) ≤ P.length) {x y : EuclideanSpace ℝ (Fin d)} (hx : x∈treeCell P) (hy : y∈treeCell P) : actualAngularProduct S b L ρ m N sig C J i x = actualAngularProduct S b L ρ m N sig C J i y := by apply Subtype.ext funext w apply Finset.prod_congr rfl intro e he exact congrArg (fun f : SmoothFunctionND (EuclideanSpace ℝ (Fin d)) => f.1 w) (actualEndpointAngular_reached (L e) ρ m N sig C J i (b e) (ha e he) hx hy) noncomputable def reachedDescriptorList (A : ℕ → ℝ) (N q a t r : ℕ) : Finset PolicyDescriptor := (policyDescriptorList A N q a t).filter (fun b => descriptorAnchor b≤r) noncomputable def unreachedDescriptorList (A : ℕ → ℝ) (N q a t r : ℕ) : Finset PolicyDescriptor := (policyDescriptorList A N q a t).filter (fun b => r descriptorAnchor b≤r) (fun b => (actualEndpointAngular (L b) ρ m N sig C J i b x).1 w)).symm lemma reachedSymbol_constant_on_cell (A : ℕ → ℝ) (N q a t : ℕ) (L : PolicyDescriptor → List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d))) (ρ : Measure (EuclideanSpace ℝ (Fin d))) (m : ℝ → ℝ) (sig C : ℝ) (J i : ℕ) {P : CellPath d} {x y : EuclideanSpace ℝ (Fin d)} (hx : x∈treeCell P) (hy : y∈treeCell P) : actualAngularProduct (reachedDescriptorList A N q a t P.length) id L ρ m N sig C J i x = actualAngularProduct (reachedDescriptorList A N q a t P.length) id L ρ m N sig C J i y := actualAngularProduct_reached _ _ _ _ _ _ _ _ _ _ (fun _ hb => (Finset.mem_filter.mp hb).2) hx hy lemma uniform_reachedSymbol_bound (W : Finset (List (EuclideanSpace ℝ (Fin d) →L[ℝ] EuclideanSpace ℝ (Fin d)))) (B total : ℕ) (hW : ∀ L∈W, L.length≤B) (sig : ℝ) (hsig : 0 hL b (hsub hb)) hsum (fun b hb => Finset.le_sup (f:=descriptorLength) (hsub hb)) x 0 le_rfl w hw simpa only [norm_iteratedFDeriv_zero,pow_zero,mul_one] using hh end CurrentFalconer.TreeND end GraphLiteralSupport end end end OAI