-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnion_con_interseccion_general.thy
218 lines (210 loc) · 6.48 KB
/
Union_con_interseccion_general.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
(* Union_con_interseccion_general.thy
s \<union> (\<Inter> i, A i) = \<Inter> i, (A i \<union> s).
José A. Alonso Jiménez <https://jaalonso.github.io>
Sevilla, 11-marzo-2024
------------------------------------------------------------------ *)
(* ---------------------------------------------------------------------
Demostrar que
s \<union> (\<Inter> i. A i) = (\<Inter> i. A i \<union> s)
------------------------------------------------------------------- *)
theory Union_con_interseccion_general
imports Main
begin
(* 1\<ordfeminine> demostración *)
lemma "s \<union> (\<Inter> i \<in> I. A i) = (\<Inter> i \<in> I. A i \<union> s)"
proof (rule equalityI)
show "s \<union> (\<Inter> i \<in> I. A i) \<subseteq> (\<Inter> i \<in> I. A i \<union> s)"
proof (rule subsetI)
fix x
assume "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof (rule UnE)
assume "x \<in> s"
show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof (rule INT_I)
fix i
assume "i \<in> I"
show "x \<in> A i \<union> s"
using \<open>x \<in> s\<close> by (rule UnI2)
qed
next
assume h1 : "x \<in> (\<Inter> i \<in> I. A i)"
show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof (rule INT_I)
fix i
assume "i \<in> I"
with h1 have "x \<in> A i"
by (rule INT_D)
then show "x \<in> A i \<union> s"
by (rule UnI1)
qed
qed
qed
next
show "(\<Inter> i \<in> I. A i \<union> s) \<subseteq> s \<union> (\<Inter> i \<in> I. A i)"
proof (rule subsetI)
fix x
assume h2 : "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
proof (cases "x \<in> s")
assume "x \<in> s"
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
by (rule UnI1)
next
assume "x \<notin> s"
have "x \<in> (\<Inter> i \<in> I. A i)"
proof (rule INT_I)
fix i
assume "i \<in> I"
with h2 have "x \<in> A i \<union> s"
by (rule INT_D)
then show "x \<in> A i"
proof (rule UnE)
assume "x \<in> A i"
then show "x \<in> A i"
by this
next
assume "x \<in> s"
with \<open>x \<notin> s\<close> show "x \<in> A i"
by (rule notE)
qed
qed
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
by (rule UnI2)
qed
qed
qed
(* 2\<ordfeminine> demostración *)
lemma "s \<union> (\<Inter> i \<in> I. A i) = (\<Inter> i \<in> I. A i \<union> s)"
proof
show "s \<union> (\<Inter> i \<in> I. A i) \<subseteq> (\<Inter> i \<in> I. A i \<union> s)"
proof
fix x
assume "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof
assume "x \<in> s"
show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof
fix i
assume "i \<in> I"
show "x \<in> A i \<union> s"
using \<open>x \<in> s\<close> by simp
qed
next
assume h1 : "x \<in> (\<Inter> i \<in> I. A i)"
show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof
fix i
assume "i \<in> I"
with h1 have "x \<in> A i"
by simp
then show "x \<in> A i \<union> s"
by simp
qed
qed
qed
next
show "(\<Inter> i \<in> I. A i \<union> s) \<subseteq> s \<union> (\<Inter> i \<in> I. A i)"
proof
fix x
assume h2 : "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
proof (cases "x \<in> s")
assume "x \<in> s"
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
by simp
next
assume "x \<notin> s"
have "x \<in> (\<Inter> i \<in> I. A i)"
proof
fix i
assume "i \<in> I"
with h2 have "x \<in> A i \<union> s"
by (rule INT_D)
then show "x \<in> A i"
proof
assume "x \<in> A i"
then show "x \<in> A i"
by this
next
assume "x \<in> s"
with \<open>x \<notin> s\<close> show "x \<in> A i"
by simp
qed
qed
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
by simp
qed
qed
qed
(* 3\<ordfeminine> demostración *)
lemma "s \<union> (\<Inter> i \<in> I. A i) = (\<Inter> i \<in> I. A i \<union> s)"
proof
show "s \<union> (\<Inter> i \<in> I. A i) \<subseteq> (\<Inter> i \<in> I. A i \<union> s)"
proof
fix x
assume "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof
assume "x \<in> s"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
by simp
next
assume "x \<in> (\<Inter> i \<in> I. A i)"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
by simp
qed
qed
next
show "(\<Inter> i \<in> I. A i \<union> s) \<subseteq> s \<union> (\<Inter> i \<in> I. A i)"
proof
fix x
assume h2 : "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
proof (cases "x \<in> s")
assume "x \<in> s"
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
by simp
next
assume "x \<notin> s"
then show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
using h2 by simp
qed
qed
qed
(* 4\<ordfeminine> demostración *)
lemma "s \<union> (\<Inter> i \<in> I. A i) = (\<Inter> i \<in> I. A i \<union> s)"
proof
show "s \<union> (\<Inter> i \<in> I. A i) \<subseteq> (\<Inter> i \<in> I. A i \<union> s)"
proof
fix x
assume "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
then show "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
proof
assume "x \<in> s"
then show ?thesis by simp
next
assume "x \<in> (\<Inter> i \<in> I. A i)"
then show ?thesis by simp
qed
qed
next
show "(\<Inter> i \<in> I. A i \<union> s) \<subseteq> s \<union> (\<Inter> i \<in> I. A i)"
proof
fix x
assume h2 : "x \<in> (\<Inter> i \<in> I. A i \<union> s)"
show "x \<in> s \<union> (\<Inter> i \<in> I. A i)"
proof (cases "x \<in> s")
case True
then show ?thesis by simp
next
case False
then show ?thesis using h2 by simp
qed
qed
qed
(* 5\<ordfeminine> demostración *)
lemma "s \<union> (\<Inter> i \<in> I. A i) = (\<Inter> i \<in> I. A i \<union> s)"
by auto
end