RunTupleBijection
Abstract
Degree enumeration for labelled circular run-constrained words.
Definition 1.1 (tupleList).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Each positive run is followed by its compulsory longer zero block and its additional slack.
Definition 1.2 (blockLengths).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.blockLengths (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Splitting at changes of Boolean value records the successive constant-block lengths.
Lemma 1.3 (tupleList length).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList_length (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The run and zero blocks contribute two times the run length plus one plus the slack.
Definition 1.4 (decodeLengths).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.decodeLengths (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Successive one and zero block lengths determine a run length and its excess zero slack.
Definition 1.5 (extractListTuple).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractListTuple (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Constant-block splitting followed by length decoding extracts the ordered run-and-slack tuple.
Definition 1.6 (wordOfTuple).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.wordOfTuple (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The defining list access uses the bound obtained from hlen and offset_lt; proof arguments do not change the returned letter.
Theorem 1.7 (linearize wordOfTuple).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.linearize_wordOfTuple (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The inverse circular offset reads the reconstructed word as its original tuple list.
Definition 1.8 (rawWord).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Flattening alternating replicated one and zero blocks encodes the unadjusted run-and-gap lengths.
Lemma 1.9 (rawWord cons).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord_cons (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The first raw pair contributes its replicated one block and zero block before the remaining pairs.
Lemma 1.10 (rawWord append).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord_append (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Flattening the block encoding transports concatenation of pair lists to concatenation of words.
Lemma 1.11 (raw encoding marked).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_marked (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Positive first and last block lengths give a one at the origin and a zero at its predecessor.
Lemma 1.12 (first raw run start).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.first_raw_run_start (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The first replicated one block and its adjacent zero blocks delimit the first run.
Lemma 1.13 (linearize get optional).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.linearize_get_optional (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Optional list access equals some of the indexed letter. Since j<n and linearize has length n, the displayed ordinary indexing has the same value; the two occurrences of some retain the optional equality.
Theorem 1.14 (marked admissible tuple).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.marked_admissible_tuple (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Alternating positive blocks recover the raw pairs, and admissibility turns every excess gap into nonnegative slack.
Theorem 1.15 (raw encoding admissible).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_admissible (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Every marked run lies at a block boundary whose longer zero block fulfils the circular gap condition.
Theorem 1.16 (raw encoding admissible iff).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_admissible_iff (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The block-boundary run starts make admissibility equivalent to the strict inequality for each following gap.
Definition 1.17 (pairPrefix).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.pairPrefix (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Summing earlier pair lengths gives the labelled offset of a raw pair boundary.
Definition 1.18 (rawPairs).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawPairs (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Adding the compulsory run length plus one to the slack converts tuples into raw run-and-gap pairs.
Lemma 1.19 (tupleList eq rawPairs).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList_eq_rawPairs (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The compulsory zero lengths identify the slack encoding with the raw-pair encoding.
Lemma 1.20 (tuple word admissible).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.tuple_word_admissible (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Every positive tuple run has its compulsory strictly longer zero block in the reconstructed word.
Lemma 1.21 (tuple word marked).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.tuple_word_marked (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
A nonempty positive tuple begins with a one and ends with a zero, marking its reconstruction origin.
Definition 1.22 (GoodTuple).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.GoodTuple (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The subtype fixes a nonempty positive-run tuple whose encoded length is the prescribed length.
Definition 1.23 (MarkedWords).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.MarkedWords (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The subtype records an admissible labelled word together with a positive marked start.
Definition 1.24 (extractMarked).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractMarked (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The first component is the labelled run mark. The second component has the displayed underlying list, with its nonemptiness, positivity and total-length proofs supplied by marked_admissible_tuple.
Definition 1.25 (reconstructMarked).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.reconstructMarked (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The displayed value is the underlying labelled word and mark. The subtype proof is supplied by tuple_word_admissible and tuple_word_marked.
Definition 1.26 (markedTupleEquiv).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.markedTupleEquiv (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Extraction and reconstruction are inverse through constant-block decoding and the marked boundary conditions.
Definition 1.27 (instFiniteGoodTuple).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.instFiniteGoodTuple (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Finiteness is constructed by Finite.of_injective, using the map that sends a good tuple to its reconstructed List.Vector Bool n and the injectivity of that map.
Definition 1.28 (instFintypeGoodTuple).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.instFintypeGoodTuple (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The enumerating instance is Fintype.ofFinite (GoodTuple n).
Theorem 1.29 (runCount wordOfTuple).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.runCount_wordOfTuple (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The distinct pair-prefix positions enumerate exactly the marked starts of the reconstructed word.
Lemma 1.30 (extractMarked runs).
Proof. Machine-checked in Lean as D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractMarked_runs (✓ std3). ∎
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
Reconstruction preserves the word, and the tuple length counts its marked run starts.
Definition 1.31 (RunTuples).
Formalization. D5/S1/Words/AssociatedMersenne/RunTupleBijection.RunTuples (✓ std3).
Source. Repository-derived.
Acknowledgement. J. Wei and Y. Yang (2024). Associated Mersenne graphs. DOI: 10.48550/arXiv.2407.08237. URL: https://arxiv.org/abs/2407.08237v1.
Commentary.
The subtype restricts good tuples to a prescribed number of run-and-slack pairs.
References
- Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.GoodTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.MarkedWords - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.RunTuples - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.blockLengths - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.decodeLengths - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractListTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractMarked - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.extractMarked_runs - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.first_raw_run_start - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.instFiniteGoodTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.instFintypeGoodTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.linearize_get_optional - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.linearize_wordOfTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.markedTupleEquiv - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.marked_admissible_tuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.pairPrefix - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawPairs - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord_append - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.rawWord_cons - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_admissible - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_admissible_iff - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.raw_encoding_marked - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.reconstructMarked - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.runCount_wordOfTuple - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList_eq_rawPairs - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.tupleList_length - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.tuple_word_admissible - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.tuple_word_marked - Truth anchor:
D5/S1/Words/AssociatedMersenne/RunTupleBijection.wordOfTuple - Dependency: D5/S1/Words/AssociatedMersenne/CircularWords
- Dependency: D5/S1/Words/Compositions/ConstantBlocksDistinctRunSums