-
Notifications
You must be signed in to change notification settings - Fork 1
/
Examples.v
131 lines (122 loc) · 3.95 KB
/
Examples.v
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Require Import List Modal_Library Modal_Notations Deductive_System Modal_Tactics Sets.
Import ListNotations.
Context `{X: modal_index_set}.
Definition fixed_point A G i :=
forall f,
exists p,
(A; G |-- [! (p <-> f ([i] p))!]).
Definition subset {T} (P: T -> Prop) (Q: T -> Prop): Prop :=
forall x, P x -> Q x.
(* Some quick automation! *)
Local Hint Unfold subset: modal.
Local Hint Constructors P: modal.
Local Hint Constructors K: modal.
Local Hint Constructors K4: modal.
Theorem Lob:
(* Löb's theorem is provable in any superset of K4 with fixed points. *)
forall A i,
subset (K4 i) A /\ fixed_point A Empty i ->
forall p,
(A; Empty |-- [! [i]p -> p !]) ->
(A; Empty |-- [! p !]).
Proof.
set (G := Empty).
(* Step 1. *)
intros A i [I FP] p H1.
(* Step 2. *)
destruct FP with (fun X => [! X -> p !]) as (psi, H2).
(* Step 3. *)
assert (A; G |-- [! psi -> [i]psi -> p !]) as H3.
apply modal_ax5 in H2; auto with modal.
(* Step 4. *)
assert (A; G |-- [! [i](psi -> [i]psi -> p) !]) as H4.
apply Nec; auto.
(* Step 5. *)
assert (A; G |-- [! [i]psi -> [i]([i]psi -> p) !]) as H5.
apply modal_axK in H4; auto with modal.
(* Step 6. *)
assert (A; G |-- [! [i]([i]psi -> p) -> [i][i]psi -> [i]p !]) as H6.
eapply Ax with (a := axK i ?[X] ?[Y]); auto with modal.
reflexivity.
(* Step 7. *)
assert (A; G |-- [! [i]psi -> [i][i]psi -> [i]p !]) as H7.
eapply modal_syllogism; eauto with modal.
(* Step 8. *)
assert (A; G |-- [! [i]psi -> [i][i]psi !]) as H8.
apply modal_axK4; auto with modal.
(* Step 9. *)
assert (A; G |-- [! [i]psi -> [i]p !]) as H9.
eapply modal_ax2; eauto with modal.
(* Step 10. *)
assert (A; G |-- [! [i]psi -> p !]) as H10.
eapply modal_syllogism; eauto with modal.
(* Step 11. *)
assert (A; G |-- [! ([i]psi -> p) -> psi !]) as H11.
apply modal_ax6 in H2; auto with modal.
(* Step 12. *)
assert (A; G |-- psi) as H12.
eapply Mp; try eassumption.
(* Step 13. *)
assert (A; G |-- [! [i]psi !]) as H13.
apply Nec; try assumption.
(* Step 14. *)
eapply Mp; eassumption.
Qed.
(* TODO: review later!
Definition fromList (ps: list formula): theory :=
fun p =>
In p ps.
Example Ex1:
(* TODO: fix notation for deduction! *)
T; (fromList ([! [](#0 -> #1) !] :: [! [](#1 -> #2) !] :: nil)) |--
[! [](#0 -> #2) !].
Proof.
(* Line: 16 *)
apply Nec.
(* Line: 15 *)
apply Mp with (f := [! #0 -> #1 !]).
(* Line: 14 *)
- apply Mp with (f := [! #1 -> #2 !]).
(* Line: 9 *)
+ apply Mp with (f := [! (#1 -> #2) -> (#0 -> (#1 -> #2)) !]).
(* Line: 7 *)
* apply Mp with (f := [! (#1 -> #2) -> ((#0 -> (#1 -> #2)) -> (#0 -> #1) -> (#0 -> #2)) !]).
(* Line: 6 *)
-- apply Ax with (a := ax2 [! #1 -> #2 !] [! #0 -> (#1 -> #2) !] [! (#0 -> #1) -> (#0 -> #2) !]).
++ constructor.
constructor.
++ reflexivity.
(* Line: 5 *)
-- apply Mp with (f := [! (#0 -> (#1 -> #2)) -> ((#0 -> #1) -> (#0 -> #2)) !]).
(* Line: 3 *)
++ apply Ax with (a := ax1 [! (#0 -> (#1 -> #2)) -> ((#0 -> #1) -> (#0 -> #2)) !] [! #1 -> #2 !]).
** constructor.
constructor.
** reflexivity.
(* Line: 4 *)
++ apply Ax with (a := ax2 [! #0 !] [! #1 !] [! #2 !]).
** constructor; constructor.
** reflexivity.
(* Line: 8 *)
* apply Ax with (a := ax1 [! #1 -> #2 !] [! #0 !]).
-- constructor; constructor.
-- reflexivity.
(* Line: 11 *)
+ apply Mp with (f := [! [](#1 -> #2) !]).
* apply Ax with (a := axT [! #1 -> #2 !]).
-- constructor; constructor.
-- reflexivity.
(* Line: 2 *)
* apply Prem; simpl.
firstorder.
(* Line: 13 *)
- apply Mp with (f := [! [](#0 -> #1) !]).
(* Line: 12 *)
+ apply Ax with (a := axT [! #0 -> #1 !]).
* constructor; constructor.
* reflexivity.
(* Line: 1 *)
+ apply Prem; simpl.
firstorder.
Qed.
*)