Lean / Reader
Lean readerParityPalettes.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports SharedColour, which it does not have: you can read it there, but it will not check. Build the project itself to check it.
import SharedColournamespace ParityPalettesdef globalColour (w i : Nat) := (w >>> (3*i)) % 8def validWord (w n : Nat) : Bool :=(List.range n).all fun s => (List.range ((n-1-s)/3)).all fun j =>let d := j+1differentThree (globalColour w s) (globalColour w (s+d))(globalColour w (s+2*d)) (globalColour w (s+3*d))def respects (w n : Nat) (left right : List Nat) : Bool :=(List.range n).all fun i => (if i%2=0 then left else right).contains (globalColour w i)theorem witness34 : ∃ w : Nat, validWord w 34 = true ∧ respects w 34 [0, 1, 2, 3] [0, 4, 5, 6] = true := byexact ⟨4022860443791501417479137340001, by decide +kernel, by decide +kernel⟩theorem witness36 : ∃ w : Nat, validWord w 36 = true ∧ respects w 36 [0, 1, 2, 3] [4, 5, 6, 7] = true := byexact ⟨297949488540913504895719722060384, by decide +kernel, by decide +kernel⟩end ParityPalettes