Documentation

CslibFrontier.Computability.Pebbling.ReversiblePathReachable

Reachable configurations of reversible pebbling on the path #

Li, Tromp and Vitányi characterize every configuration reachable in Bennett's reversible pebble game on the directed path ([LTV98], Section 7, Theorem 1 and Corollary 1). Here the game is reversiblePebbleGame pathDigraph n, and a configuration C leaves f = n - #C pebbles free.

Index conventions. As in CslibFrontier.Computability.Pebbling.ReversiblePath, vertex v is LTV's node v + 1. Their permanently pebbled node 0 is not counted and becomes the path start, at position -1; LTV number it ∞. So "the path start lies at most 2 ^ i positions to the left of x" reads x + 1 ≤ 2 ^ i.

Proof. A weakly solvable configuration is reachable, since its big steps played backwards are runs. Conversely, each move of the game places or removes a pebble whose predecessor is pebbled, hence an available pebble. Placing one keeps the configuration weakly solvable. Removing one keeps it weakly solvable by the key step of Theorem 1, IsPathRemovalNumbering.erase_of_pathAvailable: pebbles numbered below the removed pebble move up by one, and a pebble whose witness was the removed pebble follows the chain of witnesses to the left (IsPathRemovalNumbering.chain). The distances along the chain add up to at most 2 ^ (i + 1), which is LTV's estimate.

Deciding reachability. By Theorem 1, removing the least available pebble until none is left frees every pebble exactly when the configuration is weakly solvable (pathGreedySolvable). This makes reachability and the existence of a removal numbering decidable, and decide checks small instances.

Main definitions #

Main results #

References #

Available pebbles and solvability #

The pebble on x is available in the configuration C with f free pebbles: the path start, or another pebble of C, lies at most 2 ^ f positions to its left. The path start is at position -1.

