Documentation

HexPermGroup.Blocks.Check

def Hex.PermGroup.Blocks.Invariant {n : Nat} (S : Array (Perm n)) (R : Fin n → Fin n → Prop) :

A relation preserved by every supplied generator.

Equations
Instances For
    structure Hex.PermGroup.Blocks.Admissible {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (R : Fin n → Fin n → Prop) :

    The equivalence relations admitted by a seeded block problem.

    Instances For
      def Hex.PermGroup.Blocks.Forced {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (p : Partition n) (x y : Fin n) :

      A merge is justified by a seed or by the image of two points already in the same block. Its preimage is obtained from the checked permutation.

      Equations
      Instances For
        @[instance_reducible]
        instance Hex.PermGroup.Blocks.instDecidableForced {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (p : Partition n) (x y : Fin n) :
        Decidable (Forced S seeds p x y)
        Equations
        theorem Hex.PermGroup.Blocks.Forced.mono {n : Nat} {S : Array (Perm n)} {seeds : List (Fin n × Fin n)} {p q : Partition n} (h : p.Refines q.Same) {x y : Fin n} (hf : Forced S seeds p x y) :
        Forced S seeds q x y
        theorem Hex.PermGroup.Blocks.Forced.sound {n : Nat} {S : Array (Perm n)} {seeds : List (Fin n × Fin n)} {p : Partition n} {R : Fin n → Fin n → Prop} (hR : Admissible S seeds R) (hp : p.Refines R) {x y : Fin n} (hf : Forced S seeds p x y) :
        R x y

        One test per point and generator suffices: a point's image must share a block with its representative's image. No pair table is allocated.

        Equations
        Instances For
          def Hex.PermGroup.Blocks.replay {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (p : Partition n) :
          List (Fin n × Fin n) → Option (Partition n)

          Replay only effective forced unions. An untrusted trace may not introduce an arbitrary merge, even if its final partition happens to be invariant.

          Equations
          Instances For
            theorem Hex.PermGroup.Blocks.replay_append {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (p : Partition n) (xs ys : List (Fin n × Fin n)) :
            replay S seeds p (xs ++ ys) = (replay S seeds p xs).bind fun (q : Partition n) => replay S seeds q ys
            theorem Hex.PermGroup.Blocks.replay_least {n : Nat} {S : Array (Perm n)} {seeds trace : List (Fin n × Fin n)} {p q : Partition n} (h : replay S seeds p trace = some q) {R : Fin n → Fin n → Prop} (hR : Admissible S seeds R) (hp : p.Refines R) :
            theorem Hex.PermGroup.Blocks.replay_length {n : Nat} {S : Array (Perm n)} {seeds trace : List (Fin n × Fin n)} {p q : Partition n} (h : replay S seeds p trace = some q) :

            A successful replay records exactly one union per deleted root.

            def Hex.PermGroup.Blocks.check {n : Nat} (S : Array (Perm n)) (seeds : List (Fin n × Fin n)) (p : Partition n) (trace : List (Fin n × Fin n)) :

            Completeness checks both the input seeds and terminal generator closure, in addition to replaying the forced unions from the discrete partition.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Hex.PermGroup.Blocks.check_spec {n : Nat} {S : Array (Perm n)} {seeds trace : List (Fin n × Fin n)} {p : Partition n} (h : check S seeds p trace = true) :
              Admissible S seeds p.Same ∧ ∀ (R : Fin n → Fin n → Prop), Admissible S seeds R → p.Refines R

              The checked partition is admissible and refines every admissible relation. The second conclusion is the minimality obligation.