Documentation

DescriptiveComplexity.InductiveCounting.Order

Registers as counters and as loop positions #

The registers of DescriptiveComplexity.InductiveCounting.Cfg hold values in WithBot V, read in two ways: as a count, through DescriptiveComplexity.orank (so is 0 and each cover adds one), and as a loop position, through DescriptiveComplexity.InductiveCounting.predSet (the set of nodes already scanned). This file collects the arithmetic of the two readings: how a cover moves a loop past one more node, how the count of a set restricted to the scanned part grows, and when a counter still has room to be incremented.

Dependency graph

Covers in a finite linear order #

theorem DescriptiveComplexity.InductiveCounting.exists_covBy_of_not_max {A : Type} [LinearOrder A] [Finite A] {z : A} (hz : ¬∀ (a : A), a z) :
∃ (w : A), z w

In a finite linear order, an element that is not a maximum is covered by some element.

Dependency graph

Counts #

Dependency graph

The rank is strictly monotone.

Dependency graph

The rank determines the element.

Dependency graph

A counter whose value is still below the number of nodes can be incremented.

Dependency graph

Loop positions #

The set of nodes strictly below the value of a register: the nodes a loop holding that value has already scanned.

Equations
Instances For
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph
    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.predSet_of_isMin {V : Type} [LinearOrder V] {x : V} (h : ∀ (z : V), x z) :

    At the least node, nothing has been scanned.

    Dependency graph

    Past the greatest node, everything has been scanned.

    Dependency graph

    A cover of a register value holding a node advances the scan past exactly that node.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.exists_coe_of_covBy {V : Type} [LinearOrder V] {x : V} {r : WithBot V} (h : x r) :
    ∃ (x' : V), r = x' x x'

    A cover of a register value holding a node holds a node again.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.isMin_of_bot_covBy {V : Type} [LinearOrder V] {r : WithBot V} (h : r) :
    ∃ (x : V), r = x ∀ (z : V), x z

    The value covering is the least node.

    Dependency graph

    Counting the scanned part of a set #

    Dependency graph
    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_insert_of_mem {V : Type} [Finite V] {Q P : Set V} {uu : V} (huP : uuP) (h : uu Q) :
    (Q insert uu P).ncard = (Q P).ncard + 1

    Scanning one more node, of the set: its scanned count goes up by one.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_insert_of_notMem {V : Type} {Q P : Set V} {uu : V} (h : uuQ) :
    (Q insert uu P).ncard = (Q P).ncard

    Scanning one more node, outside the set: its scanned count is unchanged.

    Dependency graph

    Scanning one more node can only grow the scanned part of a set.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_predSet_covBy_of_mem {V : Type} [LinearOrder V] [Finite V] {P : Set V} {x : V} {r : WithBot V} (h : x r) (hx : x P) :
    (P predSet r).ncard = (P predSet x).ncard + 1

    Scanning past a node of the set increases its scanned count by one.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_predSet_covBy_of_notMem {V : Type} [LinearOrder V] {P : Set V} {x : V} {r : WithBot V} (h : x r) (hx : xP) :
    (P predSet r).ncard = (P predSet x).ncard

    Scanning past a node outside the set leaves its scanned count alone.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_predSet_isMax_of_mem {V : Type} [LinearOrder V] [Finite V] {P : Set V} {x : V} (h : ∀ (z : V), z x) (hx : x P) :
    (P predSet x).ncard + 1 = P.ncard

    At the greatest node, the scanned count of the set is one short of its total, if the node belongs to it.

    Dependency graph
    theorem DescriptiveComplexity.InductiveCounting.ncard_inter_predSet_isMax_of_notMem {V : Type} [LinearOrder V] {P : Set V} {x : V} (h : ∀ (z : V), z x) (hx : xP) :
    (P predSet x).ncard = P.ncard

    At the greatest node, the scanned count of the set is its total, if the node lies outside it.

    Dependency graph