Documentation

CslibFrontier.Computability.Pebbling.Reversible

The reversible pebble game #

Bennett's reversible pebble game on a directed graph G uses the moves of the black pebble game under one extra rule. Placing a pebble on v and removing the pebble from v both require every predecessor of v to carry a pebble. Every move is therefore undone by the opposite move, so on a loopless graph each run can be played backwards with the same budget. Pebbles model the checkpoints of a reversible simulation of an irreversible computation: a checkpoint can be computed, and reversibly erased, only from the checkpoint before it.

We take the toggling form of the rule, as in [LTV98], Section 6: place v requires v to be unpebbled and remove v requires v to be pebbled. A no-op move would not change any configuration, so this does not change which configurations are reachable.

A vertex is reversibly pebblable with s pebbles if some run from the empty configuration that never holds more than s pebbles reaches a configuration containing it. It is persistently pebblable if the run can end holding the vertex alone, as when a reversible computation keeps its output and erases all its checkpoints. Both prices are the least such s, and 0 when no budget suffices, as for blackPebblingPrice.

Main definitions #

Main results #

References #

def Cslib.Pebbling.Move.swap {V : Type u_1} :
Move V → Move V

The opposite move: place v and remove v are exchanged.

@[simp]
theorem Cslib.Pebbling.Move.swap_place {V : Type u_1} (v : V) :
@[simp]
theorem Cslib.Pebbling.Move.swap_remove {V : Type u_1} (v : V) :
@[simp]
theorem Cslib.Pebbling.Move.swap_swap {V : Type u_1} (m : Move V) :
m.swap.swap = m
inductive Cslib.Pebbling.RevStep {V : Type u_1} [DecidableEq V] (G : Digraph V) :
Finset V → Move V → Finset V → Prop

One legal move of the reversible pebble game, without a budget: a pebble may be placed on an unpebbled vertex, or removed from a pebbled one, only when every predecessor carries a pebble.

The reversible pebble game with s pebbles.

def Cslib.Pebbling.ReversiblePebblable {V : Type u_1} [DecidableEq V] (G : Digraph V) (s : ℕ) (v : V) :

v can be reversibly pebbled with at most s pebbles: some run from the empty configuration reaches a configuration containing v.

v can be persistently reversibly pebbled with at most s pebbles: some run from the empty configuration ends with v as the only pebble.

noncomputable def Cslib.Pebbling.reversiblePebblingPrice {V : Type u_1} [DecidableEq V] (G : Digraph V) (v : V) :

The reversible pebbling price of v: the least s such that v is reversibly pebblable with s pebbles, and 0 when no budget suffices.

noncomputable def Cslib.Pebbling.persistentReversiblePebblingPrice {V : Type u_1} [DecidableEq V] (G : Digraph V) (v : V) :

The persistent reversible pebbling price of v: the least s such that v is persistently reversibly pebblable with s pebbles, and 0 when no budget suffices.

theorem Cslib.Pebbling.reversiblePebbleGame_tr {V : Type u_1} [DecidableEq V] {G : Digraph V} {s : ℕ} {C D : Finset V} {m : Move V} :
(reversiblePebbleGame G s).Tr C m D ↔ RevStep G C m D ∧ D.card ≤ s
theorem Cslib.Pebbling.RevStep.blackStep {V : Type u_1} [DecidableEq V] {G : Digraph V} {C D : Finset V} {m : Move V} (h : RevStep G C m D) :
BlackStep G C m D

Every reversible move is a black move.

theorem Cslib.Pebbling.RevStep.forall_adj_of_mem_iff {V : Type u_1} [DecidableEq V] {G : Digraph V} {C D : Finset V} {m : Move V} (h : RevStep G C m D) {x : V} (hx : ¬(x ∈ C ↔ x ∈ D)) (u : V) :
G.Adj u x → u ∈ C

A vertex that gains or loses its pebble in a move has all its predecessors pebbled.

theorem Cslib.Pebbling.RevStep.swap {V : Type u_1} [DecidableEq V] {G : Digraph V} (hG : ∀ (v : V), ¬G.Adj v v) {C D : Finset V} {m : Move V} (h : RevStep G C m D) :
RevStep G D m.swap C

On a loopless graph the opposite move undoes a move.

theorem Cslib.Pebbling.RevStep.filter {V : Type u_1} [DecidableEq V] {G : Digraph V} {p : V → Prop} [DecidablePred p] (hp : ∀ (u v : V), G.Adj u v → p v → p u) {C D : Finset V} {m : Move V} (h : RevStep G C m D) :
Finset.filter p D = Finset.filter p C ∨ ∃ (m' : Move V), RevStep G (Finset.filter p C) m' (Finset.filter p D)

Restricting a move to a set of vertices closed under predecessors gives either a move or no change.

theorem Cslib.Pebbling.reversiblePebbleGame_mTr_mono {V : Type u_1} [DecidableEq V] {G : Digraph V} {s t : ℕ} (hst : s ≤ t) {C D : Finset V} {ms : List (Move V)} (h : (reversiblePebbleGame G s).MTr C ms D) :
theorem Cslib.Pebbling.card_le_of_reversiblePebbleGame_mTr {V : Type u_1} [DecidableEq V] {G : Digraph V} {s : ℕ} {C D : Finset V} {ms : List (Move V)} (h : (reversiblePebbleGame G s).MTr C ms D) (hC : C.card ≤ s) :
D.card ≤ s
theorem Cslib.Pebbling.blackPebbleGame_mTr_of_reversiblePebbleGame_mTr {V : Type u_1} [DecidableEq V] {G : Digraph V} {s : ℕ} {C D : Finset V} {ms : List (Move V)} (h : (reversiblePebbleGame G s).MTr C ms D) :
(blackPebbleGame G s).MTr C ms D

Every reversible run is a black run with the same moves and budget.

theorem Cslib.Pebbling.reversiblePebbleGame_mTr_reverse {V : Type u_1} [DecidableEq V] {G : Digraph V} (hG : ∀ (v : V), ¬G.Adj v v) {s : ℕ} {C D : Finset V} {ms : List (Move V)} (h : (reversiblePebbleGame G s).MTr C ms D) (hC : C.card ≤ s) :

Reversibility. On a loopless graph, a run played backwards with each move swapped is a run with the same budget, provided the starting configuration fits in the budget.

theorem Cslib.Pebbling.ReversiblePebblable.mono {V : Type u_1} [DecidableEq V] {G : Digraph V} {s t : ℕ} (hst : s ≤ t) {v : V} (h : ReversiblePebblable G s v) :

A reversible pebbling is a black pebbling.

theorem Cslib.Pebbling.reversiblePebblingPrice_eq {V : Type u_1} [DecidableEq V] {G : Digraph V} {n : ℕ} {v : V} (h : ReversiblePebblable G n v) (hle : ∀ (s : ℕ), ReversiblePebblable G s v → n ≤ s) :

The reversible price is n when n pebbles suffice and every successful budget is at least n.

The persistent reversible price is n when n pebbles suffice and every successful budget is at least n.

Reversible pebbling costs at least as much as black pebbling.

Ending with the vertex alone costs at least as much as visiting it.