Documentation

Complexitylib.Classes.PCP.Internal.NumEncPi

Numbering a tuple #

A walk is a tuple of darts, and a coin sequence is a tuple of coins. This module numbers such a tuple the way a numeral works: the j-th entry contributes its own number times the base to the j-th power. Reading an entry back is dividing by that power and taking the remainder, which is what an algorithm does.

Main results #

Digits #

theorem Complexity.NumEnc.sum_lt_pow {c n : } (g : ) (hg : i < n, g i < c) :
iFinset.range n, g i * c ^ i < c ^ n
theorem Complexity.NumEnc.digit_sum {c : } (hc : 0 < c) (g : ) {n j : } :
j < n(∀ i < n, g i < c)(∑ iFinset.range n, g i * c ^ i) / c ^ j % c = g j
theorem Complexity.NumEnc.sum_digits {c n i : } :
i < c ^ njFinset.range n, i / c ^ j % c * c ^ j = i

The instance #

theorem Complexity.NumEnc.get_eq {α : Type} [NumEnc α] {i : } (hi : i < card α) {a : α} (h : i = enc a) :
get hi = a
def Complexity.NumEnc.encAt {α : Type} {n : } [NumEnc α] (f : Fin nα) (i : ) :

The number of the i-th entry of a tuple, or zero past its end.

Equations
Instances For
    theorem Complexity.NumEnc.encAt_lt {α : Type} {n : } [NumEnc α] (f : Fin nα) {i : } (hi : i < n) :
    encAt f i < card α
    @[instance_reducible]
    instance Complexity.NumEnc.instPi {α : Type} (n : ) [NumEnc α] :
    NumEnc (Fin nα)

    A tuple is numbered like a numeral.

    Equations
    • One or more equations did not get rendered due to their size.