-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnion_de_pares_e_impares.thy
49 lines (39 loc) · 1.46 KB
/
Union_de_pares_e_impares.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
(* Union_de_pares_e_impares.thy
pares \<union> impares = naturales
José A. Alonso Jiménez
Sevilla, 5 de marzo de 2024
---------------------------------------------------------------------
*)
(* ---------------------------------------------------------------------
Los conjuntos de los números naturales, de los pares y de los impares
se definen por
def naturales : set \<nat> := {n | true}
def pares : set \<nat> := {n | even n}
def impares : set \<nat> := {n | \<not> even n}
Demostrar que
pares \<union> impares = naturales
------------------------------------------------------------------- *)
theory Union_de_pares_e_impares
imports Main
begin
definition naturales :: "nat set" where
"naturales = {n\<in>\<nat> . True}"
definition pares :: "nat set" where
"pares = {n\<in>\<nat> . even n}"
definition impares :: "nat set" where
"impares = {n\<in>\<nat> . \<not> even n}"
(* 1\<ordfeminine> demostración *)
lemma "pares \<union> impares = naturales"
proof -
have "\<forall> n \<in> \<nat> . even n \<or> \<not> even n \<longleftrightarrow> True"
by simp
then have "{n \<in> \<nat>. even n} \<union> {n \<in> \<nat>. \<not> even n} = {n \<in> \<nat>. True}"
by auto
then show "pares \<union> impares = naturales"
by (simp add: naturales_def pares_def impares_def)
qed
(* 2\<ordfeminine> demostración *)
lemma "pares \<union> impares = naturales"
unfolding naturales_def pares_def impares_def
by auto
end