introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.11 kB
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