From population protocols to CRNs: helper lemmas (CRN-3) #
- The reaction of a transition,
p + q → δ₁(p, q) + δ₂(p, q)(Protocol.reactionOf), and the effect of an encounter on count vectors (counts_interact): the counts change exactly as by this reaction, which is applicable (consumed_le_counts); a transition that does not change the multiset of states does not change the counts (counts_interact_of_trivial). - Conversely, a reaction with reactants
s(p, q)applicable at the counts of a configuration comes from an encounter of two distinct agents in statesp,q(exists_agentPair). - Input tagging (
Protocol.tagInputs): a protocol with one fresh state per input symbol, so that its input map is injective, which simulates the original protocol (tagInputs_stablyComputes).
Multiplicities #
Multiplicity of a in s(A, B), in the form [A = a] + [B = a].
The reaction of a transition #
theorem
Crn.counts_interact_add
{X : Type u_1}
{Q : Type u_2}
{n : ℕ}
[Fintype Q]
[DecidableEq Q]
(P : Protocol X Q)
(c : Fin n → Q)
(e : AgentPair n)
(a : Q)
:
↑(counts (P.interact c e)) a + (P.reactionOf (c (↑e).1) (c (↑e).2)).consumed a = ↑(counts c) a + (P.reactionOf (c (↑e).1) (c (↑e).2)).produced a
The counts after an encounter, as an identity in ℕ:
counts' + consumed = counts + produced.
theorem
Crn.consumed_le_counts
{X : Type u_1}
{Q : Type u_2}
{n : ℕ}
[Fintype Q]
[DecidableEq Q]
(P : Protocol X Q)
(c : Fin n → Q)
(e : AgentPair n)
(a : Q)
:
The reactants of the transition at an encounter are present.
theorem
Crn.counts_interact_of_trivial
{X : Type u_1}
{Q : Type u_2}
{n : ℕ}
[Fintype Q]
[DecidableEq Q]
(P : Protocol X Q)
(c : Fin n → Q)
(e : AgentPair n)
(h : (P.reactionOf (c (↑e).1) (c (↑e).2)).reactants = (P.reactionOf (c (↑e).1) (c (↑e).2)).products)
:
An encounter whose transition does not change the multiset of states does not change the counts.
theorem
Crn.exists_agentPair
{Q : Type u_2}
{n : ℕ}
[Fintype Q]
[DecidableEq Q]
(c : Fin n → Q)
{p q : Q}
(h : ∀ (a : Q), Multiset.count a s(p, q).toMultiset ≤ ↑(counts c) a)
:
A reaction with reactants s(p, q) whose reactants are present comes from an encounter of
two distinct agents in states p and q.
Input tagging #
def
Crn.Protocol.tagInputs
{X : Type u_1}
{Q : Type u_2}
(P : Protocol X Q)
{k : ℕ}
(eX : X ≃ Fin k)
:
P with one fresh state inl j per input symbol: input i starts in inl (eX i), which
behaves as P.input i; every encounter moves both agents to inr-states.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Crn.tagInputs_stablyComputes
{X : Type u_1}
{Q : Type u_2}
{P : Protocol X Q}
{k : ℕ}
{eX : X ≃ Fin k}
[Fintype X]
[DecidableEq X]
{φ : (X → ℕ) → Bool}
(h : P.StablyComputes φ)
:
(P.tagInputs eX).StablyComputes φ
Input tagging preserves stable computation.