Finite safe words #
This file formalizes the parity restrictions of π(P) used in the Extension
Lemma, and Lemma 1 (reverse binary order is safe).
The two arithmetic-progression equations used below include both increasing
and decreasing progressions.
The recursive description of the parity-restricted word in Lemma 2.
Rescaling one parity preserves distinctness; hence the parity words appearing in the Extension Lemma are again words without repetitions.
If both parity words have distinct entries, the original word does too.
This is the distinctness argument for the new word Q = P O E in Lemma 2.
Inside a word listed in reverse β order, an earlier entry is later in
β. This is the first comparison used in the two-prefix-term case of Lemma 1.
Lemma 1 of the paper. Every finite word of distinct integers listed in
reverse β order is safe. The proof separates the cases of at least three,
exactly two, and at most one progression term in the finite prefix.
The non-strict reverse of β, used solely for sorting the finite set in
Lemma 1 and in the base case of the Extension Lemma.
Equations
- FourAP.reverseBitsLE a b = (a = b β¨ FourAP.bits b a)
Instances For
The finite sorting relation in Lemma 1 has a computable comparison.
Equations
- FourAP.reverseBitsLEDecidable xβΒΉ xβ = { decide := decide (xβΒΉ = xβ) || decide (FourAP.bits xβ xβΒΉ), reflects_decide := β― }
Transitivity permits sorting in the reverse order used in Lemma 1.
Antisymmetry makes the reverse listing of a finite set unique.
Any two integers can be compared when forming the reverse listing.
List a finite set in reverse β order, exactly as prescribed in Lemma 1.
This definition is computable, using mathlib's finite-set merge sort.
Equations
Instances For
The reverse listing contains each and only each prescribed entry.
The reverse listing contains no repeated entry, as required of a word.
The reverse listing has the strict reverse order required in Lemma 1.
Lemma 1 specialized to the canonical reverse listing of a finite set.
If zero belongs to a finite set, its reverse binary listing begins with zero. This is the sorting observation in the base case of Lemma 2.
Canonical form of the base-case extension in Lemma 2. Sorting P βͺ T
in reverse binary order preserves the old prefix whenever all its entries
are zero. This also connects the executable construction to the proof.