OAI/NumberTheory/TwoPoint/Walks/ColumnDecoder.lean
19 declarations, 0 contain sorry, 0 declared as axioms
Decoding complete column patterns
Three binary streams merge regular segments with omitted runs, mark new runs, and mark imperfect positions. Representative indices supply omitted labels and imperfect attachments. All decoding is independent of numerical primes, quotient coordinates, and padding coefficients.
- def
OAI.TwoPointCorrelations.decodeForestPathsline 18Source documentation
A valid path code determines one family; invalid codes decode to empty lists. The proven uniqueness makes this choice independent of witnesses.
noncomputable def decodeForestPaths {N segments : ℕ} (code : ForestPathData.Code N segments) : Fin segments → List ℕ := by … - theorem
OAI.TwoPointCorrelations.decodeForestPaths_codeline 23 - inductive
OAI.TwoPointCorrelations.CanonicalColumnLabelline 31 - def
OAI.TwoPointCorrelations.evenEntriesline 38Source documentation
Incidence supports start with a line and alternate line/point.
def evenEntries {α : Type*} : List α → List α | [] => [] | [a] => [a] | a :: _ :: rest => a :: evenEntries rest /-- A true bit consumes a regular segment; a false bit consumes one omitted run. Unused trailing bits have no effect. -/ - def
OAI.TwoPointCorrelations.mergeColumnRunsline 45Source documentation
A true bit consumes a regular segment; a false bit consumes one omitted run. Unused trailing bits have no effect.
def mergeColumnRuns {α : Type*} : List Bool → List (List α) → List α → List α | [], _, _ => [] | true :: mask, regular, omitted => regular.headD [] ++ mergeColumnRuns mask regular.tail omitted | false :: mask, regular, omitted => omitted.head?.toList ++ mergeColumnRuns mask regular omitted.tail - lemma
OAI.TwoPointCorrelations.mergeColumnRuns_emptyline 52 - theorem
OAI.TwoPointCorrelations.mergeColumnRuns_recoverline 60Source documentation
The binary merge data recover any interleaving of regular segments and omitted single runs, including padding to a fixed code length.
theorem mergeColumnRuns_recover {α : Type*} (pieces : List (List α ⊕ α)) (padding : List Bool) : mergeColumnRuns (pieces.map (fun x => match x with | .inl _ => true | .inr _ => false) ++ padding) (pieces.filterMap (fun x => match x with | .inl a => some a | .inr _ => none)) (pieces.filterMap (fun x => match x with | .inl _ => none | .inr a => some a)) = pieces.flatMap (fun x => match x with | .inl a => a | .inr a => [a]) := by …Mentions: OAI.TwoPointCorrelations.mergeColumnRuns
- def
OAI.TwoPointCorrelations.expandColumnRunsline 73Source documentation
The first bit marks an imperfect position; the second begins a new perfect run. Repetition consumes no extra run label.
def expandColumnRuns : List (Bool × Bool) → List CanonicalColumnLabel → Option CanonicalColumnLabel → List (Option CanonicalColumnLabel) | [], _, _ => [] | (true, _) :: flags, runs, _ => none :: expandColumnRuns flags runs none | (false, true) :: flags, runs, _ => runs.head? :: expandColumnRuns flags runs.tail runs.head? | (false, false) :: flags, runs, previous => previous :: expandColumnRuns flags runs previous - theorem
OAI.TwoPointCorrelations.expandColumnRuns_repeatline 82 - theorem
OAI.TwoPointCorrelations.expandColumnRuns_one_runline 91Source documentation
Positive constant-run lengths are recovered from their boundary bits.
theorem expandColumnRuns_one_run (n : ℕ) (a : CanonicalColumnLabel) (flags : List (Bool × Bool)) (runs : List CanonicalColumnLabel) (previous : Option CanonicalColumnLabel) : expandColumnRuns ((false, true) :: (List.replicate n (false, false) ++ flags)) (a :: runs) previous = List.replicate (n + 1) (some a) ++ expandColumnRuns flags runs (some a) := by …Mentions: OAI.TwoPointCorrelations.CanonicalColumnLabel, OAI.TwoPointCorrelations.expandColumnRuns
- theorem
OAI.TwoPointCorrelations.expandColumnRuns_lengthline 100 - def
OAI.TwoPointCorrelations.attachImperfectLabelsline 111Source documentation
References to represented perfect labels reuse those labels. A reference to an unrepresented imperfect class uses its first position.
def attachImperfectLabels (full : List (Option CanonicalColumnLabel)) : List (Option CanonicalColumnLabel) → List ℕ → List CanonicalColumnLabel | [], _ => [] | some a :: rest, refs => a :: attachImperfectLabels full rest refs | none :: rest, refs => let j := refs.headD 0 … - theorem
OAI.TwoPointCorrelations.attachImperfectLabels_lengthline 120 - abbrev
OAI.TwoPointCorrelations.ColumnDecoderCodeline 126 - def
OAI.TwoPointCorrelations.decodeColumnLabelsline 131 - theorem
OAI.TwoPointCorrelations.decodeColumnLabels_lengthline 140 - def
OAI.TwoPointCorrelations.decodeColumnPatternline 147Source documentation
An equality pattern contains no numerical label names.
noncomputable def decodeColumnPattern {N segments omitted imperfect : ℕ} (code : ColumnDecoderCode N segments omitted imperfect) : Fin N → Fin N → Bool := … - theorem
OAI.TwoPointCorrelations.card_columnDecoderCode_leline 152 - theorem
OAI.TwoPointCorrelations.card_decoded_column_patternsline 179Source documentation
The decoder's image is one universal, coefficient-independent family of full column equality patterns.
theorem card_decoded_column_patterns (N segments omitted imperfect : ℕ) : Nat.card (Set.range (@decodeColumnPattern N segments omitted imperfect)) ≤ 2 ^ (6 * N + 1) * N ^ (2 * segments + omitted + imperfect) := by …