-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStrictRecursivelyEnumerable.lean
More file actions
104 lines (91 loc) · 4.32 KB
/
Copy pathStrictRecursivelyEnumerable.lean
File metadata and controls
104 lines (91 loc) · 4.32 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
module
public import Langlib.Classes.Recursive.Definition
public import Langlib.Classes.RecursivelyEnumerable.Definition
import Langlib.Classes.Recursive.Closure.Complement
import Langlib.Classes.Recursive.Inclusion.RecursivelyEnumerable
public import Langlib.Classes.RecursivelyEnumerable.Closure.Complement
import Langlib.Utilities.ClosurePredicates.Transport
import Mathlib.Algebra.Order.Floor.Extended
import Mathlib.Algebra.Order.Floor.Semifield
import Mathlib.Algebra.Order.Interval.Basic
import Mathlib.Analysis.Complex.UpperHalfPlane.Basic
import Mathlib.Analysis.SpecialFunctions.Bernstein
import Mathlib.Analysis.SpecialFunctions.Gamma.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.DerivHyp
import Mathlib.CategoryTheory.Category.Init
import Mathlib.Combinatorics.Enumerative.DyckWord
import Mathlib.Combinatorics.SimpleGraph.Triangle.Removal
import Mathlib.Data.NNRat.Floor
import Mathlib.Data.Nat.Factorial.DoubleFactorial
import Mathlib.Geometry.Euclidean.Altitude
import Mathlib.NumberTheory.Height.Basic
import Mathlib.NumberTheory.LucasLehmer
import Mathlib.NumberTheory.SelbergSieve
import Mathlib.Tactic.NormNum.BigOperators
import Mathlib.Tactic.NormNum.Irrational
import Mathlib.Tactic.NormNum.IsCoprime
import Mathlib.Tactic.NormNum.IsSquare
import Mathlib.Tactic.NormNum.LegendreSymbol
import Mathlib.Tactic.NormNum.ModEq
import Mathlib.Tactic.NormNum.NatFactorial
import Mathlib.Tactic.NormNum.NatFib
import Mathlib.Tactic.NormNum.NatLog
import Mathlib.Tactic.NormNum.NatSqrt
import Mathlib.Tactic.NormNum.Ordinal
import Mathlib.Tactic.NormNum.Parity
import Mathlib.Tactic.NormNum.Prime
import Mathlib.Tactic.NormNum.RealSqrt
import Mathlib.Topology.Sheaves.Init
@[expose]
public section
/-! # Strict Inclusion: Recursive ⊊ RE
This file proves that recursive languages form a strict subclass of recursively
enumerable languages.
The proof is indirect. If every RE language over the unary alphabet were recursive,
then RE would be closed under complement: move an RE language into `Recursive`, take
the recursive complement, and use `Recursive ⊆ RE`. This contradicts RE non-closure under
complement.
## Main declarations
- `haltingUnaryLanguage_not_Recursive` — the unary halting language is RE but not recursive.
- `Recursive_strict_subclass_RE_of_card` — strict inclusion over every finite alphabet
with at least 1 element.
- `Recursive_subclass_RE_and_exists_strict` — class-level inclusion plus a strict
witness alphabet.
-/
open Language
/-- The concrete unary halting language is not recursive. -/
public theorem haltingUnaryLanguage_not_Recursive :
¬ is_Recursive haltingUnaryLanguage := by
intro hrec
have hcompRec : is_Recursive haltingUnaryLanguageᶜ :=
is_Recursive_complement hrec
have hcompRE : is_RE haltingUnaryLanguageᶜ :=
Recursive_subset_RE hcompRec
exact haltingUnary_complement_not_RE hcompRE
/-- Recursive languages over any nonempty finite alphabet form a strict subclass of RE. -/
theorem Recursive_strict_subclass_RE_of_nonempty {T : Type} [DecidableEq T] [Fintype T]
[Nonempty T] :
(Recursive : Set (Language T)) ⊂ (RE : Set (Language T)) :=
strict_subset_of_subset_different_property
(P := is_Recursive) (Q := is_RE)
(fun _ hL => Recursive_subset_RE hL)
(X := ClosedUnderComplement)
(fun hiff => ClosedUnderComplement_of_iff hiff)
Recursive_closedUnderComplement
RE_notClosedUnderComplement_of_nonempty
/-- Recursive languages form a strict subclass of recursively enumerable languages
over every finite alphabet with at least 1 element. -/
public theorem Recursive_strict_subclass_RE_of_card {T : Type} [Fintype T]
(hT : 1 ≤ Fintype.card T) :
(Recursive : Set (Language T)) ⊂ (RE : Set (Language T)) := by
let : Nonempty T := Fintype.card_pos_iff.mp (by omega)
let : DecidableEq T := Classical.decEq T
exact Recursive_strict_subclass_RE_of_nonempty
/-- Recursive languages are included in RE for every finite alphabet, and the inclusion
is strict for at least one alphabet. -/
theorem Recursive_subclass_RE_and_exists_strict :
(∀ T : Type, [DecidableEq T] → [Fintype T] →
(Recursive : Set (Language T)) ⊆ (RE : Set (Language T))) ∧
(∃ T : Type, (Recursive : Set (Language T)) ⊂ (RE : Set (Language T))) :=
⟨fun _ _ _ => Recursive_subset_RE,
⟨Unit, Recursive_strict_subclass_RE_of_card (T := Unit) (by simp)⟩⟩