oddFoldDiag_length
The diagonal of the odd fold of a list d has length 2 * |d| + 1.
Statement
theorem oddFoldDiag_length {R : Type*} [Zero R] (d : List R) : (oddFoldDiag d).length = 2 * d.length + 1
- Source
- arXiv:2611.28952, Section 1.1, (2)
- Verified
- 25 Nov 2026
- Axioms
Quot.soundpropext- Built on 1
- oddFoldDiagThe diagonal sequence of the odd fold of a tridiagonal pair: for a diagonal list d, it is the list obtained by concatenating d, 0, and the…
Read back from the Lean
For any type $R$ with a zero element ([Zero R]) and any list $d$ of elements of $R$, the length of oddFoldDiag d is equal to $2 * d.\\text{length} + 1$.
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
The proof, explained
The proof expands the definition of `oddFoldDiag d`, which concatenates d with 0 followed by the reverse of d. Simplifying the length of this concatenation reduces the goal to |d| + (|d| + 1) = 2 * |d| + 1, which holds by basic arithmetic.
The length of the odd fold diagonal reduces to |d| + (|d| + 1)
By definition, `oddFoldDiag d` is d ++ 0 :: d.reverse. The length of a concatenation is the sum of the lengths, and reversing a list preserves its length, so the total length is |d| + 1 + |d|, written as |d| + (|d| + 1).
uses
oddFoldDiagsimp [oddFoldDiag]|d| + (|d| + 1) = 2 * |d| + 1 automation
This is an identity of linear integer arithmetic on natural numbers (n + (n + 1) = 2n + 1), resolved automatically by `omega`.
omega
oddFoldDiag- the diagonal list obtained by appending 0 and the reversal of d to d, that is, d ++ 0 :: d.reverse
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
/-- Length of the diagonal of an odd fold. -/theorem oddFoldDiag_length {R : Type*} [Zero R] (d : List R) : (oddFoldDiag d).length = 2 * d.length + 1 := by simp [oddFoldDiag] omega