-
Notifications
You must be signed in to change notification settings - Fork 1
/
Implicacion_mediante_disyuncion_y_negacion.lean
100 lines (89 loc) · 1.49 KB
/
Implicacion_mediante_disyuncion_y_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
-- ---------------------------------------------------------------------
-- Ejercicio. Demostrar que
-- (P → Q) ↔ ¬ P ∨ Q
-- ----------------------------------------------------------------------
import tactic
open_locale classical
-- 1ª demostración
-- ===============
example
(P Q : Prop)
: (P → Q) ↔ ¬ P ∨ Q :=
begin
split,
{ intro h1,
by_cases h2: P,
{ right,
apply h1,
exact h2 },
{ left,
exact h2 }},
{ intros h3 h4,
cases h3,
{ contradiction },
{ assumption }},
end
-- Prueba
-- ======
/-
P Q : Prop
⊢ P → Q ↔ ¬P ∨ Q
>> split,
| 2 goals
| P Q : Prop
| ⊢ (P → Q) → ¬P ∨ Q
| >> { intro h1,
| h1 : P → Q
| ⊢ ¬P ∨ Q
| >> by_cases h2: P,
| | 2 goals
| | P Q : Prop,
| | h1 : P → Q,
| | h2 : P
| | ⊢ ¬P ∨ Q
| | >> { right,
| | ⊢ Q
| | >> apply h1,
| | ⊢ P
| | >> exact h2 },
| P Q : Prop,
| h1 : P → Q,
| h2 : ¬P
| ⊢ ¬P ∨ Q
| >> { left,
| ⊢ ¬P
| >> exact h2 }},
P Q : Prop
⊢ ¬P ∨ Q → P → Q
>> { intros h3 h4,
h3 : ¬P ∨ Q,
h4 : P
⊢ Q
>> cases h3,
| 2 goals
| case or.inl
| P Q : Prop,
| h4 : P,
| h3 : ¬P
| ⊢ Q
| >> { contradiction },
case or.inr
P Q : Prop,
h4 : P,
h3 : Q
⊢ Q
>> { assumption }},
no goals
-/
-- 2ª demostración
-- ===============
example
(P Q : Prop)
: (P → Q) ↔ ¬ P ∨ Q :=
imp_iff_not_or
-- 3ª demostración
-- ===============
example
(P Q : Prop)
: (P → Q) ↔ ¬ P ∨ Q :=
by tauto