Documentation

Lightlike.Tests.SixJ

Audit of Physlib's 6j symbols against standard values #

We build Milestones 4–5 on PhyslibAlpha's 6j symbols (PhyslibAlpha.Sl2.sixJSym, Physlib commit cdfa609, Alpha tier). As with the curvature definitions, we first check that the definition gives the standard numbers, by Lean proofs (kernel-checked, no sorry) evaluating their definition - a sum over projections of four Racah-formula 3j symbols - at concrete arguments.

Method: restrict the 6j sum to the projection tuples where all four 3j symbols are admissible (completeness of that list is checked by kernel decide over the whole projection box), then evaluate each 3j symbol exactly (factorials, Real.sqrt, Racah's alternating sum).

Reference values: computed independently with SymPy's wigner_6j (Racah's formula), and agree with the standard closed form for a zero argument {a b c; 0 c b} = (-1)^(a+b+c)/√((2b+1)(2c+1)).

6j symboldoubled argumentsvaluetheorem
{0 0 0; 0 0 0}0 0 0 0 0 01sixJ_000000
{½ ½ 0; ½ ½ 0}1 1 0 1 1 0-1/2sixJ_hh0_hh0
{½ ½ 1; ½ ½ 0}1 1 2 1 1 01/2sixJ_hh1_hh0
{½ ½ 0; ½ ½ 1}1 1 0 1 1 21/2sixJ_hh0_hh1
{½ ½ 1; ½ ½ 1}1 1 2 1 1 21/6sixJ_hh1_hh1
{1 1 1; 1 1 0}2 2 2 2 2 0-1/3sixJ_111_110
{1 1 1; ½ ½ ½}2 2 2 1 1 1-1/3sixJ_111_hhh
{1 1 3; 1 1 1}2 2 6 2 2 20 (triangle rule)sixJ_113_111
{½ ½ ½; ½ ½ ½}1 1 1 1 1 10 (½+½+½ not an integer)sixJ_hhh_hhh
{2 2 1; 1 1 1}4 4 2 2 2 2-√5/10sixJ_221_111
{2 2 2; 1 1 1}4 4 4 2 2 2√21/30sixJ_222_111
{2 2 2; 2 2 2}4 4 4 4 4 4-3/70sixJ_222_222
{5/2 5/2 1; ½ ½ 2}5 5 2 1 1 4√35/30sixJ_5h5h1_hh2
{5/2 5/2 1; 5/2 5/2 1}5 5 2 5 5 2-31/210sixJ_5h5h1_5h5h1

The last five (spins 2 and 5/2, no zero argument) are evaluated through sixJSym_eq_triple, a general reduction of the 6j sum to three free projections; see the section "Larger spins".

The signs (−1/2, −1/3) confirm the standard Racah–Wigner phase convention; half-integer spins are covered. General vanishing lemmas: sixJSym_eq_zero_of_triangle, sixJSym_eq_zero_of_parity.

Conventions (for Ponzano–Regge) #

theorem Lightlike.SixJAudit.sixSum_eq_sum (a₁ a₂ a₃ b₁ b₂ b₃ : ℤ) :
PhyslibAlpha.Sl2.sixSum a₁ a₂ a₃ b₁ b₂ b₃ = ∑ z ∈ Finset.Icc a₁ b₁, PhyslibAlpha.Sl2.sixTerm a₁ a₂ a₃ b₁ b₂ b₃ z

sixSum as a finite sum over z ∈ [a₁, b₁] (outside, invFact of a negative argument is 0).

theorem Lightlike.SixJAudit.sixJTerm_eq_zero {j₁ j₂ j₃ j₄ j₅ j₆ : ℕ} {m : Fin 6 → ℤ} (h : ¬(PhyslibAlpha.Sl2.Adm3 j₁ j₂ j₃ (-m 0) (-m 1) (-m 2) ∧ PhyslibAlpha.Sl2.Adm3 j₁ j₅ j₆ (m 0) (-m 4) (m 5) ∧ PhyslibAlpha.Sl2.Adm3 j₄ j₂ j₆ (m 3) (m 1) (-m 5) ∧ PhyslibAlpha.Sl2.Adm3 j₄ j₅ j₃ (-m 3) (m 4) (m 2))) :
PhyslibAlpha.Sl2.sixJTerm j₁ j₂ j₃ j₄ j₅ j₆ m = 0

