jacopy.brackets.GradedBracket¶
- class jacopy.brackets.GradedBracket(name, *, degree=0, is_graded_antisymmetric=True, satisfies_leibniz=True, satisfies_graded_jacobi=True)¶
Bases:
ABCAbstract graded bracket on a graded module.
Subclasses declare their degree and axiom flags via
__init__and implementexpand(). The default axiom flags reflect the most common case (degree 0, antisymmetric, Leibniz, Jacobi holds); override in subclasses for anything exotic.- Parameters:
- __init__(name, *, degree=0, is_graded_antisymmetric=True, satisfies_leibniz=True, satisfies_graded_jacobi=True)¶
Methods
__init__(name, *[, degree, ...])claimed_swap_sign(a, b[, registry])εin the graded-antisymmetry CLAIM[a, b] = ε·[b, a]:ε = −(−1)^{s(a)s(b)}withs=operand_degree().expand(a, b[, registry])Return the definitional expansion of
[a, b].graded_antisymmetry_obstruction(a, b[, registry])[a, b] + (−1)^{s(a)s(b)} [b, a](= [a, b] − ε[b, a]withε=claimed_swap_sign()).graded_jacobi_obstruction(a, b, c[, registry])grading_degree(x[, registry])|x|— the operand's degree in the module's own grading (the grading ofmodule_product()).jacobi_term_sign(A, B, C[, registry])Sign
(−1)^{s(A)s(C)}of the[A, [B, C]]summand in the cyclic graded JacobiΣ_cyc (−1)^{s(A)s(C)} [A, [B, C]] = 0(s=operand_degree()).leibniz_obstruction(a, b, c[, registry])[a, b·c] − [a, b]·c − (−1)^{s(a)|b|} b·[a, c],·=module_product(), sign fromleibniz_term_sign().leibniz_term_sign(a, b[, registry])Sign
(−1)^{s(a)|b|}ofb·[a, c]in the Leibniz claim[a, b·c] = [a, b]·c + (−1)^{s(a)|b|} b·[a, c]:ad_ahas degrees(a) = |a| + kand passesbof UNSHIFTED degree|b|.module_product(b, c)The product the Leibniz axiom distributes over (default:
Product).operand_degree(x[, registry])s(x) = |x| + k— the SHIFTED degree in which the bracket is graded antisymmetric and satisfies graded Jacobi.pair_swap_sign(a, b[, registry])Sign
εsuch that[a, b] = ε·[b, a]HOLDS — a rewrite licence:claimed_swap_sign()for a bracket asserted graded antisymmetric,None(decline: do not rewrite) for any other bracket, a symbolic parity OR an undeterminable operand degree (a licence never raises — an unknown degree means no rule fires, no closure).Attributes
degreeis_graded_antisymmetricnamethe bracket's degree there (default:
degree; for SN it is−1in the multivector grading althoughdegreeis recorded in the already-shifted convention).True / False / None (conditional).
satisfies_leibniz- grading_degree(x, registry=None)¶
|x|— the operand’s degree in the module’s own grading (the grading ofmodule_product()). Default: the operator gradingdegree_of(). RaisesValueErrorwhen the degree is undeterminable.- Parameters:
x (Expr)
registry (PropertyRegistry | None)
- Return type:
Degree
- property operand_shift: Degree¶
the bracket’s degree there (default:
degree; for SN it is−1in the multivector grading althoughdegreeis recorded in the already-shifted convention).- Type:
kmeasured ingrading_degree()’s grading
- operand_degree(x, registry=None)¶
s(x) = |x| + k— the SHIFTED degree in which the bracket is graded antisymmetric and satisfies graded Jacobi.- Parameters:
x (Expr)
registry (PropertyRegistry | None)
- Return type:
Degree
- module_product(b, c)¶
The product the Leibniz axiom distributes over (default:
Product).
- claimed_swap_sign(a, b, registry=None)¶
εin the graded-antisymmetry CLAIM[a, b] = ε·[b, a]:ε = −(−1)^{s(a)s(b)}withs=operand_degree().The sign the axiom STATES (what
graded_antisymmetry_obstruction()builds and a skew check tests), whether or not the bracket satisfies it.Nonewhen the parity is symbolic; an undeterminable degree raisesValueError.- Parameters:
a (Expr)
b (Expr)
registry (PropertyRegistry | None)
- Return type:
int | None
- pair_swap_sign(a, b, registry=None)¶
Sign
εsuch that[a, b] = ε·[b, a]HOLDS — a rewrite licence:claimed_swap_sign()for a bracket asserted graded antisymmetric,None(decline: do not rewrite) for any other bracket, a symbolic parity OR an undeterminable operand degree (a licence never raises — an unknown degree means no rule fires, no closure).- Parameters:
a (Expr)
b (Expr)
registry (PropertyRegistry | None)
- Return type:
int | None
- jacobi_term_sign(A, B, C, registry=None)¶
Sign
(−1)^{s(A)s(C)}of the[A, [B, C]]summand in the cyclic graded JacobiΣ_cyc (−1)^{s(A)s(C)} [A, [B, C]] = 0(s=operand_degree()).Nonewhen symbolic.- Parameters:
A (Expr)
B (Expr)
C (Expr)
registry (PropertyRegistry | None)
- Return type:
int | None
- leibniz_term_sign(a, b, registry=None)¶
Sign
(−1)^{s(a)|b|}ofb·[a, c]in the Leibniz claim[a, b·c] = [a, b]·c + (−1)^{s(a)|b|} b·[a, c]:ad_ahas degrees(a) = |a| + kand passesbof UNSHIFTED degree|b|.Nonewhen symbolic.- Parameters:
a (Expr)
b (Expr)
registry (PropertyRegistry | None)
- Return type:
int | None
- abstractmethod expand(a, b, registry=None)¶
Return the definitional expansion of
[a, b].Subclasses implement this with their concrete formula. The expansion is purely syntactic, it does not invoke simplify / canonicalize; the caller pipes the result through whichever reductions they need.
- Parameters:
a (Expr)
b (Expr)
registry (PropertyRegistry | None)
- Return type:
- graded_antisymmetry_obstruction(a, b, registry=None)¶
[a, b] + (−1)^{s(a)s(b)} [b, a](= [a, b] − ε[b, a]withε=claimed_swap_sign()).Claims to be zero exactly when the bracket is graded antisymmetric on
(a, b)in its shifted conventions = |·| + k(operand_degree(); for Schouten–Nijenhuiss = m − 1, the multivector degree minus one). Unshifted degrees fork ≠ 0would build the WRONG obstruction, and the operator degree for SN would claim[π, π]_SN = 0for every bivector. Undecidable parity raisesValueError.- Parameters:
a (Expr)
b (Expr)
registry (PropertyRegistry | None)
- Return type:
- graded_jacobi_obstruction(a, b, c, registry=None)¶
Cyclic Jacobi with Koszul signs in the shifted convention: (−1)^{s(a)s(c)} [a, [b, c]] + (−1)^{s(b)s(a)} [b, [c, a]] + (−1)^{s(c)s(b)} [c, [a, b]] with ``s`` = :meth:`operand_degree` and each sign read from :meth:`jacobi_term_sign`. Undecidable parity raises :class:`ValueError`.- Parameters:
a (Expr)
b (Expr)
c (Expr)
registry (PropertyRegistry | None)
- Return type:
- leibniz_obstruction(a, b, c, registry=None)¶
[a, b·c] − [a, b]·c − (−1)^{s(a)|b|} b·[a, c],·=module_product(), sign fromleibniz_term_sign().Claims to be zero when the bracket acts as a graded derivation in its second slot. Undecidable sign parity raises.
- Parameters:
a (Expr)
b (Expr)
c (Expr)
registry (PropertyRegistry | None)
- Return type: