math / data /lean /OAI /Analysis /HardSphere /Cutoffs /PathDiameter.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
8.88 kB
import Mathlib
import OAI.Analysis.HardSphere.Conditioning.ReverseConfigurationPath
import OAI.Analysis.HardSphere.Bridges.NormalizedPrefix
import OAI.Analysis.HardSphere.Geometry.InjectiveNear
namespace OAI
noncomputable section
open MeasureTheory Set Filter ProbabilityTheory
open scoped ENNReal NNReal Topology BigOperators
namespace HardSphere.PathCutoff
open Wiener
attribute [local irreducible] torusDistance freeTrajectory
def intervalTime (a b s : Time) : Time :=
⟨(1-(s:ℝ))*(a:ℝ)+(s:ℝ)*(b:ℝ), by
constructor
Β· exact add_nonneg (mul_nonneg (sub_nonneg.mpr s.property.2) a.property.1) (mul_nonneg s.property.1 b.property.1)
Β· nlinarith [a.property.1,a.property.2,b.property.1,b.property.2,
s.property.1,s.property.2,mul_nonneg (sub_nonneg.mpr s.property.2) (sub_nonneg.mpr a.property.2),
mul_nonneg s.property.1 (sub_nonneg.mpr b.property.2)]⟩
lemma intervalTime_continuous (a b : Time) : Continuous (intervalTime a b) := by
apply Continuous.subtype_mk
fun_prop
@[simp] lemma intervalTime_zero (a b : Time) : intervalTime a b 0=a := by
apply Subtype.ext
simp [intervalTime]
@[simp] lemma intervalTime_one (a b : Time) : intervalTime a b 1=b := by
apply Subtype.ext
simp [intervalTime]
def diameterMap {L : Length} (a b : Time) (Ο‰ : ConfigurationPath 1 L) : C(TimeΓ—Time,ℝ) :=
⟨fun p ↦ torusDistance L (Ο‰ (intervalTime a b p.1) 0) (Ο‰ (intervalTime a b p.2) 0), by
apply (torusDistance_continuous_pair L).comp (f := fun p : TimeΓ—Time ↦ (Ο‰ (intervalTime a b p.1) 0,Ο‰ (intervalTime a b p.2) 0))
exact ((continuous_apply 0).comp (Ο‰.continuous.comp ((intervalTime_continuous a b).comp continuous_fst))).prodMk
((continuous_apply 0).comp (Ο‰.continuous.comp ((intervalTime_continuous a b).comp continuous_snd)))⟩
def intervalDiameter {L : Length} (a b : Time) (Ο‰ : ConfigurationPath 1 L) : ℝ :=
β€–diameterMap a b Ο‰β€–
lemma diameterMap_continuous (L : Length) (a b : Time) : Continuous (diameterMap (L:=L) a b) := by
apply ContinuousMap.continuous_of_continuous_uncurry
change Continuous (fun p : ConfigurationPath 1 L Γ— (TimeΓ—Time) ↦
torusDistance L (p.1 (intervalTime a b p.2.1) 0) (p.1 (intervalTime a b p.2.2) 0))
apply (torusDistance_continuous_pair L).comp (f := fun p : ConfigurationPath 1 LΓ—(TimeΓ—Time) ↦ (p.1 (intervalTime a b p.2.1) 0,p.1 (intervalTime a b p.2.2) 0))
apply Continuous.prodMk
Β· exact (continuous_apply 0).comp (continuous_fst.eval ((intervalTime_continuous a b).comp (continuous_fst.comp continuous_snd)))
Β· exact (continuous_apply 0).comp (continuous_fst.eval ((intervalTime_continuous a b).comp (continuous_snd.comp continuous_snd)))
lemma intervalDiameter_continuous (L : Length) (a b : Time) :
Continuous (intervalDiameter (L:=L) a b) := (diameterMap_continuous L a b).norm
lemma intervalDiameter_nonneg {L : Length} (a b : Time) (Ο‰ : ConfigurationPath 1 L) :
0 ≀ intervalDiameter a b Ο‰ := norm_nonneg _
lemma intervalDistance_le {L : Length} (a b s q : Time) (Ο‰ : ConfigurationPath 1 L) :
torusDistance L (Ο‰ (intervalTime a b s) 0) (Ο‰ (intervalTime a b q) 0) ≀ intervalDiameter a b Ο‰ := by
exact (le_abs_self _).trans (ContinuousMap.norm_coe_le_norm (diameterMap a b Ο‰) (s,q))
lemma intervalDiameter_le {L : Length} (a b : Time) (Ο‰ : ConfigurationPath 1 L) {R : ℝ} (hR : 0 ≀ R)
(h : βˆ€ s q, torusDistance L (Ο‰ (intervalTime a b s) 0) (Ο‰ (intervalTime a b q) 0) ≀ R) :
intervalDiameter a b Ο‰ ≀ R := by
apply (ContinuousMap.norm_le _ hR).mpr
intro p
change |torusDistance L _ _| ≀ R
rw [abs_of_nonneg (by unfold torusDistance; positivity)]
exact h p.1 p.2
lemma intervalTime_reverse (a b s : Time) :
reverseTime (intervalTime a b s)=intervalTime (reverseTime b) (reverseTime a) (reverseTime s) := by
apply Subtype.ext
change 1-((1-(s:ℝ))*(a:ℝ)+(s:ℝ)*(b:ℝ)) = (1-(1-(s:ℝ)))*(1-(b:ℝ))+(1-(s:ℝ))*(1-(a:ℝ))
ring
lemma intervalDiameter_reverse {L : Length} (a b : Time) (Ο‰ : ConfigurationPath 1 L) :
intervalDiameter a b (reverseConfigurationPath 1 L Ο‰)=
intervalDiameter (reverseTime b) (reverseTime a) Ο‰ := by
apply le_antisymm
Β· apply intervalDiameter_le _ _ _ (intervalDiameter_nonneg _ _ _)
intro s q
change torusDistance L (Ο‰ (reverseTime (intervalTime a b s)) 0)
(Ο‰ (reverseTime (intervalTime a b q)) 0) ≀ _
simp only [intervalTime_reverse]
exact intervalDistance_le _ _ _ _ _
Β· have hh : reverseTime (reverseTime a)=a := reverseTime_reverse _
have hh' : reverseTime (reverseTime b)=b := reverseTime_reverse _
apply intervalDiameter_le _ _ _ (intervalDiameter_nonneg _ _ _)
intro s q
have h := intervalDistance_le a b (reverseTime s) (reverseTime q) (reverseConfigurationPath 1 L Ο‰)
change torusDistance L (Ο‰ (reverseTime (intervalTime a b (reverseTime s))) 0)
(Ο‰ (reverseTime (intervalTime a b (reverseTime q))) 0) ≀ _ at h
simpa only [intervalTime_reverse,reverseTime_reverse] using h
end HardSphere.PathCutoff
namespace HardSphere.PathCutoff
open Wiener
attribute [local irreducible] torusDistance freeTrajectory
def meshTime {m : β„•} (j : Fin m) (s : Time) : Time :=
⟨((j:ℝ)+(s:ℝ))/(m:ℝ), by
have hm : (0:ℝ) < m := by exact_mod_cast j.pos
refine ⟨div_nonneg (add_nonneg (Nat.cast_nonneg _) s.property.1) hm.le,(div_le_one hm).mpr ?_⟩
have hj : (j:ℝ)+1≀(m:ℝ) := by exact_mod_cast j.isLt
linarith [s.property.2]⟩
lemma meshTime_continuous {m : β„•} (j : Fin m) : Continuous (meshTime j) := by
apply Continuous.subtype_mk
fun_prop
def meshSegment {m : β„•} {L : Length} (j : Fin m) (Ο‰ : ConfigurationPath 1 L) : ConfigurationPath 1 L :=
⟨fun s ↦ Ο‰ (meshTime j s),Ο‰.continuous.comp (meshTime_continuous j)⟩
lemma meshSegment_continuous {m : β„•} (L : Length) (j : Fin m) :
Continuous (meshSegment (L:=L) j) := by
apply ContinuousMap.continuous_of_continuous_uncurry
change Continuous (fun p : ConfigurationPath 1 LΓ—Time ↦ p.1 (meshTime j p.2))
exact continuous_fst.eval ((meshTime_continuous j).comp continuous_snd)
@[simp] lemma meshSegment_one {L : Length} (Ο‰ : ConfigurationPath 1 L) :
meshSegment (0:Fin 1) Ο‰=Ο‰ := by
apply ContinuousMap.ext
intro s
change Ο‰ (meshTime (0:Fin 1) s)=Ο‰ s
congr 1
apply Subtype.ext
simp [meshTime]
lemma mesh_firstTime {m : β„•} (hm : 0 < m) (s : Time) :
meshTime (0:Fin (m+1)) s=prefixTime (splitTime 1 (m:ℝ) (by norm_num) (by exact_mod_cast hm)) s := by
apply Subtype.ext
simp only [meshTime,Fin.val_zero,Nat.cast_zero,zero_add,prefixTime,ContinuousMap.coe_mk,splitTime,Nat.cast_add,Nat.cast_one]
ring
lemma mesh_nextTime {m : β„•} (hm : 0 < m) (j : Fin m) (s : Time) :
meshTime j.succ s=suffixTime (splitTime 1 (m:ℝ) (by norm_num) (by exact_mod_cast hm)) (meshTime j s) := by
apply Subtype.ext
have hm' : (m:ℝ)β‰ 0 := by exact_mod_cast (Nat.ne_of_gt hm)
have hm1 : (1:ℝ)+mβ‰ 0 := by positivity
simp only [meshTime,Fin.val_succ,suffixTime,ContinuousMap.coe_mk,splitTime,Nat.cast_add,Nat.cast_one]
field_simp
ring
lemma meshSegment_first {m : β„•} {L : Length} (hm : 0 < m) (Ο‰ : ConfigurationPath 1 L) :
meshSegment (0:Fin (m+1)) Ο‰=configurationPrefix 1 L (splitTime 1 (m:ℝ) (by norm_num) (by exact_mod_cast hm)) Ο‰ := by
ext s i j
exact congrArg (fun u : Time ↦ Ο‰ u i j) (mesh_firstTime hm s)
lemma meshSegment_next {m : β„•} {L : Length} (hm : 0 < m) (j : Fin m) (Ο‰ : ConfigurationPath 1 L) :
meshSegment j.succ Ο‰=meshSegment j (configurationSuffix 1 L (splitTime 1 (m:ℝ) (by norm_num) (by exact_mod_cast hm)) Ο‰) := by
ext s i k
exact congrArg (fun u : Time ↦ Ο‰ u i k) (mesh_nextTime hm j s)
lemma meshTime_reverse {m : β„•} (j : Fin m) (s : Time) :
reverseTime (meshTime j s)=meshTime j.rev (reverseTime s) := by
apply Subtype.ext
have hm : (m:ℝ)β‰ 0 := by exact_mod_cast (Nat.ne_of_gt j.pos)
change 1-((j:ℝ)+(s:ℝ))/(m:ℝ)=((j.rev:ℝ)+(1-(s:ℝ)))/(m:ℝ)
have hj : (j.rev:ℝ)=(m:ℝ)-1-(j:ℝ) := by
rw [Fin.val_rev,Nat.cast_sub (by omega)]
push_cast
ring
rw [hj]
field_simp
ring
lemma meshSegment_reverse {m : β„•} {L : Length} (j : Fin m) (Ο‰ : ConfigurationPath 1 L) :
meshSegment j (reverseConfigurationPath 1 L Ο‰)=reverseConfigurationPath 1 L (meshSegment j.rev Ο‰) := by
ext s i k
exact congrArg (fun u : Time ↦ Ο‰ u i k) (meshTime_reverse j s)
lemma mesh_sum_reverse {m : β„•} {L : Length} (F : ConfigurationPath 1 L→ℝ)
(hF : βˆ€Ο‰,F (reverseConfigurationPath 1 L Ο‰)=F Ο‰) (Ο‰ : ConfigurationPath 1 L) :
βˆ‘ j : Fin m,F (meshSegment j (reverseConfigurationPath 1 L Ο‰))=
βˆ‘ j : Fin m,F (meshSegment j Ο‰) := by
simp only [meshSegment_reverse,hF]
exact Equiv.sum_comp (Fin.revPerm) (fun j : Fin m ↦ F (meshSegment j Ο‰))
end HardSphere.PathCutoff
end
end OAI