Documentation

DescriptiveComplexity.Problems.Wide.DrawCmp

What a comparison loop decides #

The two remaining atom kinds of a step matrix – equality and order of two points – are the ones the machine settles by comparing two argument blocks. It cannot look at a block value as a whole: it walks the cells its marks name, one canonically padded tuple at a time, reading one bit from each of the two blocks (a paired read, which is why these are element loops and not file tests). This file says that this is enough.

The bridge underneath is padLt_iff: padding is an order embedding of the dd₀-tuples the control enumerates into the dd-tuples the cells are, since two padded tuples agree beyond dd₀ and so are compared inside it.

Padding is an order embedding #

What the loop sees of a block value #

noncomputable def DescriptiveComplexity.Draw.Data.padBits {L : FirstOrder.Language} (dt : Data L) {A : Type} (zero : A) (S : (Fin dt.dd → A) → Prop) (w : Fin dt.dd0 → A) :

The bits of a block value the loops can read: its membership question at the canonically padded tuple of each dd₀-tuple – the cells the marks name.

Equations
Instances For
    Dependency graph
    theorem DescriptiveComplexity.Draw.Data.encMap_eq_iff_padBits {L : FirstOrder.Language} {dt : Data L} {A : Type} [L.Structure A] [LinearOrder A] {zero one : A} (hzo : zero ≠ one) {p q : dt.X.Map A} :
    p = q ↔ ∀ (w : Fin dt.dd0 → A), dt.padBits zero (encMap dt.ly zero one p) w ↔ dt.padBits zero (encMap dt.ly zero one q) w

    The equality atom is «the loop found no difference»: two points are equal exactly when their encodings agree at every cell the loop visits.

    Dependency graph
    theorem DescriptiveComplexity.Draw.Data.wmSetLe_encMap_iff_padBits {L : FirstOrder.Language} {dt : Data L} {A : Type} [L.Structure A] [LinearOrder A] {zero one : A} {p q : dt.X.Map A} :
    WMSetLe tupLeLex (encMap dt.ly zero one p) (encMap dt.ly zero one q) ↔ (∀ (w : Fin dt.dd0 → A), dt.padBits zero (encMap dt.ly zero one p) w ↔ dt.padBits zero (encMap dt.ly zero one q) w) ∨ ∃ (w : Fin dt.dd0 → A), (∀ (w' : Fin dt.dd0 → A), (∃ (r : Fin dt.dd0), (∀ j < r, w' j = w j) ∧ w' r < w r) → (dt.padBits zero (encMap dt.ly zero one p) w' ↔ dt.padBits zero (encMap dt.ly zero one q) w')) ∧ ¬dt.padBits zero (encMap dt.ly zero one p) w ∧ dt.padBits zero (encMap dt.ly zero one q) w

    The order atom is the loop's first difference: the binary order of two encodings is decided at the lexicographically least padded tuple where they differ.

    Dependency graph
    theorem DescriptiveComplexity.Draw.Data.encOrder_le_iff_padBits {L : FirstOrder.Language} {dt : Data L} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] {zero one : A} (hzo : zero ≠ one) (p q : dt.X.Map A) :
    p ≤ q ↔ (∀ (w : Fin dt.dd0 → A), dt.padBits zero (encMap dt.ly zero one p) w ↔ dt.padBits zero (encMap dt.ly zero one q) w) ∨ ∃ (w : Fin dt.dd0 → A), (∀ (w' : Fin dt.dd0 → A), (∃ (r : Fin dt.dd0), (∀ j < r, w' j = w j) ∧ w' r < w r) → (dt.padBits zero (encMap dt.ly zero one p) w' ↔ dt.padBits zero (encMap dt.ly zero one q) w')) ∧ ¬dt.padBits zero (encMap dt.ly zero one p) w ∧ dt.padBits zero (encMap dt.ly zero one q) w

    The order atom, in the order the reduction chose: the comparison the loop runs is exactly the order the points carry (DescriptiveComplexity.Draw.encOrder).

    Dependency graph