parity_game_encode_two_vertex_example
The encoding of the two-vertex game with owners (Even, Odd), priorities (0, 1), edges 0→1 and 1→0, and start vertex 1 is the 14-bit list 110 10 1 0 01 0 10 10 (1 = true): n = 2 in unary, the vertex 1 in unary, then the blocks of vertices 0 and 1.
Statement
theorem parity_game_encode_two_vertex_example : parity_game_encode 2 ![true, false] ![0, 1] (fun u w => decide (u ≠ w)) 1 = [true, true, false, true, false, true, false, false, true, false, true, false, true, false]
- Source
- Sanity lemma for the encoding used to state OP-37
- Verified
- 19 Nov 2026
- Axioms
propext- Built on 1
- parity_game_encodeFor a natural number n, an owner map own : Fin n → Bool, a priority map prio : Fin n → ℕ, an edge relation E : Fin n → Fin n → Bool and a…
The proof, explained
The theorem asserts that the bit-string encoding of a concrete two-vertex parity game matches a specific 14-element boolean list. Because all components of the game (vertex count, start vertex, player ownership, priorities, and edge relations) are fully concrete finite objects, the encoding function simplifies entirely by finite evaluation. Lean's `decide` tactic computes both sides to normal form and verifies that they are identical.
The encoding of the specified two-vertex parity game evaluates to the given 14-bit list. automation
All parameters in the call to `parity_game_encode` are concrete finite terms: the number of vertices is 2, the start vertex is 1, and the ownership, priorities, and edge relations are given explicitly by finite vectors and boolean decisions. Expanding the definition of `parity_game_encode` computes: 1. The vertex count $n = 2$ as two `true`s followed by `false`: `[true, true, false]`. 2. The initial vertex index $v = 1$ as one `true` followed by `false`: `[true, false]`. 3. The block for vertex 0: owner `true`, priority 0 (`[false]`), and outgoing edges $0 \neq 0$ (`false`) and $0 \neq 1$ (`true`), producing `[true, false, false, true]`. 4. The block for vertex 1: owner `false`, priority 1 (`[true, false]`), and outgoing edges $1 \neq 0$ (`true`) and $1 \neq 1$ (`false`), producing `[false, true, false, true, false]`. Concatenating these blocks yields the 14-bit boolean list on the right-hand side. The `decide` tactic checks this equality by direct computation.
decide
- The equality is proved purely by computational reflection: Lean evaluates the decidable equality of two concrete boolean lists to `true`.
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 parity_game_encode_two_vertex_example : parity_game_encode 2 ![true, false] ![0, 1] (fun u w => decide (u ≠ w)) 1 = [true, true, false, true, false, true, false, false, true, false, true, false, true, false] := by decide