(* Interseccion_con_la_imagen.thy -- f[s] \ t = f[s \ f⁻¹[t]]. -- José A. Alonso Jiménez -- Sevilla, 18-abril-2024 -- ------------------------------------------------------------------ *) (* --------------------------------------------------------------------- -- Demostrar que -- (f ` s) \ v = f ` (s \ f -` v) -- ------------------------------------------------------------------ *) theory Interseccion_con_la_imagen imports Main begin (* 1\ demostración *) lemma "(f ` s) \ v = f ` (s \ f -` v)" proof (rule equalityI) show "(f ` s) \ v \ f ` (s \ f -` v)" proof (rule subsetI) fix y assume "y \ (f ` s) \ v" then show "y \ f ` (s \ f -` v)" proof (rule IntE) assume "y \ v" assume "y \ f ` s" then show "y \ f ` (s \ f -` v)" proof (rule imageE) fix x assume "x \ s" assume "y = f x" then have "f x \ v" using \y \ v\ by (rule subst) then have "x \ f -` v" by (rule vimageI2) with \x \ s\ have "x \ s \ f -` v" by (rule IntI) then have "f x \ f ` (s \ f -` v)" by (rule imageI) with \y = f x\ show "y \ f ` (s \ f -` v)" by (rule ssubst) qed qed qed next show "f ` (s \ f -` v) \ (f ` s) \ v" proof (rule subsetI) fix y assume "y \ f ` (s \ f -` v)" then show "y \ (f ` s) \ v" proof (rule imageE) fix x assume "y = f x" assume hx : "x \ s \ f -` v" have "y \ f ` s" proof - have "x \ s" using hx by (rule IntD1) then have "f x \ f ` s" by (rule imageI) with \y = f x\ show "y \ f ` s" by (rule ssubst) qed moreover have "y \ v" proof - have "x \ f -` v" using hx by (rule IntD2) then have "f x \ v" by (rule vimageD) with \y = f x\ show "y \ v" by (rule ssubst) qed ultimately show "y \ (f ` s) \ v" by (rule IntI) qed qed qed (* 2\ demostración *) lemma "(f ` s) \ v = f ` (s \ f -` v)" proof show "(f ` s) \ v \ f ` (s \ f -` v)" proof fix y assume "y \ (f ` s) \ v" then show "y \ f ` (s \ f -` v)" proof assume "y \ v" assume "y \ f ` s" then show "y \ f ` (s \ f -` v)" proof fix x assume "x \ s" assume "y = f x" then have "f x \ v" using \y \ v\ by simp then have "x \ f -` v" by simp with \x \ s\ have "x \ s \ f -` v" by simp then have "f x \ f ` (s \ f -` v)" by simp with \y = f x\ show "y \ f ` (s \ f -` v)" by simp qed qed qed next show "f ` (s \ f -` v) \ (f ` s) \ v" proof fix y assume "y \ f ` (s \ f -` v)" then show "y \ (f ` s) \ v" proof fix x assume "y = f x" assume hx : "x \ s \ f -` v" have "y \ f ` s" proof - have "x \ s" using hx by simp then have "f x \ f ` s" by simp with \y = f x\ show "y \ f ` s" by simp qed moreover have "y \ v" proof - have "x \ f -` v" using hx by simp then have "f x \ v" by simp with \y = f x\ show "y \ v" by simp qed ultimately show "y \ (f ` s) \ v" by simp qed qed qed (* 3\ demostración *) lemma "(f ` s) \ v = f ` (s \ f -` v)" proof show "(f ` s) \ v \ f ` (s \ f -` v)" proof fix y assume "y \ (f ` s) \ v" then show "y \ f ` (s \ f -` v)" proof assume "y \ v" assume "y \ f ` s" then show "y \ f ` (s \ f -` v)" proof fix x assume "x \ s" assume "y = f x" then show "y \ f ` (s \ f -` v)" using \x \ s\ \y \ v\ by simp qed qed qed next show "f ` (s \ f -` v) \ (f ` s) \ v" proof fix y assume "y \ f ` (s \ f -` v)" then show "y \ (f ` s) \ v" proof fix x assume "y = f x" assume hx : "x \ s \ f -` v" then have "y \ f ` s" using \y = f x\ by simp moreover have "y \ v" using hx \y = f x\ by simp ultimately show "y \ (f ` s) \ v" by simp qed qed qed (* 4\ demostración *) lemma "(f ` s) \ v = f ` (s \ f -` v)" by auto end