A sixJTerm vanishes unless all four 3j symbols are admissible.

theorem Lightlike.SixJAudit.sum_Icc_int (a b : ℤ) (f : ℤ → ℝ) :
∑ z ∈ Finset.Icc a b, f z = ∑ i ∈ Finset.range (b - a + 1).toNat, f (a + ↑i)

Sums over an integer interval as sums over range, so that simp can unroll them.

def Lightlike.SixJAudit.adm4 (j₁ j₂ j₃ j₄ j₅ j₆ : ℕ) (m : Fin 6 → ℤ) :

All four 3j symbols of a sixJTerm are admissible (as a Bool, so decide needs only one generic Decidable instance).

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem Lightlike.SixJAudit.sixJSym_eq_list (j₁ j₂ j₃ j₄ j₅ j₆ : ℕ) (l : List (Fin 6 → ℤ)) (hnd : l.Nodup) (hS : ∀ m ∈ l, m ∈ PhyslibAlpha.Sl2.sixJBox j₁ j₂ j₃ j₄ j₅ j₆) (hz : ∀ m ∈ PhyslibAlpha.Sl2.sixJBox j₁ j₂ j₃ j₄ j₅ j₆, m ∉ l.toFinset → adm4 j₁ j₂ j₃ j₄ j₅ j₆ m = false) :
    PhyslibAlpha.Sl2.sixJSym j₁ j₂ j₃ j₄ j₅ j₆ = (List.map (PhyslibAlpha.Sl2.sixJTerm j₁ j₂ j₃ j₄ j₅ j₆) l).sum

    Restrict the 6j sum to an explicit duplicate-free list l of projection tuples, given that every other tuple in the box has an inadmissible 3j symbol (checked by decide).

    theorem Lightlike.SixJAudit.sixJSym_eq_zero_of_triangle {j₁ j₂ j₃ j₄ j₅ j₆ : ℕ} (h : j₁ + j₂ < j₃) :
    PhyslibAlpha.Sl2.sixJSym j₁ j₂ j₃ j₄ j₅ j₆ = 0

    A 6j symbol whose first triad violates the triangle inequality vanishes.

    theorem Lightlike.SixJAudit.sixJSym_eq_zero_of_parity {j₁ j₂ j₃ j₄ j₅ j₆ : ℕ} (h : (j₁ + j₂ + j₃) % 2 = 1) :
    PhyslibAlpha.Sl2.sixJSym j₁ j₂ j₃ j₄ j₅ j₆ = 0

    A 6j symbol whose first triad has odd (doubled) perimeter - i.e. j₁ + j₂ + j₃ is not an integer - vanishes.

    theorem Lightlike.SixJAudit.sqrt_pow_four {x : ℝ} (hx : 0 ≤ x) :
    √x ^ 4 = x ^ 2

    {0 0 0; 0 0 0} = 1.

    {½ ½ 0; ½ ½ 0} = -½ (half-integer spins; doubled arguments 1 1 0 1 1 0).

    {½ ½ 1; ½ ½ 0} = ½ (doubled 1 1 2 1 1 0).

    {½ ½ 1; ½ ½ 1} = 1/6 (half-integer spins, no zero argument; doubled 1 1 2 1 1 2).

    {1 1 1; 1 1 0} = -1/3 (integer spins; doubled 2 2 2 2 2 0).

    {1 1 3; 1 1 1} = 0 by the triangle rule (3 > 1 + 1; doubled 2 2 6 2 2 2).

    {½ ½ ½; ½ ½ ½} = 0: ½ + ½ + ½ is not an integer (doubled perimeter 3 is odd).

    {½ ½ 0; ½ ½ 1} = ½ (doubled 1 1 0 1 1 2).

    {1 1 1; ½ ½ ½} = -1/3 (doubled 2 2 2 1 1 1).

    Larger spins (2 and 5/2) #

    The decide over the whole projection box used above does not scale: at spin 2 the box has 9⁶ = 531 441 tuples. sixJSym_eq_triple instead reduces the sum, for all spins, to the three free projections m₁, m₂, m₄ (admissibility of the 3j symbols fixes the other three). The values are then sums of products of square roots, closed by surd_finish: split every √n over the primes 2, 3, 5, 7 (sqrt_split_n, each proven by squaring), clear denominators, reduce powers.

    def Lightlike.SixJAudit.mTuple (j₁ j₂ j₄ : ℕ) (p : ℕ × ℕ × ℕ) :
    Fin 6 → ℤ

    The projection tuple fixed by the free projections m₁ = 2i - j₁, m₂ = 2k - j₂, m₄ = 2l - j₄; the other three are forced by the zero-sum condition of the 3j symbols.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Lightlike.SixJAudit.mTuple_apply (j₁ j₂ j₄ i k l : ℕ) :
      mTuple j₁ j₂ j₄ (i, k, l) 0 = 2 * ↑i - ↑j₁ ∧ mTuple j₁ j₂ j₄ (i, k, l) 1 = 2 * ↑k - ↑j₂ ∧ mTuple j₁ j₂ j₄ (i, k, l) 2 = -(2 * ↑i - ↑j₁) - (2 * ↑k - ↑j₂) ∧ mTuple j₁ j₂ j₄ (i, k, l) 3 = 2 * ↑l - ↑j₄ ∧ mTuple j₁ j₂ j₄ (i, k, l) 4 = 2 * ↑l - ↑j₄ + (2 * ↑i - ↑j₁) + (2 * ↑k - ↑j₂) ∧ mTuple j₁ j₂ j₄ (i, k, l) 5 = 2 * ↑l - ↑j₄ + (2 * ↑k - ↑j₂)
      theorem Lightlike.SixJAudit.sixJBox_triple_mem {j₁ j₂ j₃ j₄ j₅ j₆ : ℕ} {m : Fin 6 → ℤ} (hm : PhyslibAlpha.Sl2.sixJTerm j₁ j₂ j₃ j₄ j₅ j₆ m ≠ 0) :
      m ∈ PhyslibAlpha.Sl2.sixJBox j₁ j₂ j₃ j₄ j₅ j₆ ∧ m ∈ Finset.image (mTuple j₁ j₂ j₄) (Finset.range (j₁ + 1) ×ˢ Finset.range (j₂ + 1) ×ˢ Finset.range (j₄ + 1))
      theorem Lightlike.SixJAudit.sixJSym_eq_triple (j₁ j₂ j₃ j₄ j₅ j₆ : ℕ) :
      PhyslibAlpha.Sl2.sixJSym j₁ j₂ j₃ j₄ j₅ j₆ = ∑ i ∈ Finset.range (j₁ + 1), ∑ k ∈ Finset.range (j₂ + 1), ∑ l ∈ Finset.range (j₄ + 1), PhyslibAlpha.Sl2.sixJTerm j₁ j₂ j₃ j₄ j₅ j₆ (mTuple j₁ j₂ j₄ (i, k, l))

      The 6j sum over three free projections. Only tuples with admissible 3j symbols contribute (sixJTerm_eq_zero); admissibility fixes m₃, m₅, m₆ from m₁, m₂, m₄ and makes each jᵢ - mᵢ even. So the sum over the ∏ (jᵢ + 1)-element box reduces to (j₁ + 1)(j₂ + 1)(j₄ + 1) terms, which norm_num unrolls without a kernel decide over the box.

      theorem Lightlike.SixJAudit.sqrt_pow_red {x : ℝ} (hx : 0 ≤ x) :
      √x ^ 2 = x ∧ √x ^ 3 = x * √x ∧ √x ^ 4 = x ^ 2 ∧ √x ^ 5 = x ^ 2 * √x ∧ √x ^ 6 = x ^ 3 ∧ √x ^ 7 = x ^ 3 * √x ∧ √x ^ 8 = x ^ 4

      Powers of a square root, reduced (0 ≤ x).

      Prove a square-root splitting √n = a * (√p * …) by squaring both sides.

      Equations
      Instances For

        Finish an identity between sums of products of square roots of small integers.

        Equations
        Instances For

          {2 2 1; 1 1 1} = -√5/10 (doubled 4 4 2 2 2 2; no zero argument).

          {2 2 2; 1 1 1} = √21/30 (doubled 4 4 4 2 2 2; no zero argument).

          {2 2 2; 2 2 2} = -3/70 (doubled 4 4 4 4 4 4; no zero argument).

          {5/2 5/2 1; ½ ½ 2} = √35/30 (doubled 5 5 2 1 1 4; no zero argument).

          {5/2 5/2 1; 5/2 5/2 1} = -31/210 (doubled 5 5 2 5 5 2; no zero argument).