-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPropiedad_semidistributiva_de_la_interseccion_sobre_la_union_2.lean
101 lines (86 loc) · 2.38 KB
/
Propiedad_semidistributiva_de_la_interseccion_sobre_la_union_2.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
-- Propiedad_semidistributiva_de_la_interseccion_sobre_la_union_2.lean
-- (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u)
-- José A. Alonso Jiménez <https://jaalonso.github.io>
-- Sevilla, 23-febrero-2024
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Demostrar que
-- (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u)
-- ----------------------------------------------------------------------
-- Demostración en lenguaje natural
-- ================================
-- Sea x ∈ (s ∩ t) ∪ (s ∩ u). Entonces son posibles dos casos.
--
-- 1º caso: Supongamos que x ∈ s ∩ t. Entonces, x ∈ s y x ∈ t (y, por
-- tanto, x ∈ t ∪ u). Luego, x ∈ s ∩ (t ∪ u).
--
-- 2º caso: Supongamos que x ∈ s ∩ u. Entonces, x ∈ s y x ∈ u (y, por
-- tanto, x ∈ t ∪ u). Luego, x ∈ s ∩ (t ∪ u).
-- Demostraciones con Lean4
-- ========================
import Mathlib.Data.Set.Basic
import Mathlib.Tactic
open Set
variable {α : Type}
variable (s t u : Set α)
-- 1ª demostración
-- ===============
example : (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u):=
by
intros x hx
-- x : α
-- hx : x ∈ s ∩ t ∪ s ∩ u
-- ⊢ x ∈ s ∩ (t ∪ u)
rcases hx with (xst | xsu)
. -- xst : x ∈ s ∩ t
constructor
. -- ⊢ x ∈ s
exact xst.1
. -- ⊢ x ∈ t ∪ u
left
-- ⊢ x ∈ t
exact xst.2
. -- xsu : x ∈ s ∩ u
constructor
. -- ⊢ x ∈ s
exact xsu.1
. -- ⊢ x ∈ t ∪ u
right
-- ⊢ x ∈ u
exact xsu.2
-- 2ª demostración
-- ===============
example : (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u):=
by
rintro x (⟨xs, xt⟩ | ⟨xs, xu⟩)
. -- x : α
-- xs : x ∈ s
-- xt : x ∈ t
-- ⊢ x ∈ s ∩ (t ∪ u)
use xs
-- ⊢ x ∈ t ∪ u
left
-- ⊢ x ∈ t
exact xt
. -- x : α
-- xs : x ∈ s
-- xu : x ∈ u
-- ⊢ x ∈ s ∩ (t ∪ u)
use xs
-- ⊢ x ∈ t ∪ u
right
-- ⊢ x ∈ u
exact xu
-- 3ª demostración
-- ===============
example : (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u):=
by rw [inter_union_distrib_left s t u]
-- 4ª demostración
-- ===============
example : (s ∩ t) ∪ (s ∩ u) ⊆ s ∩ (t ∪ u):=
by
intros x hx
-- x : α
-- hx : x ∈ s ∩ t ∪ s ∩ u
-- ⊢ x ∈ s ∩ (t ∪ u)
aesop