Documentation

LeanPool.IsoGraph.Canon.Branch

The running invariants of the optimality induction #

The depth-first search prunes three ways — invariant pruning, orbit pruning and backjumping — and each needs its own reason why the leaves it skips were already accounted for. This file sets up the bookkeeping for the third and hardest one, backjumping.

Prefixes #

Ancestors #

theorem IsoGraph.Canon.ancReach_full {n : } {f : Bool} {path : Array } {invPath : Array UInt64} {p : Part} (h : Node n f path invPath p) (k : List (List UInt64)) :
ancReach n f path path.size k Reach n f invPath p k
theorem IsoGraph.Canon.ancReach_push {n : } {f : Bool} (path : Array ) (v j : ) (hj : j path.size) (k : List (List UInt64)) :
ancReach n f (path.push v) j k ancReach n f path j k
theorem IsoGraph.Canon.ancReach_child {n : } {f : Bool} {path : Array } {invPath : Array UInt64} {p : Part} (h : Node n f path invPath p) (v : ) (k : List (List UInt64)) :
ancReach n f (path.push v) (path.size + 1) k SubR n f invPath p v k

Usable automorphisms #

theorem IsoGraph.Canon.mem_usableAutos {autos : Array (Array )} {path g : Array } (h : g usableAutos autos path) :
g autos i < path.size, g[path[i]!]! = path[i]!

The running invariants #

def IsoGraph.Canon.Rec (st : St) (l : Leaf) :

A leaf the state records.

Equations
Instances For
    def IsoGraph.Canon.Pth (st : St) (path : Array ) :

    No recorded leaf lies below the current node.

    Equations
    Instances For
      def IsoGraph.Canon.Jmp (n : ) (f : Bool) (P : List (List UInt64)Prop) (path : Array ) (st : St) :

      The backjump invariant, relative to a target predicate P on leaf keys. Every branch a recorded leaf went down and that the current path has already left behind consists entirely of keys satisfying P. At the use site P is "dominated by the incumbent, or already accounted for by the caller".

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def IsoGraph.Canon.JmpC (n : ) (f : Bool) (P : List (List UInt64)Prop) (path : Array ) (st : St) :

        The same, also covering the branches leaving the current node itself: what holds while a node is working through its children.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem IsoGraph.Canon.JmpC.child {n : } {f : Bool} {P : List (List UInt64)Prop} {st : St} {path : Array } (h : JmpC n f P path st) (v : ) :
          Jmp n f P (path.push v) st
          theorem IsoGraph.Canon.JmpC.of_jmp {n : } {f : Bool} {P : List (List UInt64)Prop} {st : St} {path : Array } (h : Jmp n f P path st) (hp : Pth st path) :
          JmpC n f P path st

          The leaf case of the optimality induction #

          theorem IsoGraph.Canon.Node.ancestor' {n : } {f : Bool} {path : Array } {ip : Array UInt64} {p : Part} (h : Node n f path ip p) (j : ) (hj : j path.size) :
          Node n f (path.extract 0 j) (nodePath n f (List.take j path.toList)).1 (nodePath n f (List.take j path.toList)).2
          theorem IsoGraph.Canon.leaf_abort_dom {n : } {f : Bool} {path : Array } {invPath : Array UInt64} {p : Part} (hnode : Node n f path invPath p) {st : St} {P : List (List UInt64)Prop} (hgood : StGood n f st) (hpth : Pth st path) (hjmp : Jmp n f P path st) {j : } (hab : (leafUpdate (Graph.ofOracle n f) path invPath p.lab st).abortTo = some j) :
          j < path.size ∀ (k : List (List UInt64)), ancReach n f path (j + 1) kP k

          The backjump a leaf update requests is covered by the jump invariant.