cfahlgren1/math / lean /OAI /Analysis /LienardCycles /AlgebraicFlow.lean
cfahlgren1's picture
download
raw
6.61 kB
import OAI.Analysis.LienardCycles.SqrtPaths
namespace OAI
universe uE uF uP
open scoped Topology NNReal ContDiff Manifold
open Filter Set
open Set Filter Metric MeasureTheory
open scoped Topology NNReal ContDiff
open Set Filter MeasureTheory
open scoped Topology
open Set Filter
open Set Filter Metric
open scoped Topology ContDiff
open Set Filter
open scoped Topology ContDiff
namespace QuinticLienard.SmoothFlow
variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E]
noncomputable def pathMap {F : Type uF} [NormedAddCommGroup F] [NormedSpace ℝ F]
(L : E →L[ℝ] F) : Path E →L[ℝ] Path F :=
ContinuousLinearMap.compLeftContinuous ℝ UnitInterval L
@[simp] lemma pathMap_apply {F : Type uF} [NormedAddCommGroup F] [NormedSpace ℝ F]
(L : E →L[ℝ] F) (u : Path E) (s : UnitInterval) : pathMap L u s=L (u s) := rfl
@[simp] lemma pathMap_const {F : Type uF} [NormedAddCommGroup F] [NormedSpace ℝ F]
(L : E →L[ℝ] F) (x : E) : pathMap L (constCLM x)=constCLM (L x) := rfl
inductive AlgebraicExpr (E : Type uE) [NormedAddCommGroup E] [NormedSpace ℝ E] where
| const : ℝ → AlgebraicExpr E
| linear : (E →L[ℝ] ℝ) → AlgebraicExpr E
| add : AlgebraicExpr E → AlgebraicExpr E → AlgebraicExpr E
| mul : AlgebraicExpr E → AlgebraicExpr E → AlgebraicExpr E
| inv : AlgebraicExpr E → AlgebraicExpr E
| sqrt : AlgebraicExpr E → AlgebraicExpr E
namespace AlgebraicExpr
noncomputable def eval : AlgebraicExpr E → E → ℝ
| const c, _ => c
| linear L, x => L x
| add p q,x => p.eval x+q.eval x
| mul p q,x => p.eval x*q.eval x
| inv p,x => (p.eval x)⁻¹
| sqrt p,x => Real.sqrt (p.eval x)
def RegularAt : AlgebraicExpr E → E → Prop
| const _,_ => True
| linear _,_ => True
| add p q,x => p.RegularAt x ∧ q.RegularAt x
| mul p q,x => p.RegularAt x ∧ q.RegularAt x
| inv p,x => p.RegularAt x ∧ p.eval x≠0
| sqrt p,x => p.RegularAt x ∧ 0<p.eval x
lemma eval_analytic (p : AlgebraicExpr E) {x : E} (hp : p.RegularAt x) :
ContDiffAt ℝ ω p.eval x := by
induction p with
| const c => exact contDiffAt_const
| linear L => exact L.contDiff.contDiffAt
| add p q ihp ihq => exact (ihp hp.1).add (ihq hp.2)
| mul p q ihp ihq => exact (ihp hp.1).mul (ihq hp.2)
| inv p ih => exact (ih hp.1).inv hp.2
| sqrt p ih => exact (ih hp.1).sqrt (ne_of_gt hp.2)
noncomputable def onPaths : AlgebraicExpr E → Path E → Path ℝ
| const c,_ => constCLM c
| linear L,u => pathMap L u
| add p q,u => p.onPaths u+q.onPaths u
| mul p q,u => p.onPaths u*q.onPaths u
| inv p,u => Ring.inverse (p.onPaths u)
| sqrt p,u => sqrtPath (p.onPaths u)
lemma path_properties (p : AlgebraicExpr E) {x : E} (hp : p.RegularAt x) :
p.onPaths (constCLM x)=constCLM (p.eval x) ∧
ContDiffAt ℝ ω p.onPaths (constCLM x) ∧
∀ᶠ u in 𝓝 (constCLM x), ∀ s, p.onPaths u s=p.eval (u s) := by
induction p with
| const c => exact ⟨rfl,contDiffAt_const,Eventually.of_forall (fun _ _ => rfl)⟩
| linear L => exact ⟨rfl,(pathMap L).contDiff.contDiffAt,Eventually.of_forall (fun _ _ => rfl)⟩
| add p q ihp ihq =>
obtain ⟨hp0,hpd,hpe⟩ := ihp hp.1
obtain ⟨hq0,hqd,hqe⟩ := ihq hp.2
refine ⟨?_,hpd.add hqd,?_⟩
· simp only [onPaths,hp0,hq0]; ext s; rfl
· filter_upwards [hpe,hqe] with u hu hv s
exact congrArg₂ (·+·) (hu s) (hv s)
| mul p q ihp ihq =>
obtain ⟨hp0,hpd,hpe⟩ := ihp hp.1
obtain ⟨hq0,hqd,hqe⟩ := ihq hp.2
refine ⟨?_,hpd.mul hqd,?_⟩
· simp only [onPaths,hp0,hq0]; ext s; rfl
· filter_upwards [hpe,hqe] with u hu hv s
exact congrArg₂ (·*·) (hu s) (hv s)
| inv p ih =>
obtain ⟨hp0,hpd,hpe⟩ := ih hp.1
have hunit : IsUnit (p.onPaths (constCLM x)) := by
rw [hp0]
exact (ContinuousMap.isUnit_iff_forall_ne_zero _).mpr (fun _ => hp.2)
have hinv : ContDiffAt ℝ ω Ring.inverse (p.onPaths (constCLM x)) := by
have hh := contDiffAt_ringInverse ℝ (n:=ω) hunit.unit
rw [hunit.unit_spec] at hh
exact hh
refine ⟨?_,hinv.comp _ hpd,?_⟩
· ext s
rw [onPaths,RationalExpr.inverse_eval _ hunit,hp0]
rfl
· have hu : ∀ᶠ u in 𝓝 (constCLM x), IsUnit (p.onPaths u) :=
hpd.continuousAt.eventually (Units.isOpen.mem_nhds hunit)
filter_upwards [hpe,hu] with u he hunit s
rw [onPaths,RationalExpr.inverse_eval _ hunit,he s]
rfl
| sqrt p ih =>
obtain ⟨hp0,hpd,hpe⟩ := ih hp.1
refine ⟨?_,?_,?_⟩
· simp only [onPaths,hp0,sqrtPath_const,eval]
· apply (show ContDiffAt ℝ ω sqrtPath (p.onPaths (constCLM x)) by rw [hp0]; exact sqrtPath_analytic hp.2).comp _ hpd
· filter_upwards [hpe] with u hu s
exact congrArg Real.sqrt (hu s)
end AlgebraicExpr
open ArcFamilies
variable {P : Type uP} [NormedAddCommGroup P] [NormedSpace ℝ P] [CompleteSpace P]
theorem algebraic_profile_flow (e : AlgebraicExpr (P × ℝ)) (x : State P)
(he : e.RegularAt (x.1,x.2.1)) :
∃ f : State P × ℝ → State P, ContDiffAt ℝ ω f (x,0) ∧
∀ᶠ q in 𝓝 (x,(0:ℝ)), f (q.1,0)=q.1 ∧
HasDerivAt (fun s => f (q.1,s)) (field e.eval (f q)) q.2 := by
let L : State P →L[ℝ] P × ℝ :=
(ContinuousLinearMap.fst ℝ P (ℝ×ℝ)).prod
((ContinuousLinearMap.fst ℝ ℝ ℝ).comp (ContinuousLinearMap.snd ℝ P (ℝ×ℝ)))
let Y : State P →L[ℝ] ℝ :=
(ContinuousLinearMap.snd ℝ ℝ ℝ).comp (ContinuousLinearMap.snd ℝ P (ℝ×ℝ))
let I : ℝ →L[ℝ] State P :=
(ContinuousLinearMap.inr ℝ P (ℝ×ℝ)).comp (ContinuousLinearMap.inl ℝ ℝ ℝ)
let W : Path (State P) → Path (State P) := fun u =>
constCLM (0,(0,1)) + pathMap I (e.onPaths (pathMap L u)-pathMap Y u)
have hL : L x=(x.1,x.2.1) := rfl
have hep := AlgebraicExpr.path_properties e he
have hed : ContDiffAt ℝ ω e.onPaths (pathMap L (constCLM x)) := by
simpa only [pathMap_const,hL] using hep.2.1
have hW : ContDiffAt ℝ ω W (constCLM x) :=
contDiffAt_const.add ((pathMap I).contDiff.contDiffAt.comp _
((hed.comp _ (pathMap L).contDiff.contDiffAt).sub (pathMap Y).contDiff.contDiffAt))
apply exists_analytic_local_flow_eventually W (field e.eval) x _ hW
have ht : Tendsto (pathMap L) (𝓝 (constCLM x)) (𝓝 (constCLM (x.1,x.2.1))) := by
exact (pathMap L).continuous.continuousAt.tendsto
filter_upwards [ht.eventually hep.2.2] with u hu s
simp only [W,ContinuousMap.add_apply,pathMap_apply,ContinuousMap.sub_apply,hu s,constCLM_apply]
simp [I,L,Y,field]
end QuinticLienard.SmoothFlow
end OAI

Xet Storage Details

Size:
6.61 kB
·
Xet hash:
a50ee1d85330006fd350f6f2a178865f3f2654b87f40349472ea3d6acf2b5bf7

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