Analogue of DetermFootprint where updates are partial functions m → Option m
composed via Kleisli composition for Option.
- double_commutant : (Submonoid.centralizer (Submonoid.centralizer self.updates).carrier).carrier = self.updates
Instances For
Equations
- OptionLensRange.from generators = { updates := ↑(Submonoid.centralizer (Submonoid.centralizer generators).carrier), one_mem := ⋯, mul_mem := ⋯, double_commutant := ⋯ }
Instances For
Relational composition: (R * S) x z = ∃ y, S x y ∧ R y z
(apply S first, then R — mirrors f * g = f ∘ g for functions).
Equations
- One or more equations did not get rendered due to their size.
Analogue of DetermFootprint where updates are relations on m
composed via relational composition.
- double_commutant : (Submonoid.centralizer (Submonoid.centralizer self.updates).carrier).carrier = self.updates
Instances For
Analogue of DetermFootprint where updates are sub-probability kernels m → SubProbability m
composed via Kleisli composition for SubProbability.
- updates : Set (m → GaudisCrypt.SubProbability m)
- double_commutant : (Submonoid.centralizer (Submonoid.centralizer self.updates).carrier).carrier = self.updates
Instances For
Convert a vector of non-negative weights (summing to at most 1) into a
sub-probability measure on a finite type. The resulting measure assigns
mass v x to the point x.
Equations
- SubProbability.ofVector v hv = ⟨∑ x : a, ↑(v x) • MeasureTheory.Measure.dirac x, ⋯⟩
Instances For
Convert a column-sub-stochastic matrix (each column sums to at most 1) into a
probabilistic function b → SubProbability a. Column j of M gives the
distribution ofMatrix M hM j.
With this convention ofMatrix is a monoid homomorphism:
ofMatrix (M * N) = ofMatrix M * ofMatrix N.
Equations
- SubProbability.ofMatrix M hM j = SubProbability.ofVector (fun (i : a) => M i j) ⋯
Instances For
ofMatrix is a monoid homomorphism: it maps matrix products to Kleisli products.
The Kleisli product ofMatrix M * ofMatrix N applies N first then M,
which corresponds to the matrix product M * N.
The matrix for p from Counterexample 1 (column convention: column j = distribution
over outputs given input j).
- Column 0: uniform on
{1, 2} - Column 1: uniform on
{0, 1} - Column 2: uniform on
{0, 2}
Equations
- CE1.p_matrix = !![0, 1 / 2, 1 / 2; 1 / 2, 1 / 2, 0; 1 / 2, 0, 1 / 2]
Instances For
The matrix for q from Counterexample 1 (column convention).
- Column 0: uniform on
{1, 2} - Column 1: Dirac at 0
- Column 2: Dirac at 0
Equations
- CE1.q_matrix = !![0, 1, 1; 1 / 2, 0, 0; 1 / 2, 0, 0]
Instances For
The probabilistic function p from Counterexample 1, as SubProbability.ofMatrix p_matrix.
Instances For
The probabilistic function q from Counterexample 1, as SubProbability.ofMatrix q_matrix.
Instances For
The centralizer of a set S ⊆ α with respect to a binary relation commutes : α → β → Prop:
the set of all b : β that commute with every element of S.
Instances For
The function matrix of f : m → m in column convention:
column j is the Dirac distribution at f j, i.e., P_f i j = 1 iff i = f j.
Instances For
A stochastic matrix M commutes with a total function f : m → m if
M * P_f = P_f * M, where P_f is the function matrix of f.
Equations
- commuteMT M f = (M * functionMatrix f = functionMatrix f * M)
Instances For
A stochastic map F : m → SubProbability m commutes with a total function f : m → m
if F * (pure ∘ f) = (pure ∘ f) * F in the Kleisli monoid,
i.e., ∀ x, F (f x) = F x >>= fun y => pure (f y).
Instances For
The partial-function matrix of f : m → Option m in column convention: column j is the
Dirac column at i when f j = some i, and the zero column when f j = none, i.e.
P_f i j = 1 iff f j = some i.
Instances For
A stochastic matrix M commutes with a partial function f : m → Option m if
M * P_f = P_f * M, where P_f is the partial-function matrix of f.
Equations
- commuteMP M f = (M * partialFunctionMatrix f = partialFunctionMatrix f * M)
Instances For
The sub-probability kernel of a partial function f : m → Option m:
f x = some y maps to pure y (Dirac at y), and f x = none maps to ⊥ (the zero
sub-probability measure).
Equations
- partialToKernel f x = (f x).elim ⊥ pure
Instances For
A stochastic map F : m → SubProbability m commutes with a partial function
f : m → Option m if F * partialToKernel f = partialToKernel f * F in the Kleisli monoid.
Equations
- commuteSP F f = (F * partialToKernel f = partialToKernel f * F)
Instances For
Each column of functionMatrix f sums to 1 (it is a Dirac column).
The Kleisli identity pure ∘ f of a total function is the sub-probability kernel
of its function matrix functionMatrix f.
commuteST (ofMatrix M) f reduces to the matrix-level commuteMT M f, via
multiplicativity (ofMatrix_mul) and injectivity (ofMatrix_inj) of ofMatrix.
Each column of partialFunctionMatrix f sums to at most 1 (a Dirac column, or the zero
column when f j = none).
The kernel partialToKernel f of a partial function is the sub-probability kernel of its
partial-function matrix.
commuteSP (ofMatrix M) f reduces to the matrix-level commuteMP M f, via multiplicativity
(ofMatrix_mul) and injectivity (ofMatrix_inj) of ofMatrix.
The deterministic bicommutant C(C(S)) of a set of stochastic kernels S: the
Submonoid.centralizer (in the composition monoid m → m) of the deterministic centralizer
Centralizer commuteST S. Returned as a Set (m → m) (the submonoid carrier) so it can
feed DetermFootprint.from.
Equations
Instances For
The partial-function bicommutant C(C(S)) of a set of stochastic kernels S: the
Submonoid.centralizer (in the Kleisli-Option monoid m → Option m) of the partial
centralizer Centralizer commuteSP S. The partial analogue of hullST.
Equations
Instances For
The deterministic centralizer of {p_matrix} is exactly {id, τ}, matching the claim
C({p}) = {id, τ} in Counterexample 1.
Forward direction is a finite case bash over all 27 functions Fin 3 → Fin 3
(decide is unavailable since NNReal has no computable DecidableEq): only id and
τ satisfy the matrix commutation p_matrix * P_f = P_f * p_matrix.
The stochastic centralizer of {p} equals {id, τ}, by reduction to the matrix-level
centralizer_p_matrix through commuteST_ofMatrix_iff.
The stochastic centralizer of {q} equals {id, τ}, by reduction to the matrix-level
centralizer_q_matrix through commuteST_ofMatrix_iff.
Helper for the deterministic bicommutant: the total functions commuting under composition
with both id and τ are exactly {id, τ, c₁}, where c₁ is the constant map to τ's
fixed point 0.
Stated over Function.End (Fin 3) to pin the composition monoid unambiguously: the bare type
Fin 3 → Fin 3 carries two Monoid instances here (pointwise and composition), and the
composition one is definitionally equal to Function.End's, so this transfers by defeq.
Both deterministic bicommutants C(C({p})) and C(C({q})) equal {id, τ, c₁}, an abelian
set under composition; hence every element of hullST {p} commutes with every element of
hullST {q}. This is the (satisfied) hypothesis of the implication that Counterexample 1
refutes — even though p and q themselves do not commute (not_commute).
hullST S is already double-commutant closed, i.e. it is a genuine DetermFootprint: the
DetermFootprint.from it generates returns exactly hullST S. This holds because hullST S is a
single centralizer and C∘C∘C = C (Set.centralizer_centralizer_centralizer).
The matrix for p from Counterexample 2: the simple random walk on the 4-cycle
0-1-2-3-0 (column convention: column j is the output distribution from state j).
p_matrix i j = 1/2 exactly when i and j are adjacent on the cycle. It is symmetric,
so it coincides with the row-stochastic matrix in the text.
Equations
- CE2.p_matrix = !![0, 1 / 2, 0, 1 / 2; 1 / 2, 0, 1 / 2, 0; 0, 1 / 2, 0, 1 / 2; 1 / 2, 0, 1 / 2, 0]
Instances For
The matrix for q from Counterexample 2: the "forgetful" kernel that ignores the current
state and jumps to 0 or 2 with equal probability (column convention). Every column is
(1/2, 0, 1/2, 0)ᵀ; this is the transpose of the row-stochastic q = 𝟙 rᵀ,
r = (1/2, 0, 1/2, 0), in the text.
Equations
- CE2.q_matrix = !![1 / 2, 1 / 2, 1 / 2, 1 / 2; 0, 0, 0, 0; 1 / 2, 1 / 2, 1 / 2, 1 / 2; 0, 0, 0, 0]
Instances For
The probabilistic kernel p from Counterexample 2, as SubProbability.ofMatrix p_matrix.
Instances For
The probabilistic kernel q from Counterexample 2, as SubProbability.ofMatrix q_matrix.
Instances For
General bridge: if a stochastic matrix is ½ · A for an integer matrix A, then
commuteMP M f is equivalent to the integer matrix equation A · P_f = P_f · A.
Since the {0,1}-matrix partialFunctionMatrix f is the Nat.cast image of pfNat f,
scaling by the nonzero ½ and the injectivity of ℕ ↪ ℝ≥0 reduce the NNReal commutation
to a decidable condition over ℕ.
The deterministic-partial centralizer of {p_matrix} is exactly D₄ ∪ {∅}: the eight
dihedral symmetries of the 4-cycle (all total bijections) together with the empty partial
function ∅. This is the partial-function first centralizer A_p of Counterexample 2:
D₄ ⊆ A_p holds, and the only proper partial map commuting with p is ∅.
The 33 partial functions making up Centralizer commuteMP {q_matrix}, as a Finset
(a flat-decidable carrier keeps the decide below tractable): the empty partial function
∅, plus every total map sending the antipodal pair {0, 2} to itself (f 0, f 2 equal to
0, 2 in some order) with f 1, f 3 arbitrary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The deterministic-partial centralizer of {q_matrix} is A_q of Counterexample 2: the empty
partial function ∅ together with the 32 total maps that fix the antipodal pair {0, 2}
setwise (identity or swap on it) and are arbitrary on {1, 3}. In particular it contains
ρ = (0 2)(1 3), the fact the text uses (ρ ∈ A_q).
The partial-function centralizer of the kernel p equals that of its matrix p_matrix
(= A_p = D₄ ∪ {∅}), via commuteSP_ofMatrix_iff and centralizer_p_matrix.
The partial-function centralizer of the kernel q equals that of its matrix q_matrix
(= A_q = ↑qCentralizerSet), via commuteSP_ofMatrix_iff and centralizer_q_matrix.
The partial-function bicommutant B_p = hullSP {p} of the kernel p (in the
Kleisli-Option monoid) is exactly {∅, id, ρ} with ρ = (0 2)(1 3), as claimed in
Counterexample 2. Rewrites A_p = Centralizer commuteSP {p} to its explicit 9-element
value (centralizer_p_SP); the centralizer is then a decidable computation.
The partial-function bicommutant B_q = hullSP {q} of the kernel q (in the
Kleisli-Option monoid) is exactly {∅, id}: A_q is so large that its centralizer
collapses to the trivial maps. In particular ρ = (0 2)(1 3) ∈ A_q commutes with all of
B_q — the key step in Counterexample 2 (combined with ρ ∈ B_p).
Counterexample 2, the punchline. The partial-function bicommutants B_p = hullSP {p} and
B_q = hullSP {q} commute elementwise (under Kleisli composition): every f ∈ B_p = {∅,id,ρ}
commutes with every g ∈ B_q = {∅, id}. Yet p and q do not commute
(matrices_not_commute) — so the bicommutants commuting does not imply the underlying
kernels commute, even in the partial setting.