Quantum 6j scalars and symmetric tridiagonal matrix
DefinitionQuantumSixJScalarThe scalar quantities for the generic quantum recurrence are defined over , where is an indeterminate. For every integer , , and is the product of the positive-index quantum integers up to when , and zero otherwise. In particular .
A label triple is admissible when its entries are nonnegative, satisfy the triangle inequalities, and have even sum. The horizontal channel uses the triples and , and the vertical channel uses and . The loop , theta evaluation , norms , and eigenvalue are the Appendix rational functions with the specified zero extensions.
For fixed , L a b c d j k is the full symmetric matrix entry . The diagonal is the explicit diagonal formula, with ; off-diagonal entries occur only at . Their common expression uses and :
when both horizontal channels are admissible, and zero otherwise. Thus the matrix is symmetric and tridiagonal on each parity lattice, without a separate symmetry hypothesis.
The tetrahedral sum tetSum is defined by the Appendix factorial prefactor and the finite sum over , using the four half-sums and three half-sums in that formula. It is zero unless both channels are admissible. normalizedTetSum is this sum divided by . Division is total field division, with inverse of zero equal to zero; these conventions do not define specialization at complex poles.
These are definitions, not assumptions of the recurrence. The recurrence itself is a separate theorem. Diagrammatic conventions follow Kauffman–Lins.
import Mathlib
/-! Rational-function quantities for the quantum 6j recurrence.
The scalar Tet is the Appendix finite sum; L is the two-index matrix in equation (24).
-/
noncomputable section
namespace QuantumSixJ
open scoped BigOperators
open scoped Classical
abbrev Scalar := RatFunc ℚ
def q : Scalar := algebraMap (Polynomial ℚ) Scalar Polynomial.X
def qInt (n : ℤ) : Scalar := (q ^ n - q ^ (-n)) / (q - q⁻¹)
def qFactorial (n : ℤ) : Scalar :=
if n < 0 then 0 else ∏ k ∈ Finset.Icc (1 : ℤ) n, qInt k
scoped notation "⟬" n "⟭" => qInt n
scoped notation "⟬" n "⟭!" => qFactorial n
open scoped QuantumSixJ
def Admissible (a b c : ℤ) : Prop :=
0 ≤ a ∧ 0 ≤ b ∧ 0 ≤ c ∧ a ≤ b + c ∧ b ≤ c + a ∧ c ≤ a + b ∧ (a + b + c) % 2 = 0
def hAdmissible (a b c d j : ℤ) : Prop := Admissible a d j ∧ Admissible b c j
def vAdmissible (a b c d l : ℤ) : Prop := Admissible a b l ∧ Admissible c d l
def Δ (j : ℤ) : Scalar :=
if 0 ≤ j then (-1 : Scalar) ^ j * ⟬j + 1⟭ else 0
def θ (a b c : ℤ) : Scalar :=
if Admissible a b c then
let s := (a + b + c) / 2
(-1 : Scalar) ^ s * ⟬s + 1⟭! * ⟬s - a⟭! * ⟬s - b⟭! * ⟬s - c⟭! /
(⟬a⟭! * ⟬b⟭! * ⟬c⟭!)
else 0
def h (a b c d j : ℤ) : Scalar :=
if hAdmissible a b c d j then θ a d j * θ b c j / Δ j else 0
def x (a b c d l : ℤ) : Scalar :=
if vAdmissible a b c d l then θ a b l * θ c d l / Δ l else 0
def Λ (a b l : ℤ) : Scalar :=
if Admissible a b l then
(⟬(a - b + l) / 2⟭ * ⟬(-a + b + l) / 2⟭ -
⟬(a + b - l) / 2⟭ * ⟬(a + b + l) / 2 + 2⟭) / ⟬2⟭
else 0
/-- The symmetric matrix of equation (24), tridiagonal on each parity lattice.
Entries outside the diagonal and the two step-2 diagonals are zero.
-/
def L (a b c d j k : ℤ) : Scalar :=
if j = k then
if hAdmissible a b c d j ∧ j ≠ 0 then
-h a b c d j * ⟬2⟭ * Λ a j d * Λ b j c / (⟬j⟭ * ⟬j + 2⟭)
else 0
else if k = j + 2 ∨ j = k + 2 then
let m := min j k
let n := max j k
if hAdmissible a b c d m ∧ hAdmissible a b c d n then
h a b c d n * ⟬(a + d - m) / 2⟭ * ⟬(b + c - m) / 2⟭
else 0
else 0
def tetA (a b c d j l : ℤ) : Fin 4 → ℤ :=
![(a + d + j) / 2, (b + c + j) / 2, (a + b + l) / 2, (c + d + l) / 2]
def tetB (a b c d j l : ℤ) : Fin 3 → ℤ :=
![(b + d + j + l) / 2, (a + c + j + l) / 2, (a + b + c + d) / 2]
def tetSummand (a b c d j l S : ℤ) : Scalar :=
let A := tetA a b c d j l
let B := tetB a b c d j l
(-1 : Scalar) ^ S * ⟬S + 1⟭! /
((∏ i : Fin 4, ⟬S - A i⟭!) * (∏ k : Fin 3, ⟬B k - S⟭!))
def tetSum (a b c d j l : ℤ) : Scalar :=
if hAdmissible a b c d j ∧ vAdmissible a b c d l then
((∏ i : Fin 4, ∏ k : Fin 3, ⟬tetB a b c d j l k - tetA a b c d j l i⟭!) /
(⟬a⟭! * ⟬b⟭! * ⟬c⟭! * ⟬d⟭! * ⟬j⟭! * ⟬l⟭!)) *
∑ S ∈ Finset.Icc 0 (a + b + c + d + j + l), tetSummand a b c d j l S
else 0
def normalizedTetSum (a b c d j l : ℤ) : Scalar :=
tetSum a b c d j l / h a b c d j
end QuantumSixJ
end
Read-back
What the Lean code literally says, in plain math · openai/gpt-6.1-sol
Scalar definitions
All label and summation variables below are integers, including zero and negative integers, unless another domain is specified. Every scalar operation takes place in the rational-function field described below. Integer powers use inverses for negative exponents. Division is total field division: the inverse of zero is zero, so a quotient with denominator zero is zero, including . Every occurrence of integer division by means , also for negative or odd ; it is not rational division. Finite products over empty sets equal , and finite sums over empty sets equal .
Scalar
The scalar field is , the field of rational functions in one indeterminate with rational coefficients. No numerical value of the indeterminate, specialization map, or root-of-unity condition is included.
q
The scalar is the image of the polynomial indeterminate under the canonical map .
qInt
For every , the quantum integer, denoted , is . This is a signed-index definition, not a definition restricted to natural numbers: in particular and . The bracket notation always denotes this function.
qFactorial
For every , define to be when , and when . Thus by the empty-product convention; a negative-index factorial is zero, not an inverse factorial. The factorial bracket notation denotes this function.
Admissible
For , the predicate is the conjunction , , , , , , and . There is no additional upper bound or truncation condition, and zero labels are permitted.
hAdmissible
For , horizontal admissibility means , with each admissibility predicate imposing exactly the nonnegativity, three triangle inequalities, and even-sum condition just specified. In particular the channel must be nonnegative, must lie between both and and between both and , and must have the parities of both and .
vAdmissible
For , vertical admissibility means , with the same explicit nonnegativity, triangle, and parity conditions. In particular must be nonnegative, lie in both intervals and , and have the parities of both and .
Δ
For every , the scalar is when , and is zero when . Thus the sign is the integer-power sign in , and .
θ
For every , set if fails. Otherwise put and define . In this branch evenness makes the exact half-sum, and the triangle conditions make nonnegative; all signs, products, and divisions still take their values in under the conventions above.
h
For every , define if holds, and define it to be zero otherwise. Here requires the two explicitly specified admissible triples and ; the theta and delta factors are the signed factorial and bracket expressions above. Negative channels, negative external labels, and all triangle or parity failures therefore give zero through this guard.
x
For every , define if holds, and define it to be zero otherwise. Thus its guard is admissibility of and , and its factors are the same signed theta and delta expressions, with all inadmissible and negative-label cases assigned zero.
Λ
For every , define unless holds; in the admissible branch define . The belongs inside the last quantum integer but outside the division by . The parity guard makes these half-integer expressions integral before that final addition. This scalar has only the three displayed arguments; no admissibility involving other labels is imposed.
L
For every , define the two-index matrix entry as follows. If , it is when holds and , and is zero otherwise. If and either or , put and ; the entry is when both and hold, and is zero otherwise. In every other case it is zero. The diagonal branch is tested first, and its exceptional value at is explicitly zero even when that channel is admissible. The off-diagonal factor uses the norm at the larger index and the bracket arguments formed from the smaller index, in both directions. Consequently the definition is symmetric in the matrix indices, , and has support only on with both channels horizontally admissible; an entry satisfying those necessary conditions may still be zero. On either fixed parity lattice this is a symmetric tridiagonal matrix, not an assertion of support at distance one on the full integer lattice. No symmetry in the four external labels or recurrence identity is part of this definition.
tetA
For every , define an integer-valued array with four ordered positions indexed by by . There is no admissibility guard on this array, so the floor convention applies to arbitrary signed inputs.
tetB
For every , define an integer-valued array with three ordered positions indexed by by . This array too is defined without any admissibility guard, including on negative and odd numerators.
tetSummand
For every , form the arrays and just specified and define . There is no explicit admissibility, nonnegativity, or interval guard on this summand. If any denominator factorial has negative argument, it is zero and total division makes the whole summand zero. In particular a nonzero summand requires every , and gives zero through its numerator factorial. Negative is not itself a guard: uses in the numerator, and the sign is defined by integer powers for every .
tetSum
For every , define the Appendix factorial sum to be zero unless both and hold, that is, unless all four triples are admissible with nonnegative labels, triangle inequalities, and even sums. In the guarded branch put and use the arrays above to define
The defining sum includes both endpoints of the coarse integer interval ; it is not defined by taking extrema of and or by summing over every integer. An interval with would be empty, although this guarded branch has . Terms with negative denominator-factorial arguments are zero by total division, not omitted by a separate summand guard. The prefactor contains all twelve ordered pairs of array positions. In particular, when all six labels are zero this expression has one summation term and equals .
normalizedTetSum
For every , the normalized sum is , where is the guarded factorial sum and is the guarded product above. This definition adds no admissibility or nonzero-denominator hypothesis. If horizontal admissibility fails, both numerator and denominator are zero and the value is ; if vertical admissibility fails, the numerator is zero and the quotient is again zero. Any zero denominator has the same total-field interpretation, rather than an undefined value. No recurrence, matrix eigenvector equation, or identity with a separately defined object is asserted here.