multi_label_span_sanity
Sanity check: labels {0, 4} and {2} have span 4.
Statement
theorem multi_label_span_sanity : multi_label_span (fun i : Fin 2 => if i = 0 then ({0, 4} : Finset ℕ) else {2}) = 4
- Source
- sanity check for multi_label_span (PR-281)
- Verified
- 20 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- multi_label_spanThe span of a multi-labeling: the largest label used minus the smallest (written as the largest difference b - a over all pairs of labels).
The proof, explained
This theorem verifies by finite computation that the multi-label span of the labeling on `Fin 2` assigning $\{0, 4\}$ to $0$ and $\{2\}$ to $1$ is equal to 4. Since all domains and sets involved are finite, the entire expression evaluates to 4 directly via `decide`.
The multi-label span of the given function on `Fin 2` is 4. automation
The labeling assigns the set $\{0, 4\}$ to index $0$ and $\{2\}$ to index $1$. By definition, the multi-label span is the maximum value of $b - a$ over all choices of indices $x, y \in \mathrm{Fin}\;2$ and elements $a \in f(x), b \in f(y)$. Since the domain and the sets are finite, the claim is a decidable equality between natural numbers, which `decide` computes directly (the maximum is achieved with $a = 0$ and $b = 4$, yielding $4 - 0 = 4$).
multi_label_span (fun i : Fin 2 => if i = 0 then ({0, 4} : Finset ℕ) else {2}) = 4 := by decide
- The tactic `decide` evaluates the finite supremum directly in Lean's computational kernel without generating intermediate proof steps.
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 multi_label_span_sanity : multi_label_span (fun i : Fin 2 => if i = 0 then ({0, 4} : Finset ℕ) else {2}) = 4 := by decide