Download lean/OAI/MathematicalPhysics/NavierStokes/VelocityDetection/BurstTotalReferenceSum.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
theoremreference_transport (hν : 0≤ ν) (k : ℕ)
(h : ∀ n < k+1, tr.stopped n = false) (t : ℝ) (X : Coord2) :
deriv (fun s =>BurstBlock.reference A ν tr k s X) t +
advection (field A ν) (BurstBlock.reference A ν tr k) t X =
BurstBlock.source A ν (tr.address 0) k t X:=by
proof · 13
lines
haveha : advection (field A ν) (BurstBlock.reference A ν tr k) t X =
advection (BurstBlock.field A ν k) (BurstBlock.reference A ν tr k) t X:=byby_cases ht : t ∈Icc ((k:ℝ)+1) ((k:ℝ)+2)
· simp only [advection,congrFun (field_at_block A ν hν k ht) X]
· havehz : BurstBlock.reference A ν tr k t = 0:=by
apply BurstBlock.reference_zero A ν tr k
rcases lt_or_ge t ((k:ℝ)+1) with hlt | hge
· exact Or.inl (localTime_before A ν hν k hlt.le)
· exact Or.inr (localTime_after A ν hν k (le_of_lt (lt_of_not_ge (fun hle => ht ⟨hge,hle⟩))))
rw [congrFun (TimeBlocks.advection_zero (field A ν) hz) X,
congrFun (TimeBlocks.advection_zero (BurstBlock.field A ν k) hz) X]
rw [ha]
exact BurstBlock.reference_transport A ν tr k h t X
theoremreferenceSum_transport (hν : 0≤ ν) (L : ℕ)
(h : ∀ n < L, tr.stopped n = false) {t : ℝ} (ht : t ≤ (L:ℝ)+1) (X : Coord2) :
deriv (fun s => referenceSum A ν tr L s X) t +
advection (field A ν) (referenceSum A ν tr L) t X = source A ν (tr.address 0) t X:=by
proof · 17
lines
have hsm (k : ℕ) (hk : k ∈Finset.range L) :=BurstBlock.contDiff_reference A ν tr k
(fun n hn => h n (lt_of_lt_of_le hn (Finset.mem_range.mp hk)))
change deriv (fun s =>∑ k ∈Finset.range L, BurstBlock.reference A ν tr k s X) t +
advection (field A ν) (fun s Y=>∑ k ∈Finset.range L, BurstBlock.reference A ν tr k s Y) t X = _
have hd (k : ℕ) (hk : k ∈Finset.range L) :
DifferentiableAtℝ (fun s =>BurstBlock.reference A ν tr k s X) t :=
((hsm k hk).comp (contDiff_id.prodMk contDiff_const)).differentiable (by simp) t
rw [deriv_fun_sum hd,
TimeBlocks.advection_sum (field A ν) (Finset.range L) (BurstBlock.reference A ν tr)
(fun k hk s => ((hsm k hk).comp (contDiff_const.prodMk contDiff_id)).differentiable (by simp)),
←Finset.sum_add_distrib]
havehe : source A ν (tr.address 0) t X =
∑ k ∈Finset.range L, BurstBlock.source A ν (tr.address 0) k t X:=
congrFun (TimeBlocks.eq_finite (sourceFamily A ν hν (tr.address 0)) ht) X
rw [he]
exact Finset.sum_congr rfl (fun k hk => reference_transport A ν tr hν k
(fun n hn => h n (lt_of_lt_of_le hn (Finset.mem_range.mp hk))) t X)
theoremreferenceSum_laplacian (hν : 0≤ ν) (L : ℕ)
(h : ∀ n < L, tr.stopped n = false) (t : ℝ) (X : Coord2) :
ν*|laplacian (referenceSum A ν tr L) t X| ≤ deriv (barrierSum A ν L) t :=by
proof · 8
lines
change ν*|laplacian (fun s Y=>∑ k ∈Finset.range L, BurstBlock.reference A ν tr k s Y) t X| ≤ _
rw [TimeBlocks.laplacian_sum (Finset.range L) (BurstBlock.reference A ν tr)
(fun k hk =>BurstBlock.contDiff_reference A ν tr k
(fun n hn => h n (lt_of_lt_of_le hn (Finset.mem_range.mp hk)))),deriv_barrierSum]
apply (mul_le_mul_of_nonneg_left (Finset.abs_sum_le_sum_abs _ _) hν).trans
rw [Finset.mul_sum]
exact Finset.sum_le_sum (fun k hk =>BurstBlock.reference_laplacian_barrier A ν tr hν k
(fun n hn => h n (lt_of_lt_of_le hn (Finset.mem_range.mp hk))) t X)
have hactive (n : ℕ) : tr.stopped n = false:=bycases h : tr.stopped n
· rfl
· exact False.elim (hnever ⟨n,h⟩)
obtain ⟨Y,hYcube,hYY,hXY⟩ := strip_representative X ⟨by linarith [hY.1],by linarith [hY.2]⟩
rw [scalar_periodic A ν hν (tr.address 0) t hXY]
obtain ⟨L,hL⟩ := exists_nat_gt t
have he := scalar_prefix_error A ν tr hν L (fun n _ => hactive n) ⟨ht,by linarith⟩ Yhavehz : referenceSum A ν tr L t Y = 0:=by
exact Finset.sum_eq_zero (fun k _ =>BurstBlock.reference_zero_detector A ν tr k
(fun n _ => hactive n) t hYcube (by rw [hYY]; exact hY.2))
rw [hz,sub_zero] at he
exact (le_abs_self _).trans he