def
definition
backwardDiff
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.NavierStokes.DiscreteNSOperator on GitHub at line 48.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
used by
formal source
45 (f : ScalarField siteCount) (j : Axis) (x : Fin siteCount) : ℝ :=
46 (f (Λ.plus j x) - f x) / h
47
48def backwardDiff {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
49 (f : ScalarField siteCount) (j : Axis) (x : Fin siteCount) : ℝ :=
50 (f x - f (Λ.minus j x)) / h
51
52def scalarLaplacian {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
53 (f : ScalarField siteCount) (x : Fin siteCount) : ℝ :=
54 ∑ j : Axis, forwardDiff Λ h (backwardDiff Λ h f j) j x
55
56def vectorLaplacian {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
57 (u : VectorField siteCount) (x : Fin siteCount) (i : Axis) : ℝ :=
58 scalarLaplacian Λ h (fun y => u y i) x
59
60def divergence {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
61 (u : VectorField siteCount) (x : Fin siteCount) : ℝ :=
62 ∑ j : Axis, forwardDiff Λ h (fun y => u y j) j x
63
64def advection {siteCount : ℕ} (Λ : LatticeTopology siteCount) (h : ℝ)
65 (u : VectorField siteCount) (x : Fin siteCount) (i : Axis) : ℝ :=
66 ∑ j : Axis, u x j * forwardDiff Λ h (fun y => u y i) j x
67
68def conservativeTransportField {siteCount : ℕ}
69 (flux : ScalarField siteCount) (perm : Equiv.Perm (Fin siteCount)) :
70 ScalarField siteCount :=
71 fun i => flux i - flux (perm i)
72
73theorem total_conservativeTransportField_zero {siteCount : ℕ}
74 (flux : ScalarField siteCount) (perm : Equiv.Perm (Fin siteCount)) :
75 total (conservativeTransportField flux perm) = 0 := by
76 unfold total conservativeTransportField
77 rw [Finset.sum_sub_distrib]
78 have hperm : (∑ i : Fin siteCount, flux (perm i)) = ∑ i : Fin siteCount, flux i := by