| 1 | /-! |
| 2 | # Languages |
| 3 | |
| 4 | A *decision problem* is a language: a set of finite words over an alphabet `α`. We represent a set of |
| 5 | words by its membership predicate. The alphabet is meant to be finite; the complexity classes require |
| 6 | `IsFinite α` where it matters. |
| 7 | -/ |
| 8 | |
| 9 | namespace PvsNP |
| 10 | |
| 11 | |
| 12 | abbrev Language (α : Type) := List α → Prop |
| 13 | |
| 14 | namespace Language |
| 15 | |
| 16 | variable {α : Type} |
| 17 | |
| 18 | |
| 19 | def compl (L : Language α) : Language α := fun x => ¬ L x |
| 20 | |
| 21 | |
| 22 | def univ : Language α := fun _ => True |
| 23 | |
| 24 | |
| 25 | def empty : Language α := fun _ => False |
| 26 | |
| 27 | @[simp] theorem compl_apply (L : Language α) (x : List α) : compl L x ↔ ¬ L x := Iff.rfl |
| 28 | |
| 29 | theorem compl_compl (L : Language α) (x : List α) : compl (compl L) x ↔ L x := by |
| 30 | simp only [compl_apply, Classical.not_not] |
| 31 | |
| 32 | end Language |
| 33 | |
| 34 | end PvsNP |