-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImagen_de_la_union.thy
152 lines (144 loc) · 4.14 KB
/
Imagen_de_la_union.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
(* Imagen_de_la_union.thy
f[s \<union> t] = f[s] \<union> f[t]
José A. Alonso Jiménez <https://jaalonso.github.io>
Sevilla, 13-marzo-2024
------------------------------------------------------------------ *)
(* ---------------------------------------------------------------------
En Isabelle, la imagen de un conjunto s por una función f se representa
por
f ` s = {y | \<exists> x, x \<in> s \<and> f x = y}
Demostrar que
f ` (s \<union> t) = f ` s \<union> f ` t
------------------------------------------------------------------- *)
theory Imagen_de_la_union
imports Main
begin
(* 1\<ordfeminine> demostración *)
lemma "f ` (s \<union> t) = f ` s \<union> f ` t"
proof (rule equalityI)
show "f ` (s \<union> t) \<subseteq> f ` s \<union> f ` t"
proof (rule subsetI)
fix y
assume "y \<in> f ` (s \<union> t)"
then show "y \<in> f ` s \<union> f ` t"
proof (rule imageE)
fix x
assume "y = f x"
assume "x \<in> s \<union> t"
then show "y \<in> f ` s \<union> f ` t"
proof (rule UnE)
assume "x \<in> s"
with \<open>y = f x\<close> have "y \<in> f ` s"
by (simp only: image_eqI)
then show "y \<in> f ` s \<union> f ` t"
by (rule UnI1)
next
assume "x \<in> t"
with \<open>y = f x\<close> have "y \<in> f ` t"
by (simp only: image_eqI)
then show "y \<in> f ` s \<union> f ` t"
by (rule UnI2)
qed
qed
qed
next
show "f ` s \<union> f ` t \<subseteq> f ` (s \<union> t)"
proof (rule subsetI)
fix y
assume "y \<in> f ` s \<union> f ` t"
then show "y \<in> f ` (s \<union> t)"
proof (rule UnE)
assume "y \<in> f ` s"
then show "y \<in> f ` (s \<union> t)"
proof (rule imageE)
fix x
assume "y = f x"
assume "x \<in> s"
then have "x \<in> s \<union> t"
by (rule UnI1)
with \<open>y = f x\<close> show "y \<in> f ` (s \<union> t)"
by (simp only: image_eqI)
qed
next
assume "y \<in> f ` t"
then show "y \<in> f ` (s \<union> t)"
proof (rule imageE)
fix x
assume "y = f x"
assume "x \<in> t"
then have "x \<in> s \<union> t"
by (rule UnI2)
with \<open>y = f x\<close> show "y \<in> f ` (s \<union> t)"
by (simp only: image_eqI)
qed
qed
qed
qed
(* 2\<ordfeminine> demostración *)
lemma "f ` (s \<union> t) = f ` s \<union> f ` t"
proof
show "f ` (s \<union> t) \<subseteq> f ` s \<union> f ` t"
proof
fix y
assume "y \<in> f ` (s \<union> t)"
then show "y \<in> f ` s \<union> f ` t"
proof
fix x
assume "y = f x"
assume "x \<in> s \<union> t"
then show "y \<in> f ` s \<union> f ` t"
proof
assume "x \<in> s"
with \<open>y = f x\<close> have "y \<in> f ` s"
by simp
then show "y \<in> f ` s \<union> f ` t"
by simp
next
assume "x \<in> t"
with \<open>y = f x\<close> have "y \<in> f ` t"
by simp
then show "y \<in> f ` s \<union> f ` t"
by simp
qed
qed
qed
next
show "f ` s \<union> f ` t \<subseteq> f ` (s \<union> t)"
proof
fix y
assume "y \<in> f ` s \<union> f ` t"
then show "y \<in> f ` (s \<union> t)"
proof
assume "y \<in> f ` s"
then show "y \<in> f ` (s \<union> t)"
proof
fix x
assume "y = f x"
assume "x \<in> s"
then have "x \<in> s \<union> t"
by simp
with \<open>y = f x\<close> show "y \<in> f ` (s \<union> t)"
by simp
qed
next
assume "y \<in> f ` t"
then show "y \<in> f ` (s \<union> t)"
proof
fix x
assume "y = f x"
assume "x \<in> t"
then have "x \<in> s \<union> t"
by simp
with \<open>y = f x\<close> show "y \<in> f ` (s \<union> t)"
by simp
qed
qed
qed
qed
(* 3\<ordfeminine> demostración *)
lemma "f ` (s \<union> t) = f ` s \<union> f ` t"
by (simp only: image_Un)
(* 4\<ordfeminine> demostración *)
lemma "f ` (s \<union> t) = f ` s \<union> f ` t"
by auto
end