-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnion_con_su_diferencia.thy
115 lines (108 loc) · 2.82 KB
/
Union_con_su_diferencia.thy
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
(* Union_con_su_diferencia.thy
Unión con su diferencia
José A. Alonso Jiménez
Sevilla, 1 de marzo de 2024
---------------------------------------------------------------------
*)
(* ---------------------------------------------------------------------
Demostrar que
(s \ t) \<union> t = s \<union> t
------------------------------------------------------------------- *)
theory Union_con_su_diferencia
imports Main
begin
(* 1\<ordfeminine> demostración *)
lemma "(s - t) \<union> t = s \<union> t"
proof (rule equalityI)
show "(s - t) \<union> t \<subseteq> s \<union> t"
proof (rule subsetI)
fix x
assume "x \<in> (s - t) \<union> t"
then show "x \<in> s \<union> t"
proof (rule UnE)
assume "x \<in> s - t"
then have "x \<in> s"
by (simp only: DiffD1)
then show "x \<in> s \<union> t"
by (simp only: UnI1)
next
assume "x \<in> t"
then show "x \<in> s \<union> t"
by (simp only: UnI2)
qed
qed
next
show "s \<union> t \<subseteq> (s - t) \<union> t"
proof (rule subsetI)
fix x
assume "x \<in> s \<union> t"
then show "x \<in> (s - t) \<union> t"
proof (rule UnE)
assume "x \<in> s"
show "x \<in> (s - t) \<union> t"
proof (cases \<open>x \<in> t\<close>)
assume "x \<in> t"
then show "x \<in> (s - t) \<union> t"
by (simp only: UnI2)
next
assume "x \<notin> t"
with \<open>x \<in> s\<close> have "x \<in> s - t"
by (rule DiffI)
then show "x \<in> (s - t) \<union> t"
by (simp only: UnI1)
qed
next
assume "x \<in> t"
then show "x \<in> (s - t) \<union> t"
by (simp only: UnI2)
qed
qed
qed
(* 2\<ordfeminine> demostración *)
lemma "(s - t) \<union> t = s \<union> t"
proof
show "(s - t) \<union> t \<subseteq> s \<union> t"
proof
fix x
assume "x \<in> (s - t) \<union> t"
then show "x \<in> s \<union> t"
proof
assume "x \<in> s - t"
then have "x \<in> s"
by simp
then show "x \<in> s \<union> t"
by simp
next
assume "x \<in> t"
then show "x \<in> s \<union> t"
by simp
qed
qed
next
show "s \<union> t \<subseteq> (s - t) \<union> t"
proof
fix x
assume "x \<in> s \<union> t"
then show "x \<in> (s - t) \<union> t"
proof
assume "x \<in> s"
show "x \<in> (s - t) \<union> t"
proof
assume "x \<notin> t"
with \<open>x \<in> s\<close> show "x \<in> s - t"
by simp
qed
next
assume "x \<in> t"
then show "x \<in> (s - t) \<union> t"
by simp
qed
qed
qed
(* 3\<ordfeminine> demostración *)
lemma "(s - t) \<union> t = s \<union> t"
by (fact Un_Diff_cancel2)
(* 4\<ordfeminine> demostración *)
lemma "(s - t) \<union> t = s \<union> t"
by auto
end