Instances For
    @[instance_reducible]

    One big step of [LTV98], Section 7, with n pebbles: remove a pebble that is available with the n - #C free pebbles.

    C is weakly solvable with n pebbles: it fits in the budget and some sequence of big steps frees every pebble.

    Instances For

      C is strongly solvable with n pebbles: it fits in the budget and every configuration that big steps reach from C is empty or allows another big step. Each big step removes a pebble, so every maximal sequence of big steps frees every pebble.

      structure Cslib.Pebbling.IsPathRemovalNumbering (n : ℕ) (C : Finset ℕ) (σ : ℕ → ℕ) :

      σ is a removal numbering of C with n pebbles: it numbers the pebbles of C by n - #C, …, n - 1 so that each pebble x has a higher-numbered pebble, or the path start, at most 2 ^ σ x positions to its left ([LTV98], Corollary 1). The numbering is an order in which big steps can remove the pebbles.

      • injOn : Set.InjOn σ ↑C

        Distinct pebbles get distinct numbers.

      • le (x : ℕ) : x ∈ C → n - C.card ≤ σ x

        Numbers are at least the number of free pebbles.

      • lt (x : ℕ) : x ∈ C → σ x < n

        Numbers are below the budget.

      • near (x : ℕ) : x ∈ C → x + 1 ≤ 2 ^ σ x ∨ ∃ y ∈ C, y < x ∧ σ x < σ y ∧ x ≤ y + 2 ^ σ x

        The path start, or a higher-numbered pebble, is close enough on the left.

      C has a removal numbering with n pebbles.

      Instances For

        Big steps are runs #

        theorem Cslib.Pebbling.PathAvailable.exists_mTr_place {n x : ℕ} {C : Finset ℕ} (hx : x ∈ C) (hcard : C.card ≤ n) (havail : PathAvailable C (n - C.card) x) :
        ∃ (ms : List (Move ℕ)), (reversiblePebbleGame pathDigraph n).MTr (C.erase x) ms C

        The big step. An available pebble can be placed using the free pebbles: the configuration C is reachable from C.erase x.

        theorem Cslib.Pebbling.PathAvailable.exists_mTr_remove {n x : ℕ} {C : Finset ℕ} (hx : x ∈ C) (hcard : C.card ≤ n) (havail : PathAvailable C (n - C.card) x) :
        ∃ (ms : List (Move ℕ)), (reversiblePebbleGame pathDigraph n).MTr C ms (C.erase x)

        An available pebble can be removed using the free pebbles.

        Numberings #

        theorem Cslib.Pebbling.IsPathRemovalNumbering.pathAvailable {n : ℕ} {C : Finset ℕ} {σ : ℕ → ℕ} (h : IsPathRemovalNumbering n C σ) {x : ℕ} (hx : x ∈ C) (hσx : σ x = n - C.card) :
        PathAvailable C (n - C.card) x

        The pebble with the least number is available.

        theorem Cslib.Pebbling.IsPathRemovalNumbering.erase {n : ℕ} {C : Finset ℕ} {σ : ℕ → ℕ} (h : IsPathRemovalNumbering n C σ) {x : ℕ} (hx : x ∈ C) (hσx : σ x = n - C.card) :

        Removing the pebble with the least number leaves a removal numbering.

        theorem Cslib.Pebbling.IsPathRemovalNumbering.chain {n : ℕ} {C : Finset ℕ} {σ : ℕ → ℕ} (h : IsPathRemovalNumbering n C σ) {j : ℕ} (y : ℕ) :
        y ∈ C → σ y < j → y + 1 + 2 ^ σ y ≤ 2 ^ j ∨ ∃ w ∈ C, w < y ∧ j ≤ σ w ∧ y + 2 ^ σ y ≤ w + 2 ^ j

        Following the witnesses to the left from a pebble y numbered below j, either the path start or a pebble numbered at least j is close: the distances along the chain add up to at most 2 ^ j - 2 ^ σ y.

        theorem Cslib.Pebbling.IsPathRemovalNumbering.add_one_add_two_pow_le {n : ℕ} {C : Finset ℕ} {σ : ℕ → ℕ} (h : IsPathRemovalNumbering n C σ) {y : ℕ} (hy : y ∈ C) :
        y + 1 + 2 ^ σ y ≤ 2 ^ n

        A pebble numbered i lies at a vertex y with y + 1 + 2 ^ i ≤ 2 ^ n.

        theorem Cslib.Pebbling.IsPathRemovalNumbering.erase_of_pathAvailable {n : ℕ} {C : Finset ℕ} {σ : ℕ → ℕ} (h : IsPathRemovalNumbering n C σ) {x : ℕ} (hx : x ∈ C) (havail : PathAvailable C (n - C.card) x) :
        IsPathRemovalNumbering n (C.erase x) fun (z : ℕ) => if σ z < σ x then σ z + 1 else σ z

        The key step of [LTV98], Theorem 1. Removing any available pebble x leaves a removal numbering: the pebbles numbered below x move up by one.

        Weak and strong solvability #

        The empty configuration is weakly solvable.

        theorem Cslib.Pebbling.PathWeaklySolvable.of_erase {n x : ℕ} {C : Finset ℕ} (h : PathWeaklySolvable n (C.erase x)) (hx : x ∈ C) (hcard : C.card ≤ n) (havail : PathAvailable C (n - C.card) x) :

        Adding a pebble to a weakly solvable configuration, where it is available, gives a weakly solvable configuration.

        Numbering the pebbles in the order of a solving sequence of big steps gives a removal numbering.

        Removing the pebbles in the order of a removal numbering is a solving sequence of big steps.

        theorem Cslib.Pebbling.PathWeaklySolvable.erase {n x : ℕ} {C : Finset ℕ} (h : PathWeaklySolvable n C) (hx : x ∈ C) (havail : PathAvailable C (n - C.card) x) :

        The key step of [LTV98], Theorem 1. Removing any available pebble from a weakly solvable configuration gives a weakly solvable configuration.

        [LTV98], Theorem 1. Every weakly solvable configuration is strongly solvable.

        A strongly solvable configuration is weakly solvable.

        Reachable configurations #

        A weakly solvable configuration is reachable: play its big steps backwards.

        theorem Cslib.Pebbling.pathAvailable_of_forall_adj {C : Finset ℕ} {x : ℕ} (f : ℕ) (h : ∀ (u : ℕ), pathDigraph.Adj u x → u ∈ C) :

        A pebble whose predecessor is pebbled, or the source, is available.

        One move of the game keeps a configuration weakly solvable.

        Every reachable configuration is weakly solvable.

        The reachable configurations are the weakly solvable ones.

        Reachable configurations of reversible pebbling on the path ([LTV98], Corollary 1). With n pebbles, a configuration C is reachable from ∅ iff its pebbles can be numbered n - #C, …, n - 1 so that each pebble x has a higher-numbered pebble, or the path start, at most 2 ^ σ x positions to its left.

        With n pebbles and f = n - #C free pebbles, every pebble v of a reachable configuration C satisfies v + 1 + 2 ^ f ≤ 2 ^ n. With f = 0 this is the bound v + 2 ≤ 2 ^ n of add_two_le_of_reversiblePebbleGame_pathDigraph_mTr, and with C = {v} it is persistentReversiblePebblable_pathDigraph_iff's 2 * (v + 1) ≤ 2 ^ n.

        Deciding reachability #

        The greedy test with n pebbles and k rounds: remove the least available pebble until none is available, and report whether every pebble was removed.

        Correctness of the greedy test. With at least #C rounds, the greedy test accepts exactly the weakly solvable configurations. By Theorem 1, removing an available pebble never loses solvability.

        @[instance_reducible]

        By Corollary 1, reachability on the path is decidable through removal numberings.