Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Stokes vectors, rotation matrices, transport and streaming operators for graded index media

Definition
Arxiv1110_5134_Basic

by Xeroth · Nov 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

graded-index-mediapolarizationradiative-transferstokes-parameterstransport-equation

Objects of Zhao, Tan and Liu (2011), arXiv:1110.5134.

  1. Stokes vector (Eq. 1). A beam of intensity III whose polarization ellipse has ellipticity angle χ\chiχ and orientation angle ψ\psiψ, measured in a right-hand frame, has Stokes vector I=(I,Q,U,V)=(I, Icos⁡2χcos⁡2ψ, Icos⁡2χsin⁡2ψ, Isin⁡2χ)\mathbf I=(I,Q,U,V)=(I,\ I\cos2\chi\cos2\psi,\ I\cos2\chi\sin2\psi,\ I\sin2\chi)I=(I,Q,U,V)=(I, Icos2χcos2ψ, Icos2χsin2ψ, Isin2χ).

  2. Torsion matrix (Eq. 14). R(κ)\mathbf R(\kappa)R(κ) is the 4×44\times44×4 matrix with R23=2κR_{23}=2\kappaR23​=2κ, R32=−2κR_{32}=-2\kappaR32​=−2κ and all other entries 000, where κ\kappaκ is the torsion of the ray.

  3. Rotation matrices (Eqs. 23, 31). ℜ(ϕ)\Re(\phi)ℜ(ϕ) has rows (1,0,0,0)(1,0,0,0)(1,0,0,0), (0,cos⁡2ϕ,sin⁡2ϕ,0)(0,\cos2\phi,\sin2\phi,0)(0,cos2ϕ,sin2ϕ,0), (0,−sin⁡2ϕ,cos⁡2ϕ,0)(0,-\sin2\phi,\cos2\phi,0)(0,−sin2ϕ,cos2ϕ,0), (0,0,0,1)(0,0,0,1)(0,0,0,1). The same matrix written through c=cos⁡ϕc=\cos\phic=cosϕ for ϕ∈[0,π]\phi\in[0,\pi]ϕ∈[0,π] has cos⁡2ϕ=2c2−1\cos2\phi=2c^2-1cos2ϕ=2c2−1 and sin⁡2ϕ=2c1−c2\sin2\phi=2c\sqrt{1-c^2}sin2ϕ=2c1−c2​. With σ=(Ω×ν)⋅ez\sigma=(\boldsymbol\Omega\times\boldsymbol\nu)\cdot\mathbf e_zσ=(Ω×ν)⋅ez​, the modified rotation matrix is ℜ~(ϕG)=12(1+sgn⁡σ)ℜ(ϕG)+12(1−sgn⁡σ)ℜ(−ϕG)\tilde\Re(\phi_G)=\tfrac12(1+\operatorname{sgn}\sigma)\Re(\phi_G)+\tfrac12(1-\operatorname{sgn}\sigma)\Re(-\phi_G)ℜ~(ϕG​)=21​(1+sgnσ)ℜ(ϕG​)+21​(1−sgnσ)ℜ(−ϕG​).

  4. Left-hand frame (Eq. 64). T=diag⁡(1,1,−1,1)T=\operatorname{diag}(1,1,-1,1)T=diag(1,1,−1,1).

  5. Transport operator and source (Eq. 20). Along a ray with arc length sss and refractive index n(s)n(s)n(s), the transport operator is n2 dds[I/n2]n^2\,\frac{d}{ds}\big[\mathbf I/n^2\big]n2dsd​[I/n2]. Directions are unit vectors of R3\mathbb R^3R3 with the solid-angle measure dΩd\OmegadΩ (total mass 4π4\pi4π). The scattering source is 14π∫4πZ(Ω′)I(Ω′) dΩ′\frac1{4\pi}\int_{4\pi}\mathbf Z(\boldsymbol\Omega')\mathbf I(\boldsymbol\Omega')\,d\Omega'4π1​∫4π​Z(Ω′)I(Ω′)dΩ′. The derivative of a matrix-valued function of sss is taken entrywise.

  6. Frenet frame of a ray (Eq. 46). For a ray with unit tangent Ω(s)\boldsymbol\Omega(s)Ω(s): curvature K=∣dΩ/ds∣K=|d\boldsymbol\Omega/ds|K=∣dΩ/ds∣, principal normal ν=K−1dΩ/ds\boldsymbol\nu=K^{-1}d\boldsymbol\Omega/dsν=K−1dΩ/ds, binormal b=Ω×ν\mathbf b=\boldsymbol\Omega\times\boldsymbol\nub=Ω×ν, and torsion κ=−b⋅dν/ds\kappa=-\mathbf b\cdot d\boldsymbol\nu/dsκ=−b⋅dν/ds (the paper's sign convention).

  7. Eulerian streaming operators (Eqs. 42, 49, 52, 55). A field I(q,θ,φ)\mathbf I(q,\theta,\varphi)I(q,θ,φ) depends on three spatial coordinates qqq and the direction angles. In the local orthonormal frame of the coordinate system, Ω=(μ,η,ξ)=(sin⁡θcos⁡φ,sin⁡θsin⁡φ,cos⁡θ)\boldsymbol\Omega=(\mu,\eta,\xi)=(\sin\theta\cos\varphi,\sin\theta\sin\varphi,\cos\theta)Ω=(μ,η,ξ)=(sinθcosφ,sinθsinφ,cosθ), s1=(−sin⁡φ,cos⁡φ,0)\mathbf s_1=(-\sin\varphi,\cos\varphi,0)s1​=(−sinφ,cosφ,0), and the polar axis e3\mathbf e_3e3​ is the third frame vector. The gradient components are

    • Cartesian (x,y,z)(x,y,z)(x,y,z): (∂x,∂y,∂z)(\partial_x,\partial_y,\partial_z)(∂x​,∂y​,∂z​);
    • traditional cylindrical (ρ,Ψ,z)(\rho,\Psi,z)(ρ,Ψ,z) with frame (eρ,eΨ,ez)(\mathbf e_\rho,\mathbf e_\Psi,\mathbf e_z)(eρ​,eΨ​,ez​): (∂ρ,ρ−1∂Ψ,∂z)(\partial_\rho,\rho^{-1}\partial_\Psi,\partial_z)(∂ρ​,ρ−1∂Ψ​,∂z​);
    • new cylindrical (ρ,Ψ,z)(\rho,\Psi,z)(ρ,Ψ,z) with frame (eΨ,ez,eρ)(\mathbf e_\Psi,\mathbf e_z,\mathbf e_\rho)(eΨ​,ez​,eρ​): (ρ−1∂Ψ,∂z,∂ρ)(\rho^{-1}\partial_\Psi,\partial_z,\partial_\rho)(ρ−1∂Ψ​,∂z​,∂ρ​);
    • spherical (Θ,Ψ,ρ)(\Theta,\Psi,\rho)(Θ,Ψ,ρ) with frame (eΘ,eΨ,eρ)(\mathbf e_\Theta,\mathbf e_\Psi,\mathbf e_\rho)(eΘ​,eΨ​,eρ​): (ρ−1∂Θ,(ρsin⁡Θ)−1∂Ψ,∂ρ)(\rho^{-1}\partial_\Theta,(\rho\sin\Theta)^{-1}\partial_\Psi,\partial_\rho)(ρ−1∂Θ​,(ρsinΘ)−1∂Ψ​,∂ρ​).

    With g=∇n/n\mathbf g=\nabla n/ng=∇n/n, each streaming operator is Ω⋅∇\boldsymbol\Omega\cdot\nablaΩ⋅∇, plus the coordinate terms printed in Eqs. (49), (52) and (55), plus 1sin⁡θ{[(ξΩ−e3)⋅g]∂θ+[s1⋅g]∂φ}\frac1{\sin\theta}\{[(\xi\boldsymbol\Omega-\mathbf e_3)\cdot\mathbf g]\partial_\theta+[\mathbf s_1\cdot\mathbf g]\partial_\varphi\}sinθ1​{[(ξΩ−e3​)⋅g]∂θ​+[s1​⋅g]∂φ​}. The conservative angular term is 1sin⁡θ{∂θ[((ξΩ−e3)⋅g)I]+∂φ[(s1⋅g)I]}\frac1{\sin\theta}\{\partial_\theta[((\xi\boldsymbol\Omega-\mathbf e_3)\cdot\mathbf g)\mathbf I]+\partial_\varphi[(\mathbf s_1\cdot\mathbf g)\mathbf I]\}sinθ1​{∂θ​[((ξΩ−e3​)⋅g)I]+∂φ​[(s1​⋅g)I]}.

Formalization Note Vectors of R3\mathbb R^3R3 are triples of components, with ∣v∣=v⋅v|v|=\sqrt{v\cdot v}∣v∣=v⋅v​ and the cross product of Mathlib. Partial derivatives are derivatives of one-variable slices. The modified rotation matrix is encoded with 12\tfrac1221​ in front of both terms; as printed, Eq. (31) puts 12\tfrac1221​ before the first term only (see the report). The streaming operators of Eqs. (42), (49), (52) and (55) are quoted by the paper from Refs. [26], [29], [30] and are taken here as definitions.

Definition code
import Mathlib

/-!
J. M. Zhao, J. Y. Tan and L. H. Liu, *On the Derivation of Vector Radiative Transfer Equation for
Polarized Radiative Transport in Graded Index Media*, arXiv:1110.5134v1 (2011).

Objects of the paper: the Stokes vector of a polarization ellipse (Eq. 1), the torsion matrix
`R` (Eq. 14), the Stokes rotation matrix (Eq. 23) and the modified rotation matrix (Eq. 31), the
right-hand/left-hand transformation `T` (Eq. 64), the transport operator `n² d/ds [I/n²]` and the
scattering source term of Eq. (20), the Frenet frame and torsion of a ray (Eq. 46), and the
Eulerian streaming operators of Section 4.2.2 (Eqs. 42, 49, 52, 55).
-/

open MeasureTheory
open scoped Matrix

noncomputable section

namespace Arxiv1110_5134

/-- Section 2.1: a Stokes vector `(I, Q, U, V)`. -/
abbrev Stokes := Fin 4 → ℝ

/-- Eq. (1): the Stokes vector of an elliptically polarized beam of intensity `I`, ellipticity angle
`χ` and orientation angle `ψ`, defined in a right-hand frame:
`(I, I cos 2χ cos 2ψ, I cos 2χ sin 2ψ, I sin 2χ)`. -/
def stokesVec (I χ ψ : ℝ) : Stokes :=
  ![I, I * Real.cos (2 * χ) * Real.cos (2 * ψ), I * Real.cos (2 * χ) * Real.sin (2 * ψ),
    I * Real.sin (2 * χ)]

/-- Eq. (14): the matrix `R` accounting for the rotation of the polarization ellipse by Rytov's law,
with `R₂₃ = 2κ`, `R₃₂ = -2κ` and all other entries zero (`κ` the torsion of the ray). -/
def rytovMatrix (κ : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
  !![0, 0, 0, 0; 0, 0, 2 * κ, 0; 0, -(2 * κ), 0, 0; 0, 0, 0, 0]

/-- Eq. (23): the rotation matrix `ℜ(φ)` of Stokes vectors. -/
def stokesRot (φ : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
  !![1, 0, 0, 0;
     0, Real.cos (2 * φ), Real.sin (2 * φ), 0;
     0, -Real.sin (2 * φ), Real.cos (2 * φ), 0;
     0, 0, 0, 1]

/-- Text after Eq. (23): the rotation matrix `ℜ(φ)` written through `c = cos φ` alone, using
`cos 2φ = 2c² - 1` and `sin 2φ = 2 sin φ cos φ` with `sin φ = √(1 - c²)` for `φ ∈ [0, π]`. -/
def stokesRotOfCos (c : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
  !![1, 0, 0, 0;
     0, 2 * c ^ 2 - 1, 2 * c * Real.sqrt (1 - c ^ 2), 0;
     0, -(2 * c * Real.sqrt (1 - c ^ 2)), 2 * c ^ 2 - 1, 0;
     0, 0, 0, 1]

/-- Eqs. (26), (29), (31): the modified rotation matrix `ℜ̃(φ_G)`, where `σ = (Ω × ν)·e_z`:
`ℜ̃(φ_G) = ½ (1 + sgn σ) ℜ(φ_G) + ½ (1 - sgn σ) ℜ(-φ_G)`, so that it equals `ℜ(φ_G)` when `σ > 0`
(Eq. 26) and `ℜ(-φ_G)` when `σ < 0` (Eq. 29). (Eq. (31) as printed places the factor `½` before
the first term only; see the mission description.) -/
def modRot (σ φ : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
  (1 / 2 : ℝ) • ((1 + Real.sign σ) • stokesRot φ + (1 - Real.sign σ) • stokesRot (-φ))

/-- Eq. (64): the matrix `T = diag(1, 1, -1, 1)` transforming a Stokes vector defined in the
right-hand frame into the Stokes vector defined in the left-hand frame (Eq. 63). -/
def handT : Matrix (Fin 4) (Fin 4) ℝ :=
  Matrix.diagonal ![1, 1, -1, 1]

/-- Eqs. (13), (20): the transport operator `n² d/ds [I/n²]` applied to a Stokes vector `S(s)`
along a ray with refractive index `n(s)`, at ray coordinate `s`. -/
def transportOp (n : ℝ → ℝ) (S : ℝ → Stokes) (s : ℝ) : Stokes :=
  (n s ^ 2) • deriv (fun t => (n t ^ 2)⁻¹ • S t) s

/-- Directions of propagation: unit vectors `Ω ∈ ℝ³`. -/
abbrev Dir : Type := ↥(Metric.sphere (0 : EuclideanSpace ℝ (Fin 3)) 1)

/-- The solid-angle measure `dΩ` on the unit sphere (total mass `4π`). -/
def solidAngle : Measure Dir :=
  (volume : Measure (EuclideanSpace ℝ (Fin 3))).toSphere

/-- Eqs. (18), (20): the scattering source `(1/4π) ∫_{4π} Z(Ω', Ω) I(Ω') dΩ'`, for the phase matrix
`Z(·, Ω)` of the current direction `Ω` and the Stokes vectors `I(Ω')` of the incident directions at
the current point. -/
def scatSource (Z : Dir → Matrix (Fin 4) (Fin 4) ℝ) (L : Dir → Stokes) : Stokes :=
  (1 / (4 * Real.pi)) • ∫ ω, Z ω *ᵥ L ω ∂solidAngle

/-- Eqs. (37), (38): the derivative `dM/ds` of a matrix-valued function of the ray coordinate,
taken entrywise. -/
def matDeriv (M : ℝ → Matrix (Fin 4) (Fin 4) ℝ) (s : ℝ) : Matrix (Fin 4) (Fin 4) ℝ :=
  fun i j => deriv (fun t => M t i j) s

/-- Vectors of `ℝ³` in Cartesian (or local orthonormal) components. -/
abbrev Vec3 := Fin 3 → ℝ

/-- The Euclidean length `|v| = √(v·v)` of a vector of `ℝ³`. -/
def vlen (v : Vec3) : ℝ :=
  Real.sqrt (v ⬝ᵥ v)

/-- Eq. (46): the curvature `K = |dΩ/ds|` of a ray with unit tangent `Ω(s)`. -/
def rayCurvature (Ω : ℝ → Vec3) (s : ℝ) : ℝ :=
  vlen (deriv Ω s)

/-- Fig. 2, Eq. (46): the principal normal `ν = (dΩ/ds)/K` of a ray with unit tangent `Ω(s)`. -/
def frenetNormal (Ω : ℝ → Vec3) (s : ℝ) : Vec3 :=
  (rayCurvature Ω s)⁻¹ • deriv Ω s

/-- Fig. 2, Eq. (46): the binormal `b = Ω × ν`, so that `ν, b, Ω` is a right-hand frame. -/
def frenetBinormal (Ω : ℝ → Vec3) (s : ℝ) : Vec3 :=
  Ω s ⨯₃ frenetNormal Ω s

/-- Eq. (46): the torsion of the ray in the paper's sign convention, `κ = -b · dν/ds`. -/
def rayTorsion (Ω : ℝ → Vec3) (s : ℝ) : ℝ :=
  -(frenetBinormal Ω s ⬝ᵥ deriv (frenetNormal Ω) s)

section Streaming

variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]

/-- The partial derivative `∂f/∂qᵢ` of a function of three spatial coordinates `q = (q₀, q₁, q₂)`. -/
def pd (f : Vec3 → E) (i : Fin 3) (q : Vec3) : E :=
  deriv (fun r => f (Function.update q i r)) (q i)

/-- Eq. (42) and Figs. 6-8: the components `(μ, η, ξ) = (sin θ cos φ, sin θ sin φ, cos θ)` of the
direction `Ω` in the local orthonormal frame of the coordinate system. -/
def dirVec (θ φ : ℝ) : Vec3 :=
  ![Real.sin θ * Real.cos φ, Real.sin θ * Real.sin φ, Real.cos θ]

/-- Eq. (42) and Figs. 6-8: the auxiliary vector `s₁ = (-sin φ, cos φ, 0)` in the local frame. -/
def auxS1 (φ : ℝ) : Vec3 :=
  ![-Real.sin φ, Real.cos φ, 0]

/-- The polar axis of the angles `θ, φ` in the local frame: `k` (Eq. 42), `e_z` (Eq. 49),
`e_ρ` (Eqs. 52, 55); it is the third vector of the local frame in each case. -/
def polarAxis : Vec3 :=
  ![0, 0, 1]

/-- Eq. (42): the gradient in Cartesian coordinates `q = (x, y, z)`. -/
def cartGrad (f : Vec3 → E) (q : Vec3) : Fin 3 → E :=
  fun i => pd f i q

/-- Eq. (49): the gradient in the traditional cylindrical coordinates `q = (ρ, Ψ, z)` of Fig. 7(a),
in the local frame `(e_ρ, e_Ψ, e_z)`: `(∂/∂ρ, ρ⁻¹ ∂/∂Ψ, ∂/∂z)`. -/
def tradCylGrad (f : Vec3 → E) (q : Vec3) : Fin 3 → E :=
  ![pd f 0 q, (q 0)⁻¹ • pd f 1 q, pd f 2 q]

/-- Eq. (52): the gradient in the new cylindrical coordinates `q = (ρ, Ψ, z)` of Fig. 7(b), in the
local frame `(e_Ψ, e_z, e_ρ)`: `(ρ⁻¹ ∂/∂Ψ, ∂/∂z, ∂/∂ρ)`. -/
def newCylGrad (f : Vec3 → E) (q : Vec3) : Fin 3 → E :=
  ![(q 0)⁻¹ • pd f 1 q, pd f 2 q, pd f 0 q]

/-- Eq. (55): the gradient in the spherical coordinates `q = (Θ, Ψ, ρ)` of Fig. 8, in the local
frame `(e_Θ, e_Ψ, e_ρ)`: `(ρ⁻¹ ∂/∂Θ, (ρ sin Θ)⁻¹ ∂/∂Ψ, ∂/∂ρ)`. -/
def sphGrad (f : Vec3 → E) (q : Vec3) : Fin 3 → E :=
  ![(q 2)⁻¹ • pd f 0 q, (q 2 * Real.sin (q 0))⁻¹ • pd f 1 q, pd f 2 q]

/-- `Ω · G` for a vector `G` given by its components in the local frame. -/
def dirDot (θ φ : ℝ) (G : Fin 3 → E) : E :=
  ∑ i, dirVec θ φ i • G i

end Streaming

/-- `∂I/∂θ` for a field `I(q, θ, φ)` of position and direction angles. -/
def dTheta (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  deriv (fun θ' => F q θ' φ) θ

/-- `∂I/∂φ` for a field `I(q, θ, φ)` of position and direction angles. -/
def dPhi (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  deriv (fun φ' => F q θ φ') φ

/-- Eqs. (42), (44), (49), (50), (52), (53), (55), (56): the angular-redistribution term
`(1/sin θ) {[(ξΩ - e₃)·g] ∂I/∂θ + [s₁·g] ∂I/∂φ}`, where `g` holds the local components of `∇n/n`
and `e₃` is the polar axis. -/
def angularStream (g : Vec3) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  (Real.sin θ)⁻¹ • (((Real.cos θ • dirVec θ φ - polarAxis) ⬝ᵥ g) • dTheta F q θ φ +
    (auxS1 φ ⬝ᵥ g) • dPhi F q θ φ)

/-- Eqs. (45), (48), (51), (54), (57): the angular term in conservative form,
`(1/sin θ) {∂/∂θ [((ξΩ - e₃)·g) I] + ∂/∂φ [(s₁·g) I]}`, with `g` the local components of `∇n/n`. -/
def angularCons (g : Vec3) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  (Real.sin θ)⁻¹ •
    (deriv (fun θ' => ((Real.cos θ' • dirVec θ' φ - polarAxis) ⬝ᵥ g) • F q θ' φ) θ +
      deriv (fun φ' => (auxS1 φ' ⬝ᵥ g) • F q θ φ') φ)

/-- Eq. (42) (quoted from Ref. [26]): the Eulerian streaming operator `∂/∂s` in Cartesian
coordinates, `Ω·∇ + (1/sin θ){[(ξΩ - k)·∇n/n] ∂/∂θ + [s₁·∇n/n] ∂/∂φ}`. -/
def cartStream (n : Vec3 → ℝ) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  dirDot θ φ (cartGrad (fun y => F y θ φ) q) + angularStream ((n q)⁻¹ • cartGrad n q) F q θ φ

/-- Eq. (49) (quoted from Ref. [29]): the Eulerian streaming operator in the traditional cylindrical
coordinates, `Ω·∇ - (η/ρ) ∂/∂φ + (1/sin θ){[(ξΩ - e_z)·∇n/n] ∂/∂θ + [s₁·∇n/n] ∂/∂φ}`. -/
def tradCylStream (n : Vec3 → ℝ) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  dirDot θ φ (tradCylGrad (fun y => F y θ φ) q) -
    (Real.sin θ * Real.sin φ / q 0) • dPhi F q θ φ +
    angularStream ((n q)⁻¹ • tradCylGrad n q) F q θ φ

/-- Eq. (52) (quoted from Ref. [30]): the Eulerian streaming operator in the new cylindrical
coordinates, `Ω·∇ - μ (cos φ/ρ) ∂/∂θ + ξ (sin φ cos φ/ρ) ∂/∂φ
+ (1/sin θ){[(ξΩ - e_ρ)·∇n/n] ∂/∂θ + [s₁·∇n/n] ∂/∂φ}`. -/
def newCylStream (n : Vec3 → ℝ) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  dirDot θ φ (newCylGrad (fun y => F y θ φ) q) -
    (Real.sin θ * Real.cos φ * Real.cos φ / q 0) • dTheta F q θ φ +
    (Real.cos θ * Real.sin φ * Real.cos φ / q 0) • dPhi F q θ φ +
    angularStream ((n q)⁻¹ • newCylGrad n q) F q θ φ

/-- Eq. (55) (quoted from Ref. [29]): the Eulerian streaming operator in the spherical coordinates,
`Ω·∇ - (sin θ/ρ) ∂/∂θ - (η cot Θ/ρ) ∂/∂φ + (1/sin θ){[(ξΩ - e_ρ)·∇n/n] ∂/∂θ + [s₁·∇n/n] ∂/∂φ}`. -/
def sphStream (n : Vec3 → ℝ) (F : Vec3 → ℝ → ℝ → Stokes) (q : Vec3) (θ φ : ℝ) : Stokes :=
  dirDot θ φ (sphGrad (fun y => F y θ φ) q) -
    (Real.sin θ / q 2) • dTheta F q θ φ -
    (Real.sin θ * Real.sin φ * Real.cot (q 0) / q 2) • dPhi F q θ φ +
    angularStream ((n q)⁻¹ • sphGrad n q) F q θ φ

end Arxiv1110_5134
Source
Zhao, Tan and Liu, On the Derivation of Vector Radiative Transfer Equation for Polarized Radiative Transport in Graded Index Media, arXiv:1110.5134v1 (2011), Sections 2.1, 3.1-3.3, 4.1-4.2 and Appendix A: Eqs. (1), (14), (20), (23), (31), (42), (46), (49), (52), (55), (64)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Stokes vectors. A Stokes vector is any element of R4\mathbb{R}^4R4. Its components are indexed 0,1,2,30,1,2,30,1,2,3 (conventionally I,Q,U,VI,Q,U,VI,Q,U,V). No constraint is imposed: the components need not satisfy I≥0I \ge 0I≥0 or I2≥Q2+U2+V2I^2 \ge Q^2+U^2+V^2I2≥Q2+U2+V2.

Stokes vector of an ellipse. For arbitrary real numbers I,χ,ψI, \chi, \psiI,χ,ψ, with no sign or range restriction (in particular III may be negative or zero), the vector is defined as

s(I,χ,ψ)=(I,  Icos⁡2χcos⁡2ψ,  Icos⁡2χsin⁡2ψ,  Isin⁡2χ)∈R4.\mathbf{s}(I,\chi,\psi) = \bigl(I,\; I\cos 2\chi\cos 2\psi,\; I\cos 2\chi \sin 2\psi,\; I\sin 2\chi\bigr) \in \mathbb{R}^4 .s(I,χ,ψ)=(I,Icos2χcos2ψ,Icos2χsin2ψ,Isin2χ)∈R4.

Rytov matrix. For any real κ\kappaκ, R(κ)R(\kappa)R(κ) is the real 4×44\times 44×4 matrix whose only nonzero entries are in row 2, column 3, and in row 3, column 2 (counting rows and columns from 1):

R(κ)=(0000002κ00−2κ000000).R(\kappa) = \begin{pmatrix} 0&0&0&0\\ 0&0&2\kappa&0\\ 0&-2\kappa&0&0\\ 0&0&0&0\end{pmatrix}.R(κ)=​0000​00−2κ0​02κ00​0000​​.

These are the entries coupling the QQQ and UUU components. If κ=0\kappa = 0κ=0, this is the zero matrix.

Stokes rotation matrix. For any real angle φ\varphiφ:

R(φ)=(10000cos⁡2φsin⁡2φ00−sin⁡2φcos⁡2φ00001).\mathfrak{R}(\varphi) = \begin{pmatrix} 1&0&0&0\\ 0&\cos 2\varphi&\sin 2\varphi&0\\ 0&-\sin 2\varphi&\cos 2\varphi&0\\ 0&0&0&1\end{pmatrix}.R(φ)=​1000​0cos2φ−sin2φ0​0sin2φcos2φ0​0001​​.

Rotation matrix in terms of a cosine. For any real number ccc, with no restriction to [−1,1][-1,1][−1,1]:

Rcos⁡(c)=(100002c2−12c1−c200−2c1−c22c2−100001).\mathfrak{R}_{\cos}(c) = \begin{pmatrix} 1&0&0&0\\ 0&2c^2-1&2c\sqrt{1-c^2}&0\\ 0&-2c\sqrt{1-c^2}&2c^2-1&0\\ 0&0&0&1\end{pmatrix}.Rcos​(c)=​1000​02c2−1−2c1−c2​0​02c1−c2​2c2−10​0001​​.

Here x\sqrt{x}x​ denotes the real square root with the convention x=0\sqrt{x} = 0x​=0 for x<0x<0x<0. So for ∣c∣>1|c|>1∣c∣>1 the off-diagonal entries are 000 and the middle diagonal entries are 2c2−1>12c^2-1>12c2−1>1. For c∈[−1,1]c\in[-1,1]c∈[−1,1], the square root is nonnegative, so Rcos⁡(c)=R(arccos⁡c)\mathfrak{R}_{\cos}(c) = \mathfrak{R}(\arccos c)Rcos​(c)=R(arccosc), with angle in [0,π][0,\pi][0,π]. Nothing in the definition ties ccc to any angle.

Modified rotation matrix. For any reals σ\sigmaσ and φ\varphiφ, with sgn⁡σ∈{−1,0,1}\operatorname{sgn}\sigma \in \{-1,0,1\}sgnσ∈{−1,0,1} and sgn⁡0=0\operatorname{sgn} 0 = 0sgn0=0:

R~(σ,φ)=12[(1+sgn⁡σ) R(φ)+(1−sgn⁡σ) R(−φ)].\tilde{\mathfrak{R}}(\sigma,\varphi) = \tfrac12\Bigl[(1+\operatorname{sgn}\sigma)\,\mathfrak{R}(\varphi) + (1-\operatorname{sgn}\sigma)\,\mathfrak{R}(-\varphi)\Bigr].R~(σ,φ)=21​[(1+sgnσ)R(φ)+(1−sgnσ)R(−φ)].

This takes three values depending on the sign of σ\sigmaσ:

  • σ>0\sigma>0σ>0: it equals R(φ)\mathfrak{R}(\varphi)R(φ).
  • σ<0\sigma<0σ<0: it equals R(−φ)\mathfrak{R}(-\varphi)R(−φ).
  • σ=0\sigma=0σ=0: it equals 12(R(φ)+R(−φ))=diag⁡(1,cos⁡2φ,cos⁡2φ,1)\tfrac12\bigl(\mathfrak{R}(\varphi)+\mathfrak{R}(-\varphi)\bigr) = \operatorname{diag}(1,\cos2\varphi,\cos2\varphi,1)21​(R(φ)+R(−φ))=diag(1,cos2φ,cos2φ,1), which is not a rotation in general.

Here σ\sigmaσ is just a free real parameter; the definition contains no vectors Ω\OmegaΩ, ν\nuν or eze_zez​.

Handedness matrix. TTT is the constant diagonal matrix

T=diag⁡(1,1,−1,1).T = \operatorname{diag}(1,1,-1,1).T=diag(1,1,−1,1).

Transport operator. Given an arbitrary function n:R→Rn:\mathbb{R}\to\mathbb{R}n:R→R, an arbitrary curve S:R→R4S:\mathbb{R}\to\mathbb{R}^4S:R→R4 and a point sss, define

T[n,S](s)=n(s)2 ddt∣t=s(n(t)−2 S(t)).\mathcal{T}[n,S](s) = n(s)^2\,\frac{d}{dt}\Big|_{t=s}\Bigl(n(t)^{-2}\,S(t)\Bigr).T[n,S](s)=n(s)2dtd​​t=s​(n(t)−2S(t)).

Two conventions apply:

  • n(t)−2n(t)^{-2}n(t)−2 is taken to be 000 wherever n(t)=0n(t)=0n(t)=0.
  • If t↦n(t)−2S(t)t\mapsto n(t)^{-2}S(t)t↦n(t)−2S(t) is not differentiable at sss, the derivative is taken to be the zero vector, so the operator returns 000.

No positivity, smoothness or differentiability of nnn or SSS is assumed. If n(s)=0n(s)=0n(s)=0, the result is 000.

Directions. A direction is a point ω\omegaω of the unit sphere S2={x∈R3:∣x∣=1}S^2=\{x\in\mathbb{R}^3 : |x|=1\}S2={x∈R3:∣x∣=1}, with the Euclidean norm.

Solid-angle measure. The measure dΩd\OmegadΩ on S2S^2S2 is induced from Lebesgue measure on R3\mathbb{R}^3R3 by the cone construction:

dΩ(A)=3⋅vol⁡{rx:0<r<1, x∈A}.d\Omega(A) = 3\cdot \operatorname{vol}\{r x : 0<r<1,\ x\in A\}.dΩ(A)=3⋅vol{rx:0<r<1, x∈A}.

This is the standard surface measure, with total mass 4π4\pi4π.

Scattering source. Given an arbitrary map Z:S2→R4×4Z: S^2\to\mathbb{R}^{4\times 4}Z:S2→R4×4 and an arbitrary map L:S2→R4L: S^2\to\mathbb{R}^4L:S2→R4, define

S[Z,L]=14π∫S2Z(ω) L(ω) dΩ(ω)∈R4,\mathcal{S}[Z,L] = \frac{1}{4\pi}\int_{S^2} Z(\omega)\,L(\omega)\,d\Omega(\omega) \in \mathbb{R}^4,S[Z,L]=4π1​∫S2​Z(ω)L(ω)dΩ(ω)∈R4,

where Z(ω)L(ω)Z(\omega)L(\omega)Z(ω)L(ω) is a matrix-vector product. The integral is the Bochner integral, which is defined to be 000 if ω↦Z(ω)L(ω)\omega\mapsto Z(\omega)L(\omega)ω↦Z(ω)L(ω) is not integrable. The matrix ZZZ depends only on the integration variable ω\omegaω; no "current direction" appears as an argument.

Entrywise matrix derivative. For any M:R→R4×4M:\mathbb{R}\to\mathbb{R}^{4\times4}M:R→R4×4 and any sss, dMds(s)\frac{dM}{ds}(s)dsdM​(s) is the matrix whose (i,j)(i,j)(i,j) entry is the derivative at sss of t↦Mij(t)t\mapsto M_{ij}(t)t↦Mij​(t). Each entry is taken to be 000 where the corresponding entry function is not differentiable at sss.

Vectors in R3\mathbb{R}^3R3. Elements of R3\mathbb{R}^3R3 are plain coordinate triples v=(v0,v1,v2)v=(v_0,v_1,v_2)v=(v0​,v1​,v2​). Their length is ∣v∣=v⋅v|v| = \sqrt{v\cdot v}∣v∣=v⋅v​, the Euclidean norm.

Curvature of a ray. For an arbitrary function Ω:R→R3\Omega:\mathbb{R}\to\mathbb{R}^3Ω:R→R3 and a point sss, the curvature is

K(s)=∣Ω′(s)∣.K(s) = |\Omega'(s)|.K(s)=∣Ω′(s)∣.

Ω\OmegaΩ is not required to have unit length or to be differentiable. If Ω\OmegaΩ is not differentiable at sss, then Ω′(s)\Omega'(s)Ω′(s) is taken to be 000, so K(s)=0K(s)=0K(s)=0.

Principal normal. The normal is

ν(s)=K(s)−1 Ω′(s),\nu(s) = K(s)^{-1}\,\Omega'(s),ν(s)=K(s)−1Ω′(s),

with K−1:=0K^{-1} := 0K−1:=0 when K(s)=0K(s)=0K(s)=0. In that case ν(s)=0\nu(s)=0ν(s)=0. Otherwise ν(s)\nu(s)ν(s) is a unit vector.

Binormal. The binormal is

b(s)=Ω(s)×ν(s),b(s) = \Omega(s)\times\nu(s),b(s)=Ω(s)×ν(s),

the cross product in R3\mathbb{R}^3R3. It is a unit vector only when Ω(s)\Omega(s)Ω(s) is a unit vector orthogonal to the unit vector ν(s)\nu(s)ν(s); neither condition is assumed.

Torsion of a ray. The torsion is

κ(s)=− b(s)⋅ν′(s),\kappa(s) = -\,b(s)\cdot\nu'(s),κ(s)=−b(s)⋅ν′(s),

where ν′(s)\nu'(s)ν′(s) is the derivative at sss of the function t↦ν(t)t\mapsto\nu(t)t↦ν(t) defined above. That derivative is taken to be 000 if ν\nuν is not differentiable at sss, giving κ(s)=0\kappa(s)=0κ(s)=0. Note the explicit minus sign.

Partial derivatives. For a normed real vector space EEE, a function f:R3→Ef:\mathbb{R}^3\to Ef:R3→E, an index i∈{0,1,2}i\in\{0,1,2\}i∈{0,1,2} and a point qqq, ∂if(q)\partial_i f(q)∂i​f(q) is the derivative at r=qir=q_ir=qi​ of r↦f(q with its i-th coordinate replaced by r)r\mapsto f(q \text{ with its } i\text{-th coordinate replaced by } r)r↦f(q with its i-th coordinate replaced by r). It is taken to be 000 if that one-variable function is not differentiable there.

Direction components. For real θ,φ\theta,\varphiθ,φ:

Ω(θ,φ)=(sin⁡θcos⁡φ, sin⁡θsin⁡φ, cos⁡θ).\Omega(\theta,\varphi) = (\sin\theta\cos\varphi,\ \sin\theta\sin\varphi,\ \cos\theta).Ω(θ,φ)=(sinθcosφ, sinθsinφ, cosθ).

Auxiliary vector. For real φ\varphiφ:

s1(φ)=(−sin⁡φ, cos⁡φ, 0).s_1(\varphi) = (-\sin\varphi,\ \cos\varphi,\ 0).s1​(φ)=(−sinφ, cosφ, 0).

Polar axis. The polar axis is the constant vector e3=(0,0,1)e_3 = (0,0,1)e3​=(0,0,1).

These three are bare coordinate triples. No frame, basis or coordinate system is attached to them.

Gradient formulas. For f:R3→Ef:\mathbb{R}^3\to Ef:R3→E and q=(q0,q1,q2)q=(q_0,q_1,q_2)q=(q0​,q1​,q2​), with no restriction on qqq, four triples in E3E^3E3 are defined. Throughout, x−1:=0x^{-1} := 0x−1:=0 when x=0x=0x=0.

  • Cartesian:
∇cf(q)=(∂0f, ∂1f, ∂2f)(q).\nabla^{\mathrm{c}} f(q) = \bigl(\partial_0 f,\ \partial_1 f,\ \partial_2 f\bigr)(q).∇cf(q)=(∂0​f, ∂1​f, ∂2​f)(q).
  • Traditional cylindrical:
∇tcf(q)=(∂0f, q0−1∂1f, ∂2f)(q).\nabla^{\mathrm{tc}} f(q) = \bigl(\partial_0 f,\ q_0^{-1}\partial_1 f,\ \partial_2 f\bigr)(q).∇tcf(q)=(∂0​f, q0−1​∂1​f, ∂2​f)(q).
  • New cylindrical:
∇ncf(q)=(q0−1∂1f, ∂2f, ∂0f)(q).\nabla^{\mathrm{nc}} f(q) = \bigl(q_0^{-1}\partial_1 f,\ \partial_2 f,\ \partial_0 f\bigr)(q).∇ncf(q)=(q0−1​∂1​f, ∂2​f, ∂0​f)(q).
  • Spherical:
∇sphf(q)=(q2−1∂0f, (q2sin⁡q0)−1∂1f, ∂2f)(q).\nabla^{\mathrm{sph}} f(q) = \bigl(q_2^{-1}\partial_0 f,\ (q_2\sin q_0)^{-1}\partial_1 f,\ \partial_2 f\bigr)(q).∇sphf(q)=(q2−1​∂0​f, (q2​sinq0​)−1∂1​f, ∂2​f)(q).

For example, at q0=0q_0=0q0​=0 the second component of ∇tcf\nabla^{\mathrm{tc}}f∇tcf is 000. In the spherical formula, the second component is 000 whenever q2=0q_2=0q2​=0 or sin⁡q0=0\sin q_0=0sinq0​=0. Also, q0q_0q0​ is not required to be positive, and q2q_2q2​ is not required to be nonzero.

Direction dot product. For G=(G0,G1,G2)∈E3G=(G_0,G_1,G_2)\in E^3G=(G0​,G1​,G2​)∈E3:

Ω⋅G=∑i=02Ωi(θ,φ) Gi.\Omega\cdot G = \sum_{i=0}^{2}\Omega_i(\theta,\varphi)\,G_i .Ω⋅G=i=0∑2​Ωi​(θ,φ)Gi​.

Angular partial derivatives. For a field F:R3×R×R→R4F:\mathbb{R}^3\times\mathbb{R}\times\mathbb{R}\to\mathbb{R}^4F:R3×R×R→R4, written F(q,θ,φ)F(q,\theta,\varphi)F(q,θ,φ):

  • ∂θF(q,θ,φ)\partial_\theta F(q,\theta,\varphi)∂θ​F(q,θ,φ) is the derivative of θ′↦F(q,θ′,φ)\theta'\mapsto F(q,\theta',\varphi)θ′↦F(q,θ′,φ) at θ\thetaθ.
  • ∂φF(q,θ,φ)\partial_\varphi F(q,\theta,\varphi)∂φ​F(q,θ,φ) is the derivative of φ′↦F(q,θ,φ′)\varphi'\mapsto F(q,\theta,\varphi')φ′↦F(q,θ,φ′) at φ\varphiφ.

Each is 000 if the corresponding function is not differentiable there.

Angular redistribution term. For a fixed vector g∈R3g\in\mathbb{R}^3g∈R3, the field FFF, and q,θ,φq,\theta,\varphiq,θ,φ:

A[g,F](q,θ,φ)=1sin⁡θ{[(cos⁡θ Ω(θ,φ)−e3)⋅g] ∂θF+[s1(φ)⋅g] ∂φF}.\mathcal{A}[g,F](q,\theta,\varphi) = \frac{1}{\sin\theta}\Bigl\{\bigl[(\cos\theta\,\Omega(\theta,\varphi)-e_3)\cdot g\bigr]\,\partial_\theta F + \bigl[s_1(\varphi)\cdot g\bigr]\,\partial_\varphi F\Bigr\}.A[g,F](q,θ,φ)=sinθ1​{[(cosθΩ(θ,φ)−e3​)⋅g]∂θ​F+[s1​(φ)⋅g]∂φ​F}.

Here (sin⁡θ)−1:=0(\sin\theta)^{-1} := 0(sinθ)−1:=0 when sin⁡θ=0\sin\theta=0sinθ=0, so the whole term vanishes at θ∈πZ\theta\in\pi\mathbb{Z}θ∈πZ.

Conservative angular term. With the same inputs:

Acons[g,F](q,θ,φ)=1sin⁡θ{∂∂θ′∣θ([(cos⁡θ′ Ω(θ′,φ)−e3)⋅g]F(q,θ′,φ))+∂∂φ′∣φ([s1(φ′)⋅g]F(q,θ,φ′))}.\mathcal{A}^{\mathrm{cons}}[g,F](q,\theta,\varphi) = \frac{1}{\sin\theta}\Bigl\{\frac{\partial}{\partial\theta'}\Big|_{\theta}\Bigl(\bigl[(\cos\theta'\,\Omega(\theta',\varphi)-e_3)\cdot g\bigr]F(q,\theta',\varphi)\Bigr) + \frac{\partial}{\partial\varphi'}\Big|_{\varphi}\Bigl(\bigl[s_1(\varphi')\cdot g\bigr]F(q,\theta,\varphi')\Bigr)\Bigr\}.Acons[g,F](q,θ,φ)=sinθ1​{∂θ′∂​​θ​([(cosθ′Ω(θ′,φ)−e3​)⋅g]F(q,θ′,φ))+∂φ′∂​​φ​([s1​(φ′)⋅g]F(q,θ,φ′))}.

The same conventions apply: nondifferentiable means a 000 derivative, and (sin⁡θ)−1=0(\sin\theta)^{-1}=0(sinθ)−1=0 when sin⁡θ=0\sin\theta=0sinθ=0. The vector ggg is held fixed and does not vary with the angles.

Streaming operators. For an arbitrary function n:R3→Rn:\mathbb{R}^3\to\mathbb{R}n:R3→R (not assumed positive or differentiable), a field FFF, and q,θ,φq,\theta,\varphiq,θ,φ, write ∇qF\nabla_q F∇q​F for the chosen gradient formula applied to q↦F(q,θ,φ)q\mapsto F(q,\theta,\varphi)q↦F(q,θ,φ) with the angles held fixed. Each operator uses the matching gradient formula for ggg, and the convention n(q)−1:=0n(q)^{-1}:=0n(q)−1:=0 applies, so g=0g=0g=0 where n(q)=0n(q)=0n(q)=0. Division by 000 yields 000 throughout.

  • Cartesian:
Ω⋅∇qcF+A[n(q)−1∇cn(q),F].\Omega\cdot\nabla^{\mathrm{c}}_qF + \mathcal{A}\bigl[n(q)^{-1}\nabla^{\mathrm{c}}n(q),F\bigr].Ω⋅∇qc​F+A[n(q)−1∇cn(q),F].
  • Traditional cylindrical:
Ω⋅∇qtcF−sin⁡θsin⁡φq0 ∂φF+A[n(q)−1∇tcn(q),F].\Omega\cdot\nabla^{\mathrm{tc}}_qF - \frac{\sin\theta\sin\varphi}{q_0}\,\partial_\varphi F + \mathcal{A}\bigl[n(q)^{-1}\nabla^{\mathrm{tc}}n(q),F\bigr].Ω⋅∇qtc​F−q0​sinθsinφ​∂φ​F+A[n(q)−1∇tcn(q),F].
  • New cylindrical:
Ω⋅∇qncF−sin⁡θcos⁡2φq0 ∂θF+cos⁡θsin⁡φcos⁡φq0 ∂φF+A[n(q)−1∇ncn(q),F].\Omega\cdot\nabla^{\mathrm{nc}}_qF - \frac{\sin\theta\cos^2\varphi}{q_0}\,\partial_\theta F + \frac{\cos\theta\sin\varphi\cos\varphi}{q_0}\,\partial_\varphi F + \mathcal{A}\bigl[n(q)^{-1}\nabla^{\mathrm{nc}}n(q),F\bigr].Ω⋅∇qnc​F−q0​sinθcos2φ​∂θ​F+q0​cosθsinφcosφ​∂φ​F+A[n(q)−1∇ncn(q),F].
  • Spherical:
Ω⋅∇qsphF−sin⁡θq2 ∂θF−sin⁡θsin⁡φcot⁡q0q2 ∂φF+A[n(q)−1∇sphn(q),F].\Omega\cdot\nabla^{\mathrm{sph}}_qF - \frac{\sin\theta}{q_2}\,\partial_\theta F - \frac{\sin\theta\sin\varphi\cot q_0}{q_2}\,\partial_\varphi F + \mathcal{A}\bigl[n(q)^{-1}\nabla^{\mathrm{sph}}n(q),F\bigr].Ω⋅∇qsph​F−q2​sinθ​∂θ​F−q2​sinθsinφcotq0​​∂φ​F+A[n(q)−1∇sphn(q),F].

Here cot⁡q0:=cos⁡q0/sin⁡q0\cot q_0 := \cos q_0/\sin q_0cotq0​:=cosq0​/sinq0​, with value 000 when sin⁡q0=0\sin q_0=0sinq0​=0.

In all four operators, Ω=Ω(θ,φ)\Omega=\Omega(\theta,\varphi)Ω=Ω(θ,φ) and every term is evaluated at (q,θ,φ)(q,\theta,\varphi)(q,θ,φ). The coordinates qqq are an unconstrained real triple: the definitions contain no geometric change of variables, only these explicit formulas.

Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me