File size: 1,105 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | import Mathlib
namespace OAI
namespace SnakyConditional
variable {Ξ± : Type*} [DecidableEq Ξ±]
inductive WinsIn (win : Finset Ξ± β Prop) : β β Finset Ξ± β Finset Ξ± β Prop
| done {n M B} : win M β WinsIn win n M B
| move {n M B} (x : Ξ±) (hxM : x β M) (hxB : x β B)
(next : β b, b β insert x M β b β B β
WinsIn win n (insert x M) (insert b B)) :
WinsIn win (n + 1) M B
def Template (win : Finset Ξ± β Prop) (n : β) (A H : Finset Ξ±) : Prop :=
β M B, Disjoint M B β A β M β Disjoint B H β WinsIn win n M B
abbrev Cell := β€ Γ β€
def snaky : Finset Cell := {(0, 0), (1, 0), (2, 0), (3, 0), (3, 1), (4, 1)}
def orient (r : Fin 8) (p : Cell) : Cell :=
match r.val with
| 0 => (p.1, p.2)
| 1 => (p.2, p.1)
| 2 => (p.1, -p.2)
| 3 => (-p.2, p.1)
| 4 => (-p.1, p.2)
| 5 => (p.2, -p.1)
| 6 => (-p.1, -p.2)
| _ => (-p.2, -p.1)
def placement (r : Fin 8) (t p : Cell) : Cell := orient r p + t
def HasSnaky (M : Finset Cell) : Prop :=
β (r : Fin 8) (t : Cell), snaky.image (placement r t) β M
end SnakyConditional
end OAI
|