rev_comp_sanity
The reverse complement of 011 under n ↦ 3 − n is 223.
Statement
theorem rev_comp_sanity : rev_comp (fun n : ℕ => 3 - n) [0, 1, 1] = [2, 2, 3]
- Source
- Sanity check of rev_comp (arXiv:2611.16573)
- Verified
- 14 Nov 2026
- Axioms
- none — Lean reports it depends on no axioms
- Built on 1
- rev_compThe reverse complement rc(s) of a string s = a_1…a_m under a complement map cm is cm(a_m)…cm(a_1).
The proof, explained
The theorem verifies that applying the reverse complement with function $n \mapsto 3 - n$ to the list $[0, 1, 1]$ results in $[2, 2, 3]$. By definition, `rev_comp` maps the function across the list and reverses the outcome. The claim is settled purely by direct computation on finite lists.
rev_comp (fun n => 3 - n) [0, 1, 1] = [2, 2, 3] automation
By definition, `rev_comp` applies the function $n \mapsto 3 - n$ to each element of the list $[0, 1, 1]$, yielding $[3 - 0, 3 - 1, 3 - 1] = [3, 2, 2]$, and then reverses the result to obtain $[2, 2, 3]$. Because this is a finite computation on concrete lists, the `decide` tactic closes the goal by evaluating the expression directly.
theorem rev_comp_sanity : rev_comp (fun n : ℕ => 3 - n) [0, 1, 1] = [2, 2, 3] := by decide
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.
theorem rev_comp_sanity : rev_comp (fun n : ℕ => 3 - n) [0, 1, 1] = [2, 2, 3] := by decide