Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Encodings.Sigma

The framed encoding of dependent pairs #

encSigma encI enc encodes ⟨i, b⟩ : Σ i, β i as the framed index encI i followed by enc i b, the encoding of the second component chosen by the index. It is the dependent version of Turing.MultiTapeTM.encPair, with the same layout.

A family of encodings is usually uniform: each enc i is a fixed encoding e of a common type after an index-dependent map code i. Then encSigma encI enc ⟨i, b⟩ is the word of the plain pair (i, code i b) under encPair encI e (encSigma_eq_encPair), so the polynomial-time certificates for pairs apply to its view as a pair (Turing.MultiTapeTM.ComputableInPolyTime.sigmaView). Conversely, a plain pair is a dependent pair with a constant family (encPair_eq_encSigma).

The layout is that of Cslib.Encoding.encSigma in leanprover/cslib#1213, which frames the index with delimit, the same map as frame.

Main definitions #

Main results #

def Turing.MultiTapeTM.encSigma {ι : Type u} {β : ι → Type v} (encI : ι ↪ List Bool) (enc : (i : ι) → β i ↪ List Bool) :
(i : ι) × β i ↪ List Bool

Dependent pairs encoded as the framed index followed by the second component, encoded by the encoding that the index selects.

@[simp]
theorem Turing.MultiTapeTM.encSigma_apply {ι : Type u} {β : ι → Type v} {encI : ι ↪ List Bool} {enc : (i : ι) → β i ↪ List Bool} (x : (i : ι) × β i) :
(encSigma encI enc) x = frame (encI x.fst) ++ (enc x.fst) x.snd
theorem Turing.MultiTapeTM.length_encSigma {ι : Type u} {β : ι → Type v} {encI : ι ↪ List Bool} {enc : (i : ι) → β i ↪ List Bool} (x : (i : ι) × β i) :
((encSigma encI enc) x).length = 2 * (encI x.fst).length + 1 + ((enc x.fst) x.snd).length
theorem Turing.MultiTapeTM.length_le_encSigma_fst {ι : Type u} {β : ι → Type v} (encI : ι ↪ List Bool) (enc : (i : ι) → β i ↪ List Bool) (x : (i : ι) × β i) :
(encI x.fst).length ≤ ((encSigma encI enc) x).length
theorem Turing.MultiTapeTM.length_le_encSigma_snd {ι : Type u} {β : ι → Type v} (encI : ι ↪ List Bool) (enc : (i : ι) → β i ↪ List Bool) (x : (i : ι) × β i) :
((enc x.fst) x.snd).length ≤ ((encSigma encI enc) x).length
theorem Turing.MultiTapeTM.encSigma_eq_encPair {ι : Type u} {β : ι → Type v} {encI : ι ↪ List Bool} {enc : (i : ι) → β i ↪ List Bool} {γ : Type w} (e : γ ↪ List Bool) (code : (i : ι) → β i → γ) (h : ∀ (i : ι) (b : β i), (enc i) b = e (code i b)) (x : (i : ι) × β i) :
(encSigma encI enc) x = (encPair encI e) (x.fst, code x.fst x.snd)

A uniform family of encodings, enc i = e ∘ code i, encodes a dependent pair as the plain pair of its index and code.

theorem Turing.MultiTapeTM.encPair_eq_encSigma {ι : Type u} {γ : Type v} (encI : ι ↪ List Bool) (e : γ ↪ List Bool) (p : ι × γ) :
(encPair encI e) p = (encSigma encI fun (x : ι) => e) ⟨p.1, p.2⟩

A plain pair is a dependent pair with a constant family of encodings.