(* Las_particiones_definen_relaciones_reflexivas.thy -- Las particiones definen relaciones reflexivas -- José A. Alonso Jiménez -- Sevilla, 4-julio-2024 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- Cada familia de conjuntos P define una relación de forma que dos -- elementos están relacionados si algún conjunto de P contiene a ambos -- elementos. Se puede definir en Isabelle por -- definition relacion :: "('a set) set \ 'a \ 'a \ bool" where -- "relacion P x y \ (\A\P. x \ A \ y \ A)" -- -- Una familia de subconjuntos de X es una partición de X si cada elemento -- de X pertenece a un único conjunto de P y todos los elementos de P -- son no vacíos. Se puede definir en Isabelle por -- definition particion :: "('a set) set \ bool" where -- "particion P \ (\x. (\B\P. x \ B \ (\C\P. x \ C \ B = C))) \ {} \ P" -- -- Demostrar que si P es una partición de X, entonces la relación -- definida por P es reflexiva. -- ------------------------------------------------------------------ *) theory Las_particiones_definen_relaciones_reflexivas imports Main begin definition relacion :: "('a set) set \ 'a \ 'a \ bool" where "relacion P x y \ (\A\P. x \ A \ y \ A)" definition particion :: "('a set) set \ bool" where "particion P \ (\x. (\B\P. x \ B \ (\C\P. x \ C \ B = C))) \ {} \ P" (* 1\ demostración *) lemma assumes "particion P" shows "reflp (relacion P)" proof (rule reflpI) fix x have "(\x. (\B\P. x \ B \ (\C\P. x \ C \ B = C))) \ {} \ P" using assms by (unfold particion_def) then have "\x. (\B\P. x \ B \ (\C\P. x \ C \ B = C))" by (rule conjunct1) then have "\B\P. x \ B \ (\C\P. x \ C \ B = C)" by (rule allE) then obtain B where "B \ P \ (x \ B \ (\C\P. x \ C \ B = C))" by (rule someI2_bex) then obtain B where "(B \ P \ x \ B) \ (\C\P. x \ C \ B = C)" by (simp only: conj_assoc) then have "B \ P \ x \ B" by (rule conjunct1) then have "x \ B" by (rule conjunct2) then have "x \ B \ x \ B" using \x \ B\ by (rule conjI) moreover have "B \ P" using \B \ P \ x \ B\ by (rule conjunct1) ultimately have "\B\P. x \ B \ x \ B" by (rule bexI) then show "relacion P x x" by (unfold relacion_def) qed (* 2\ demostración *) lemma assumes "particion P" shows "reflp (relacion P)" proof (rule reflpI) fix x obtain A where "A \ P \ x \ A" using assms particion_def by metis then show "relacion P x x" using relacion_def by metis qed (* 3\ demostración *) lemma assumes "particion P" shows "reflp (relacion P)" using assms particion_def relacion_def by (metis reflp_def) end