f0679799 / PvsNP / Language.lean

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