Neighbor and sine-mode Chebyshev chamber numerators
DefinitionMarkovScattering_ChebyshevChamberCoefficientsmarkov-scattering
Defines the even interior neighbors of an odd chamber center, the triangular mode range, the weighted Morrow–Patterson interpolation numerator, and the diagonal sine-mode numerator.
Definition code
import Mathlib.Algebra.BigOperators.Group.Finset.Sigma
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Chebyshev.Basic
import Mathlib.Data.Int.Interval
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
namespace MarkovScattering.ChebyshevChamber
open scoped BigOperators
open Real Polynomial.Chebyshev
noncomputable section
/-- The four lattice coordinates at distance one from a chamber center. -/
def axialNeighbors (a b : ℤ) : Finset (ℤ × ℤ) :=
{(a + 1, b), (a - 1, b), (a, b + 1), (a, b - 1)}
/-- Even interior nodes among the four neighboring lattice coordinates. -/
def interiorNeighbors (m n a b : ℤ) : Finset (ℤ × ℤ) :=
(axialNeighbors a b).filter fun z =>
0 < z.1 ∧ z.1 < m ∧ 0 < z.2 ∧ z.2 < n ∧ (z.1 + z.2) % 2 = 0
/-- The positive mode indices for total polynomial degree at most `d - 3`. -/
def triangleModes (d : ℤ) : Finset (ℤ × ℤ) :=
((Finset.Icc 1 (d - 1)) ×ˢ (Finset.Icc 1 (d - 1))).filter
fun k => k.1 + k.2 ≤ d - 1
/-- The angle of grid coordinate `j` in a direction with endpoint index `d`. -/
def gridAngle (d j : ℤ) : ℝ := (j : ℝ) * (π / (d : ℝ))
/-- The product of the two Dirichlet sine modes at a grid coordinate. -/
def sineMode (m n : ℤ) (k z : ℤ × ℤ) : ℝ :=
sin ((k.1 : ℝ) * gridAngle m z.1) * sin ((k.2 : ℝ) * gridAngle n z.2)
/-- The eigenvalue of the four-neighbor stencil on the sine mode. -/
def sineMultiplier (m n : ℤ) (k : ℤ × ℤ) : ℝ :=
2 * cos (gridAngle m k.1) + 2 * cos (gridAngle n k.2)
/-- The product of the two second-kind Chebyshev polynomials of a mode. -/
def modePolynomial (k : ℤ × ℤ) (x y : ℝ) : ℝ :=
(U ℝ (k.1 - 1)).eval x * (U ℝ (k.2 - 1)).eval y
/-- The Morrow–Patterson interpolation kernel at the grid node `z`. -/
def nodeCardinal (d : ℤ) (z : ℤ × ℤ) (x y : ℝ) : ℝ :=
8 * sin (gridAngle d z.1) ^ 2 * sin (gridAngle (d - 1) z.2) ^ 2 /
((d : ℝ) * ((d - 1 : ℤ) : ℝ)) *
∑ k ∈ triangleModes d,
modePolynomial k (cos (gridAngle d z.1)) (cos (gridAngle (d - 1) z.2)) *
modePolynomial k x y
/-- Formula (1), the numerator as the weighted sum of neighboring cardinal functions. -/
def neighborNumerator (d a b : ℤ) (x y : ℝ) : ℝ :=
(-1 : ℝ) ^ a * ((d : ℝ) * ((d - 1 : ℤ) : ℝ)) *
∑ z ∈ interiorNeighbors d (d - 1) a b,
nodeCardinal d z x y / (sin (gridAngle d z.1) * sin (gridAngle (d - 1) z.2))
/-- Formula (2), the numerator in second-kind Chebyshev modes. -/
def spectralNumerator (d a b : ℤ) (x y : ℝ) : ℝ :=
8 * (-1 : ℝ) ^ a *
∑ k ∈ triangleModes d,
sineMultiplier d (d - 1) k * sineMode d (d - 1) k (a, b) * modePolynomial k x y
end
end MarkovScattering.ChebyshevChamber
Source