(* Conmutatividad_de_la_interseccion.thy -- Conmutatividad de la intersección. -- José A. Alonso -- Sevilla, 24-mayo-2021 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- Demostrar que -- s \ t = t \ s -- ------------------------------------------------------------------ *) theory Conmutatividad_de_la_interseccion imports Main begin (* 1\ demostración *) lemma "s \ t = t \ s" proof (rule set_eqI) fix x show "x \ s \ t \ x \ t \ s" proof (rule iffI) assume h : "x \ s \ t" then have xs : "x \ s" by (simp only: IntD1) have xt : "x \ t" using h by (simp only: IntD2) then show "x \ t \ s" using xs by (rule IntI) next assume h : "x \ t \ s" then have xt : "x \ t" by (simp only: IntD1) have xs : "x \ s" using h by (simp only: IntD2) then show "x \ s \ t" using xt by (rule IntI) qed qed (* 2\ demostración *) lemma "s \ t = t \ s" proof (rule set_eqI) fix x show "x \ s \ t \ x \ t \ s" proof assume h : "x \ s \ t" then have xs : "x \ s" by simp have xt : "x \ t" using h by simp then show "x \ t \ s" using xs by simp next assume h : "x \ t \ s" then have xt : "x \ t" by simp have xs : "x \ s" using h by simp then show "x \ s \ t" using xt by simp qed qed (* 3\ demostración *) lemma "s \ t = t \ s" proof (rule equalityI) show "s \ t \ t \ s" proof (rule subsetI) fix x assume h : "x \ s \ t" then have xs : "x \ s" by (simp only: IntD1) have xt : "x \ t" using h by (simp only: IntD2) then show "x \ t \ s" using xs by (rule IntI) qed next show "t \ s \ s \ t" proof (rule subsetI) fix x assume h : "x \ t \ s" then have xt : "x \ t" by (simp only: IntD1) have xs : "x \ s" using h by (simp only: IntD2) then show "x \ s \ t" using xt by (rule IntI) qed qed (* 4\ demostración *) lemma "s \ t = t \ s" proof show "s \ t \ t \ s" proof fix x assume h : "x \ s \ t" then have xs : "x \ s" by simp have xt : "x \ t" using h by simp then show "x \ t \ s" using xs by simp qed next show "t \ s \ s \ t" proof fix x assume h : "x \ t \ s" then have xt : "x \ t" by simp have xs : "x \ s" using h by simp then show "x \ s \ t" using xt by simp qed qed (* 5\ demostración *) lemma "s \ t = t \ s" proof show "s \ t \ t \ s" proof fix x assume "x \ s \ t" then show "x \ t \ s" by simp qed next show "t \ s \ s \ t" proof fix x assume "x \ t \ s" then show "x \ s \ t" by simp qed qed (* 6\ demostración *) lemma "s \ t = t \ s" by (fact Int_commute) (* 7\ demostración *) lemma "s \ t = t \ s" by (fact inf_commute) (* 8\ demostración *) lemma "s \ t = t \ s" by auto end