Documentation

HexPermGroup.Rank

Mixed-radix encoding, with the top-level orbit digit most significant.

Equations
Instances For

    Exact division and remainder recover the mixed-radix digits. An in-range index itself proves that every radix encountered on its path is positive.

    Equations
    Instances For
      theorem Hex.PermGroup.Chain.decode_encode {n : Nat} (c : Chain n) (digits : c.Choice) :
      c.decode (c.encode digits) = digits
      def Hex.PermGroup.Chain.choose {n : Nat} (c : Chain n) :
      Nat → Perm n → Option c.Choice

      Sifting with bounded orbit digits. Failures carry no choice and cannot be used as a rank; membership still comes from the complete-chain checker.

      Equations
      Instances For
        theorem Hex.PermGroup.Chain.choose_isSome {n : Nat} (c : Chain n) (base : Nat) (p : Perm n) :
        (c.choose base p).isSome = c.accepts base p
        theorem Hex.PermGroup.Chain.choose_sound {n : Nat} {c : Chain n} {base : Nat} {p : Perm n} {digits : c.Choice} (h : c.choose base p = some digits) :
        c.value digits = p
        def Hex.PermGroup.Chain.choice {n : Nat} (c : Chain n) (base : Nat) (p : Perm n) (h : c.accepts base p = true) :

        Obtain a choice from a known successful sift, without repeating membership checks or searching through possible choices.

        Equations
        Instances For
          theorem Hex.PermGroup.Chain.value_choice {n : Nat} (c : Chain n) (base : Nat) (p : Perm n) (h : c.accepts base p = true) :
          c.value (c.choice base p h) = p
          def Hex.PermGroup.Group.rank {n : Nat} (G : Group n) (p : Element G) :

          The position of an element in the stored chain's mixed-radix ordering.

          Equations
          Instances For
            def Hex.PermGroup.Group.unrank {n : Nat} (G : Group n) (k : Fin G.order) :

            Recover an element by exact digit extraction and representative multiplication.

            Equations
            Instances For
              theorem Hex.PermGroup.Group.unrank_rank {n : Nat} (G : Group n) (p : Element G) :
              G.unrank (G.rank p) = p
              theorem Hex.PermGroup.Group.rank_unrank {n : Nat} (G : Group n) (k : Fin G.order) :
              G.rank (G.unrank k) = k
              def Hex.PermGroup.Group.rank? {n : Nat} (G : Group n) (p : Perm n) :

              Raw permutations are ranked only after a complete membership check.

              Equations
              Instances For
                def Hex.PermGroup.Group.unrank? {n : Nat} (G : Group n) (k : Nat) :

                Reject out-of-range indices before digit extraction.

                Equations
                Instances For
                  theorem Hex.PermGroup.Group.rank?_isSome {n : Nat} (G : Group n) (p : Perm n) :
                  theorem Hex.PermGroup.Group.rank?_rank {n : Nat} (G : Group n) (p : Element G) :
                  G.rank? p.val = some (G.rank p)
                  theorem Hex.PermGroup.Group.unrank?_unrank {n : Nat} (G : Group n) (k : Fin G.order) :
                  G.unrank? ↑k = some (G.unrank k)
                  def Hex.PermGroup.Group.sampleFrom {n : Nat} {m : Type → Type} [Functor m] (draw : (bound : Nat) → 0 < bound → m (Fin bound)) (G : Group n) :
                  m (Element G)

                  Apply unranking to one index from the supplied source. The source receives the positive exact order; its effects and failures are preserved by map.

                  Equations
                  Instances For
                    theorem Hex.PermGroup.Group.sampleFrom_error {n : Nat} {ε : Type} (error : ε) (G : Group n) :
                    sampleFrom (fun (x : Nat) (x_1 : 0 < x) => Except.error error) G = Except.error error