abbrev
definition
parity
show as:
view math explainer →
open explainer
Read the cached plain-language explainer.
open lean source
IndisputableMonolith.LedgerPostingAdjacency on GitHub at line 63.
browse module
All declarations in this module, on Recognition.
explainer page
depends on
-
model -
LedgerState -
LedgerState -
LedgerState -
parityPattern -
LedgerState -
phiVec -
Pattern -
Pattern -
LedgerState -
L -
L -
Pattern -
Pattern
used by
-
coeffMag -
sat_computation_time -
circuit_cannot_sense_moat -
LedgerComputation -
SATLedger -
Turing_incomplete -
list_singleton_of_length_one' -
valueOfXOR -
xorMissing -
consistent_completeStateFrom -
IsolationInvariant -
octantConstraint -
satisfiesConstraint -
constraintOfMask -
HasPolySize -
maskVars -
systemOfMask -
foldl_xor_init -
parityOf -
satisfiesXOR -
XORConstraint -
XORSystem -
sakharov_necessary -
Triad -
strange_rung -
boolCost_symm -
color_from_axis_permutations -
even_flips_give_weak_structure -
even_sign_flip_count_D3 -
gauge_generation_unification -
gauge_order_product -
gauge_rank_match -
IsEvenSignFlip -
sm_factorization -
unique_gauge_factorization -
configDim -
parityCount -
Q3_self_dual_vertex_count -
pauli_exclusion_simple -
universal_forcing_via_NNO
formal source
60abbrev phiVec {d : Nat} (L : LedgerState d) : Fin d → ℤ :=
61 Recognition.phi L
62
63abbrev parity (d : Nat) (L : LedgerState d) : Pattern d :=
64 parityPattern (phiVec (d := d) L)
65
66/-! ## Posting model -/
67
68inductive Side where
69 | debit
70 | credit
71deriving DecidableEq, Repr
72
73/-- Apply a single unit post (either debit or credit) at account `k`. -/
74noncomputable def post {d : Nat} (L : LedgerState d) (k : Fin d) (side : Side) : LedgerState d := by
75 classical
76 exact match side with
77 | Side.debit =>
78 { debit := fun i => if i = k then L.debit i + 1 else L.debit i
79 , credit := L.credit }
80 | Side.credit =>
81 { debit := L.debit
82 , credit := fun i => if i = k then L.credit i + 1 else L.credit i }
83
84@[simp] lemma phiVec_post_debit {d : Nat} (L : LedgerState d) (k : Fin d) (i : Fin d) :
85 phiVec (d := d) (post L k Side.debit) i =
86 (if i = k then phiVec (d := d) L i + 1 else phiVec (d := d) L i) := by
87 by_cases hik : i = k
88 · subst hik
89 simp [post, phiVec, Recognition.phi]
90 ring_nf
91 · simp [post, phiVec, Recognition.phi, hik]
92
93@[simp] lemma phiVec_post_credit {d : Nat} (L : LedgerState d) (k : Fin d) (i : Fin d) :