-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConmutativa_de_la_interseccion.lean
120 lines (100 loc) · 2.3 KB
/
Conmutativa_de_la_interseccion.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
-- ---------------------------------------------------------------------
-- Ejercicio. Demostrar que
-- s ∩ t = t ∩ s
-- ----------------------------------------------------------------------
import tactic
open set
variable {α : Type*}
variables (s t u : set α)
-- 1ª demostración
-- ===============
example : s ∩ t = t ∩ s :=
begin
ext x,
simp only [mem_inter_eq],
split,
{ rintros ⟨xs, xt⟩,
exact ⟨xt, xs⟩ },
{ rintros ⟨xt, xs⟩,
exact ⟨xs, xt⟩ },
end
-- Prueba
-- ======
/-
α : Type u_1,
s t : set α
⊢ s ∩ t = t ∩ s
>> ext x,
x : α
⊢ x ∈ s ∩ t ↔ x ∈ t ∩ s
>> simp only [mem_inter_eq],
⊢ x ∈ s ∧ x ∈ t ↔ x ∈ t ∧ x ∈ s
>> split,
| ⊢ x ∈ s ∧ x ∈ t → x ∈ t ∧ x ∈ s
| >> { rintros ⟨xs, xt⟩,
| xs : x ∈ s,
| xt : x ∈ t
| ⊢ x ∈ t ∧ x ∈ s
| >> exact ⟨xt, xs⟩ },
⊢ x ∈ t ∧ x ∈ s → x ∈ s ∧ x ∈ t
>> { rintros ⟨xt, xs⟩,
xt : x ∈ t,
xs : x ∈ s
⊢ x ∈ s ∧ x ∈ t
>> exact ⟨xs, xt⟩ },
no goals
-/
-- Comentarios:
-- 1. La táctica (ext x) transforma la conclusión (s = t) en
-- (x ∈ s ↔ x ∈ t).
-- 2. Se ha usado el lema
-- + mem_inter_eq x s t : x ∈ s ∩ t = (x ∈ s ∧ x ∈ t)
-- Comprobación:
variable (x : α)
-- #check @mem_inter_eq _ x s t
-- 2ª demostración
-- ===============
example : s ∩ t = t ∩ s :=
ext $ λ x, ⟨λ ⟨xs, xt⟩, ⟨xt, xs⟩, λ ⟨xt, xs⟩, ⟨xs, xt⟩⟩
-- Comentario: La notación `f $ ...` es equivalente a `f (...)`.
-- 3ª demostración
-- ===============
example : s ∩ t = t ∩ s :=
by ext x; simp [and.comm]
-- 4ª demostración
-- ===============
example : s ∩ t = t ∩ s :=
inf_comm
-- 5ª demostración
-- ===============
example : s ∩ t = t ∩ s :=
begin
apply subset.antisymm,
{ rintros x ⟨xs, xt⟩,
exact ⟨xt, xs⟩ },
{ rintros x ⟨xt, xs⟩,
exact ⟨xs, xt⟩ },
end
-- Prueba
-- ======
/-
α : Type u_1,
s t : set α
⊢ s ∩ t = t ∩ s
>> apply subset.antisymm,
| ⊢ s ∩ t ⊆ t ∩ s
| >> { rintros x ⟨xs, xt⟩,
| x : α,
| xs : x ∈ s,
| xt : x ∈ t
| ⊢ x ∈ t ∩ s
| >> exact ⟨xt, xs⟩ },
⊢ t ∩ s ⊆ s ∩ t
>> { rintros x ⟨xt, xs⟩,
x : α,
xt : x ∈ t,
xs : x ∈ s
⊢ x ∈ s ∩ t
>> exact ⟨xs, xt⟩ },
no goals
-/