math / data /lean /OAI /Probability /LatticeSurface /Dynamics /ProjectionMesh.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.21 kB
import Mathlib
import OAI.Probability.LatticeSurface.Convexity.KernelRestriction
import OAI.Probability.LatticeSurface.Dynamics.ProjectionTail
import OAI.Probability.LatticeSurface.Dynamics.TwoStageDynamics
namespace OAI
namespace ProjectionComparison
open Set ClusterDisplacement
attribute [local instance] Classical.propDecidable
variable {V E : Type*} [Fintype V] [Fintype E]
noncomputable def meshTail (S : System V E) (bβ‚€ b₁ hβ‚€ h₁ : V β†’ ℝ)
(hhβ‚€ : hβ‚€βˆˆfeasible S bβ‚€) (hh₁ : hβ‚βˆˆfeasible S b₁)
(increments : β„• β†’ V β†’ ℝ) (a : ℝ) (n : β„•) (x : {x // xβˆ‰S.pins}) : ℝ :=
max (recursion S b₁ ⟨h₁,hhβ‚βŸ© h₁ increments n x-
recursion S bβ‚€ ⟨hβ‚€,hhβ‚€βŸ© hβ‚€ increments n x-a) 0
end ProjectionComparison
namespace ProjectionComparison
open Set ClusterDisplacement
attribute [local instance] Classical.propDecidable
variable {V E : Type*} [Fintype V] [Fintype E]
omit [Fintype E] in
lemma recursion_feasible (S : System V E) (b hβ‚€ : V β†’ ℝ) (hhβ‚€ : hβ‚€βˆˆfeasible S b)
(increments : β„• β†’ V β†’ ℝ) (n : β„•) : recursion S b ⟨hβ‚€,hhβ‚€βŸ© hβ‚€ increments n∈feasible S b := by
cases n with
| zero => exact hhβ‚€
| succ n => exact (project_spec S b ⟨hβ‚€,hhβ‚€βŸ© _).1
lemma mesh_tail_step (S : System V E) (bβ‚€ b₁ hβ‚€ h₁ : V β†’ ℝ)
(hhβ‚€ : hβ‚€βˆˆfeasible S bβ‚€) (hh₁ : hβ‚βˆˆfeasible S b₁)
(increments : β„• β†’ V β†’ ℝ) (a : ℝ) (hb : βˆ€x∈S.pins,b₁ x-bβ‚€ x≀a) (n : β„•) :
βˆƒ A B : Kernel {x // xβˆ‰S.pins},Firm A ∧ Firm B ∧
meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a (n+1)=
B.apply (A.apply (meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a n)) := by
classical
let fβ‚€ := recursion S bβ‚€ ⟨hβ‚€,hhβ‚€βŸ© hβ‚€ increments n
let f₁ := recursion S b₁ ⟨h₁,hhβ‚βŸ© h₁ increments n
let vβ‚€ : V β†’ ℝ := fun x => fβ‚€ x+increments n x
let v₁ : V β†’ ℝ := fun x => f₁ x+increments n x
let gβ‚€ := recursion S bβ‚€ ⟨hβ‚€,hhβ‚€βŸ© hβ‚€ increments (n+1)
let g₁ := recursion S b₁ ⟨h₁,hhβ‚βŸ© h₁ increments (n+1)
obtain ⟨A,hA,r,hr,he⟩:=tail_projection_kernel S bβ‚€ b₁ vβ‚€ v₁ gβ‚€ g₁ a
(project_spec S bβ‚€ ⟨hβ‚€,hhβ‚€βŸ© vβ‚€) (project_spec S b₁ ⟨h₁,hhβ‚βŸ© v₁) hb
let W : Set V := {x | xβˆ‰S.pins}
let u : V β†’ ℝ := fun x => max (v₁ x-vβ‚€ x-a) 0
have hu (x) : u x=max (f₁ x-fβ‚€ x-a) 0 := by dsimp [u,v₁,vβ‚€];rw [add_sub_add_right_eq_sub]
have hup (x) (hx : xβˆ‰W) : u x=0 := by
have hp : x∈S.pins := Classical.not_not.mp hx
rw [hu]
have hfβ‚€ : fβ‚€ x=bβ‚€ x := (recursion_feasible S bβ‚€ hβ‚€ hhβ‚€ increments n).2 x hp
have hf₁ : f₁ x=b₁ x := (recursion_feasible S b₁ h₁ hh₁ increments n).2 x hp
rw [hfβ‚€,hf₁,max_eq_right (sub_nonpos.mpr (hb x hp))]
refine ⟨A.restrict W,Kernel.cutoff (fun x : W => r x) (fun x => hr x),A.restrict_firm hA W,
Kernel.cutoff_firm _ _,?_⟩
funext x
rw [Kernel.cutoff_apply]
have harg : meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a n=(fun x : W => u x) := by
funext x
exact (hu x).symm
rw [harg,Kernel.restrict_apply_of_zero A W u hup]
exact he x
end ProjectionComparison
namespace ProjectionComparison
open Set ClusterDisplacement
attribute [local instance] Classical.propDecidable
variable {V E : Type*} [Fintype V] [Fintype E]
theorem projection_mesh_tail_displacement (S : System V E) (bβ‚€ b₁ hβ‚€ h₁ : V β†’ ℝ)
(hhβ‚€ : hβ‚€βˆˆfeasible S bβ‚€) (hh₁ : hβ‚βˆˆfeasible S b₁)
(increments : β„• β†’ V β†’ ℝ) (a : ℝ) (hb : βˆ€x∈S.pins,b₁ x-bβ‚€ x≀a)
(N k : β„•) (hk : k≀N) (x : {x // xβˆ‰S.pins}) :
|meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a k x-
meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a 0 x|≀
5*(Fintype.card {x // xβˆ‰S.pins}+1:ℝ)*Real.sqrt
(energy (meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a 0)-
energy (meshTail S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a N)) := by
exact two_stage_displacement _ (mesh_tail_step S bβ‚€ b₁ hβ‚€ h₁ hhβ‚€ hh₁ increments a hb) N k hk x
end ProjectionComparison
end OAI