Reconstruction with Lyndon patterns

Lax100001.Lyndon · concepts/Lax100001/Lyndon.lean · lax-100001

proven

Natural Language Statement

Theorem

Every query is a Lyndon word: it is smaller than each of its proper rotations. Even so, every binary word can be reconstructed. The number of queries on a word of length nn is at most a constant times 1+log⁡2n1 + \log_2 n, where log⁡2\log_2 is the integer logarithm, which rounds down.

Concept map
100%

Preparing this local graph with the browser’s fonts…

Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A
Evidence

Each proof establishes this claim relative to its assumptions.

In the paper

  • page 2 of this submission's paper

Lean source

1/-
2Copyright (c) 2026 Anonymous. All rights reserved.
3Released under Apache 2.0 license as described in the file LICENSE.
4Authors: ChatGPT (OpenAI), Claude (Anthropic)
5-/
6import Lax100001.Counting
7import Mathlib.Data.Nat.Log
8
9/-!
10---
11title: Reconstruction with Lyndon patterns
12type: theorem
13---
14Every query is a Lyndon word: it is smaller than each of its proper rotations. Even so, every
15binary word can be reconstructed. The number of queries on a word of length nn is at most a
16constant times 1+log⁡2n1 + \log_2 n, where log⁡2\log_2 is the integer logarithm, which rounds down.
17-/
18
19namespace Lax100001.Lyndon
20
21/-- The bound 1+log⁡2n1 + \log_2 n on the number of queries for a word of length nn. The integer
22logarithm Nat.log 2 n\texttt{Nat.log 2 n} is the largest kk with 2k≤n2^k \le n, and 00 when n=0n = 0. For
23example Nat.log 2 8=3\texttt{Nat.log 2 8} = 3 and Nat.log 2 9=3\texttt{Nat.log 2 9} = 3. -/
24def rate (n : ℕ) : ℝ := ((1 + Nat.log 2 n : ℕ) : ℝ)
25
26/-- One rule reconstructs every binary word with Lyndon queries only, using a number of queries
27that is at most a constant times rate\mathit{rate}. -/
28axiom reconstruction : Counting.Reconstructs Counting.IsLyndon rate
29
30end Lax100001.Lyndon
31
Builds on
Used by

none

From Mathlib