-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReglas_de_la_negacion.lean
176 lines (144 loc) · 2.64 KB
/
Reglas_de_la_negacion.lean
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
-- Reglas de la negación
-- =====================
import tactic
variables (P Q : Prop)
-- Eliminación del falso
-- ---------------------
-- ----------------------------------------------------
-- Ej. 1. (p. 14) Demostrar que
-- ⊥ ⊢ P
-- ----------------------------------------------------
-- 1ª demostración
example
(h : false)
: Q :=
false.elim h
-- 2ª demostración
example
(h : false)
: Q :=
-- by library_search
false.rec Q h
-- 3ª demostración
example
(h : false)
: Q :=
begin
exfalso,
exact h,
end
-- 4ª demostración
example
(h : false)
: P :=
-- by hint
by tauto
-- 5ª demostración
example
(h : false)
: P :=
by cases h
-- 6ª demostración
example
(h : false)
: P :=
by finish
-- 7ª demostración
example
(h : false)
: P :=
by solve_by_elim
-- Definición de la negación
-- -------------------------
-- #reduce ¬P
-- ¬P ≡ (P → false)
-- Eliminación de la negación
-- --------------------------
-- ----------------------------------------------------
-- Ej. 2. Demostrar que
-- P, ¬P ⊢ ⊥
-- ----------------------------------------------------
-- 1ª demostración
example
(h1: P)
(h2: ¬P)
: false :=
not.elim h2 h1
-- 2ª demostración
example
(h1: P)
(h2: ¬P)
: false :=
begin
apply h2,
exact h1,
end
-- 3ª demostración
example
(h1: P)
(h2: ¬P)
: false :=
absurd h1 h2
-- 4ª demostración
example
(h1: P)
(h2: ¬P)
: false :=
-- by library_search
h2 h1
-- Introducción de la negación
-- ---------------------------
-- ----------------------------------------------------
-- Ej. 3. Demostrar
-- ¬(P ∧ ¬P)
-- ----------------------------------------------------
-- 1ª demostración
example : ¬(P ∧ ¬P) :=
not.intro
( assume h : P ∧ ¬P,
have h1 : P := h.1,
have h2 : ¬P := h.2,
show false, from h2 h1 )
-- 2ª demostración
example : ¬(P ∧ ¬P) :=
not.intro
( assume h : P ∧ ¬P,
show false, from h.2 h.1 )
-- 3ª demostración
example : ¬(P ∧ ¬P) :=
not.intro
( assume h : P ∧ ¬P, h.2 h.1 )
-- 4ª demostración
example : ¬(P ∧ ¬P) :=
not.intro (λ h, h.2 h.1)
-- 5ª demostración
example : ¬(P ∧ ¬P) :=
begin
intro h,
cases h with h1 h2,
apply h2,
exact h1,
end
-- 6ª demostración
example : ¬(P ∧ ¬P) :=
begin
rintro ⟨h1, h2⟩,
exact h2 h1,
end
-- 7ª demostración
example : ¬(P ∧ ¬P) :=
λ ⟨h1, h2⟩, h2 h1
-- 8ª demostración
example : ¬(P ∧ ¬P) :=
-- by suggest
(and_not_self P).mp
-- 9ª demostración
example : ¬(P ∧ ¬P) :=
-- by hint
by tauto
-- 10ª demostración
example : ¬(P ∧ ¬P) :=
by finish
-- 11ª demostración
example : ¬(P ∧ ¬P) :=
by simp