<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://www.glc.us.es/~jalonso/LMF2020/index.php?action=history&amp;feed=atom&amp;title=Examen_1C_sol</id>
	<title>Examen 1C sol - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://www.glc.us.es/~jalonso/LMF2020/index.php?action=history&amp;feed=atom&amp;title=Examen_1C_sol"/>
	<link rel="alternate" type="text/html" href="https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_1C_sol&amp;action=history"/>
	<updated>2026-07-18T21:51:00Z</updated>
	<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_1C_sol&amp;diff=1274&amp;oldid=prev</id>
		<title>Mjoseh: Protegió «Examen 1C sol» ([Editar=Solo administradores] (indefinido) [Trasladar=Solo administradores] (indefinido))</title>
		<link rel="alternate" type="text/html" href="https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_1C_sol&amp;diff=1274&amp;oldid=prev"/>
		<updated>2020-07-06T12:31:30Z</updated>

		<summary type="html">&lt;p&gt;Protegió «&lt;a href=&quot;/~jalonso/LMF2020/index.php/Examen_1C_sol&quot; title=&quot;Examen 1C sol&quot;&gt;Examen 1C sol&lt;/a&gt;» ([Editar=Solo administradores] (indefinido) [Trasladar=Solo administradores] (indefinido))&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;es&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Revisión anterior&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revisión del 12:31 6 jul 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;es&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Sin diferencias)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Mjoseh</name></author>
		
	</entry>
	<entry>
		<id>https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_1C_sol&amp;diff=1273&amp;oldid=prev</id>
		<title>Mjoseh: Página creada con «&lt;source lang = &quot;isabelle&quot;&gt; theory examen_2_jul_sol imports Main  begin  lemma notnotI: &quot;P ⟹ ¬¬ P&quot;   by auto  lemma mt: &quot;⟦F ⟶ G; ¬G⟧ ⟹ ¬F&quot; by auto  text ‹---…»</title>
		<link rel="alternate" type="text/html" href="https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_1C_sol&amp;diff=1273&amp;oldid=prev"/>
		<updated>2020-07-06T12:31:10Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «&amp;lt;source lang = &amp;quot;isabelle&amp;quot;&amp;gt; theory examen_2_jul_sol imports Main  begin  lemma notnotI: &amp;quot;P ⟹ ¬¬ P&amp;quot;   by auto  lemma mt: &amp;quot;⟦F ⟶ G; ¬G⟧ ⟹ ¬F&amp;quot; by auto  text ‹---…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang = &amp;quot;isabelle&amp;quot;&amp;gt;&lt;br /&gt;
theory examen_2_jul_sol&lt;br /&gt;
imports Main &lt;br /&gt;
begin&lt;br /&gt;
&lt;br /&gt;
lemma notnotI: &amp;quot;P ⟹ ¬¬ P&amp;quot;&lt;br /&gt;
  by auto&lt;br /&gt;
&lt;br /&gt;
lemma mt: &amp;quot;⟦F ⟶ G; ¬G⟧ ⟹ ¬F&amp;quot;&lt;br /&gt;
by auto&lt;br /&gt;
&lt;br /&gt;
text ‹------------------------------------------------------------------ &lt;br /&gt;
  Ejercicio 1. Demostrar detalladamente con Isabelle, sin usar métodos&lt;br /&gt;
  automáticos (como simp, auto, ...) sino sólo las reglas básicas, &lt;br /&gt;
  que el siguiente argumento es correcto &lt;br /&gt;
     Si todas las medicinas están contaminadas, entonces todos los&lt;br /&gt;
     técnicos negligentes son unos bribones. Si hay medicinas&lt;br /&gt;
     contaminadas, entonces todas las medicinas están contaminadas y son&lt;br /&gt;
     peligrosas. Todos los germicidas son medicinas. Sólo los&lt;br /&gt;
     negligentes son distraídos. Por tanto, si cualquier técnico es&lt;br /&gt;
     distraído y si algunos germicidas están contaminados, los técnicos&lt;br /&gt;
     son bribones. &lt;br /&gt;
  Usar la siguiente simbología: &lt;br /&gt;
     M(x): x es medicina,  C(x): x está contaminada, &lt;br /&gt;
     T(x): x es técnico,   N(x): x es un negligente, &lt;br /&gt;
     B(x): x es un bribón, G(x): x es germicida, &lt;br /&gt;
     D(x): x es distraído, P(x): x es peligrosa.&lt;br /&gt;
  ---------------------------------------------------------------------›&lt;br /&gt;
&lt;br /&gt;
― ‹Formalización y demostración›&lt;br /&gt;
&lt;br /&gt;
― ‹Formalización:›&lt;br /&gt;
lemma &lt;br /&gt;
  assumes &amp;quot;(∀x. M(x) ⟶ C(x)) ⟶ (∀y. (T(y) ∧ N(y)) ⟶ B(y))&amp;quot;&lt;br /&gt;
          &amp;quot;(∃x. M(x) ∧ C(x)) ⟶ (∀x. M(x) ⟶ C(x) ∧ P(x))&amp;quot;&lt;br /&gt;
          &amp;quot;∀x. G(x) ⟶ M(x)&amp;quot;&lt;br /&gt;
          &amp;quot;∀y. ¬N(y) ⟶ ¬D(y)&amp;quot;&lt;br /&gt;
  shows   &amp;quot;(∀y. T y ⟶ D y) ∧ (∃x. G x ∧ C x) ⟶ (∀z. T z ⟶ B z)&amp;quot;&lt;br /&gt;
  oops&lt;br /&gt;
&lt;br /&gt;
― ‹Auxiliar›&lt;br /&gt;
lemma previo:&lt;br /&gt;
  assumes &amp;quot;∀x. M(x) ⟶ C(x) ∧ P(x)&amp;quot;&lt;br /&gt;
  shows   &amp;quot;∀x. M(x) ⟶ C(x)&amp;quot;&lt;br /&gt;
proof (rule allI)&lt;br /&gt;
  fix a&lt;br /&gt;
  show &amp;quot;M(a) ⟶ C(a)&amp;quot;&lt;br /&gt;
  proof (rule impI)&lt;br /&gt;
    assume &amp;quot;M(a)&amp;quot;&lt;br /&gt;
      have &amp;quot;M(a) ⟶ C(a) ∧ P(a)&amp;quot; using assms by (rule allE)&lt;br /&gt;
      then have &amp;quot;C(a) ∧ P(a)&amp;quot; using ‹M(a)› by (rule mp)&lt;br /&gt;
      then show &amp;quot;C(a)&amp;quot; by (rule conjunct1)&lt;br /&gt;
    qed&lt;br /&gt;
  qed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración declarativa detallada:›&lt;br /&gt;
lemma &lt;br /&gt;
  assumes &amp;quot;(∀x. M(x) ⟶ C(x)) ⟶ (∀y. (T(y) ∧ N(y)) ⟶ B(y))&amp;quot;&lt;br /&gt;
          &amp;quot;(∃x. M(x) ∧ C(x)) ⟶ (∀x. M(x) ⟶ C(x) ∧ P(x))&amp;quot;&lt;br /&gt;
          &amp;quot;∀x. G(x) ⟶ M(x)&amp;quot;&lt;br /&gt;
          &amp;quot;∀y. ¬N(y) ⟶ ¬D(y)&amp;quot;&lt;br /&gt;
  shows   &amp;quot;(∀y. T y ⟶ D y) ∧ (∃x. G x ∧ C x) ⟶ (∀z. T z ⟶ B z)&amp;quot; &lt;br /&gt;
proof (rule impI)&lt;br /&gt;
  assume 1: &amp;quot;(∀y. T(y) ⟶ D(y)) ∧ (∃x. G(x) ∧ C(x))&amp;quot;&lt;br /&gt;
  show &amp;quot;∀z. T(z) ⟶ B(z)&amp;quot;&lt;br /&gt;
  proof (rule allI)&lt;br /&gt;
    fix a&lt;br /&gt;
    show &amp;quot;T(a) ⟶ B(a)&amp;quot;&lt;br /&gt;
    proof (rule impI)&lt;br /&gt;
      assume &amp;quot;T(a)&amp;quot;&lt;br /&gt;
      show   &amp;quot;B(a)&amp;quot;&lt;br /&gt;
      proof -&lt;br /&gt;
        have &amp;quot;∀y. T(y) ⟶ D(y)&amp;quot; using 1 by (rule conjunct1)&lt;br /&gt;
        then have &amp;quot;T(a) ⟶ D(a)&amp;quot; by (rule allE)&lt;br /&gt;
        then have &amp;quot;D(a)&amp;quot; using  `T(a)` by (rule mp)&lt;br /&gt;
        then have &amp;quot;¬¬D(a)&amp;quot; by (rule notnotI) &lt;br /&gt;
        have &amp;quot;¬N(a)⟶¬D(a)&amp;quot;  using assms(4) by (rule allE)&lt;br /&gt;
        then have &amp;quot;¬¬N(a)&amp;quot; using `¬¬D(a)` by (rule mt)&lt;br /&gt;
        then have &amp;quot;N(a)&amp;quot;  by (rule notnotD)&lt;br /&gt;
        have &amp;quot;∃x. G(x) ∧ C(x)&amp;quot;  using 1 by (rule conjunct2)&lt;br /&gt;
        then obtain b where &amp;quot;G(b) ∧ C(b)&amp;quot; by (rule exE)&lt;br /&gt;
        then have &amp;quot;G(b)&amp;quot; by (rule conjunct1)&lt;br /&gt;
        have &amp;quot;C(b)&amp;quot; using `G(b) ∧ C(b)` by (rule conjunct2)&lt;br /&gt;
        have &amp;quot;G(b) ⟶ M(b)&amp;quot; using assms(3) by (rule allE)&lt;br /&gt;
        then have &amp;quot;M(b)&amp;quot; using  `G(b)` by (rule mp)&lt;br /&gt;
        then have &amp;quot;M(b) ∧ C(b)&amp;quot; using `C(b)` by (rule conjI)&lt;br /&gt;
        then have &amp;quot;∃x. M(x) ∧ C(x)&amp;quot;  by (rule exI)&lt;br /&gt;
        with assms(2) have &amp;quot;∀x. M(x) ⟶ C(x) ∧ P(x)&amp;quot; by (rule mp)&lt;br /&gt;
        then have &amp;quot;∀x. M(x) ⟶ C(x)&amp;quot; by (rule previo)&lt;br /&gt;
        with assms(1) have &amp;quot;∀y. (T(y) ∧ N(y)) ⟶ B(y)&amp;quot; by (rule mp)&lt;br /&gt;
        then have &amp;quot;(T(a) ∧ N(a))⟶B(a)&amp;quot; by (rule allE)&lt;br /&gt;
        have &amp;quot;T(a) ∧ N(a)&amp;quot; using `T(a)` `N(a)` by (rule conjI)&lt;br /&gt;
        with `(T(a) ∧ N(a)) ⟶ B(a)` show &amp;quot;B(a)&amp;quot;  by (rule mp)&lt;br /&gt;
      qed&lt;br /&gt;
    qed&lt;br /&gt;
  qed&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
text ‹------------------------------------------------------------------&lt;br /&gt;
  Ejercicio 2. Se consideran las definiciones de las siguientes&lt;br /&gt;
  funciones (que se dan a continuación)&lt;br /&gt;
     estaEn   :: &amp;#039;a ⇒ &amp;#039;a list ⇒ bool&lt;br /&gt;
     sublista :: &amp;quot;&amp;#039;a list ⇒ &amp;#039;a list ⇒ bool&lt;br /&gt;
     elimina  :: nat ⇒ &amp;#039;a list ⇒ &amp;#039;a list&lt;br /&gt;
  tales que &lt;br /&gt;
  + (estaEn x xs) se verifica si el elemento x está en la lista xs. Por&lt;br /&gt;
    ejemplo,  &lt;br /&gt;
       estaEn (2::nat) [3,2,4] = True&lt;br /&gt;
       estaEn (1::nat) [3,2,4] = False&lt;br /&gt;
  + (sublista xs ys) se verifica si todos los elementos de la lista xs&lt;br /&gt;
    están en la lista ys. Por ejemplo, &lt;br /&gt;
       sublista [(1::nat),2,3] [3,2,1,2] = True&lt;br /&gt;
       sublista [(1::nat),2,3] [2,1,2]   = False&lt;br /&gt;
  + (elimina n xs) es la lista obtenida eliminando los n primeros&lt;br /&gt;
    elementos de xs. Por ejemplo, &lt;br /&gt;
       elimina 2 [a,c,d,b,e] = [d,b,e]&lt;br /&gt;
&lt;br /&gt;
  Demostrar detalladamente que&lt;br /&gt;
     sublista (elimina n xs) xs&lt;br /&gt;
  ---------------------------------------------------------------------›&lt;br /&gt;
&lt;br /&gt;
fun estaEn :: &amp;quot;&amp;#039;a ⇒ &amp;#039;a list ⇒ bool&amp;quot; where&lt;br /&gt;
  &amp;quot;estaEn x []     = False&amp;quot;&lt;br /&gt;
| &amp;quot;estaEn x (a#xs) = (a=x ∨ estaEn x xs)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fun sublista :: &amp;quot;&amp;#039;a list ⇒ &amp;#039;a list ⇒ bool&amp;quot; where&lt;br /&gt;
  &amp;quot;sublista [] ys     = True&amp;quot;&lt;br /&gt;
| &amp;quot;sublista (x#xs) ys = (estaEn x ys ∧ sublista xs ys )&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
fun elimina :: &amp;quot;nat ⇒ &amp;#039;a list ⇒ &amp;#039;a list&amp;quot; where&lt;br /&gt;
  &amp;quot;elimina n []           = []&amp;quot;&lt;br /&gt;
| &amp;quot;elimina 0 xs           = xs&amp;quot;&lt;br /&gt;
| &amp;quot;elimina (Suc n) (x#xs) = elimina n xs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
― ‹Auxiliares:›&lt;br /&gt;
&lt;br /&gt;
lemma sublistaMono: &amp;quot;sublista xs ys ⟹ sublista xs (y#ys)&amp;quot;&lt;br /&gt;
  apply (induct xs)&lt;br /&gt;
   apply (simp only: sublista.simps(1))&lt;br /&gt;
  apply (simp only: sublista.simps(2))&lt;br /&gt;
  apply (rule conjI)&lt;br /&gt;
   apply (erule conjE)&lt;br /&gt;
   apply (simp only: estaEn.simps(2))&lt;br /&gt;
   apply (rule disjI2)&lt;br /&gt;
   apply (simp only: implies_True_equals)+&lt;br /&gt;
  done&lt;br /&gt;
   &lt;br /&gt;
lemma estaEn1: &amp;quot;estaEn x (x#xs)&amp;quot;&lt;br /&gt;
  apply (simp only: estaEn.simps(2))&lt;br /&gt;
  apply (rule disjI1)&lt;br /&gt;
  apply (rule refl)&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
lemma sublistaReflexiva: &amp;quot;sublista xs xs&amp;quot;&lt;br /&gt;
  apply (induct xs)&lt;br /&gt;
   apply (simp only: sublista.simps(1))&lt;br /&gt;
  apply (simp only: sublista.simps(2))&lt;br /&gt;
  apply (rule conjI)&lt;br /&gt;
   apply (rule estaEn1)&lt;br /&gt;
  apply (rule sublistaMono, assumption)&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración declarativa detallada:›  &lt;br /&gt;
lemma eliminaSublista_dec: &amp;quot;sublista (elimina n xs) xs&amp;quot;&lt;br /&gt;
proof (induct rule: elimina.induct)&lt;br /&gt;
  fix n&lt;br /&gt;
  show &amp;quot;sublista (elimina n []) []&amp;quot;&lt;br /&gt;
    by (simp only: elimina.simps(1) sublista.simps(1))&lt;br /&gt;
next&lt;br /&gt;
  fix x :: &amp;quot;&amp;#039;a&amp;quot; and  xs :: &amp;quot;&amp;#039;a list&amp;quot;&lt;br /&gt;
  show &amp;quot;sublista (elimina 0 (x # xs)) (x # xs)&amp;quot;&lt;br /&gt;
  by (simp only: elimina.simps(2) sublistaReflexiva)&lt;br /&gt;
next&lt;br /&gt;
   fix n and x :: &amp;quot;&amp;#039;a&amp;quot; and xs :: &amp;quot;&amp;#039;a list&amp;quot;&lt;br /&gt;
   show &amp;quot;sublista (elimina n xs) xs ⟹ &lt;br /&gt;
         sublista (elimina (Suc n) (x # xs)) (x # xs)&amp;quot;&lt;br /&gt;
   by  (simp only: elimina.simps(3) sublistaMono)&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
text ‹------------------------------------------------------------------&lt;br /&gt;
  Ejercicio 3. Sea G un grupo. Demostrar que las siguientes condiciones&lt;br /&gt;
  son equivalentes:&lt;br /&gt;
    (+) G es commutativo, es decir, ∀x y. (x ⋅ y = y ⋅ x) &lt;br /&gt;
    (+) ∀x y. (((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭)&lt;br /&gt;
&lt;br /&gt;
  Nota: No usar ninguno de los métodos automáticos: auto, blast, force,&lt;br /&gt;
  fast, arith o metis &lt;br /&gt;
  ------------------------------------------------------------------ ›&lt;br /&gt;
&lt;br /&gt;
locale grupo =&lt;br /&gt;
  fixes prod :: &amp;quot;[&amp;#039;a, &amp;#039;a] ⇒ &amp;#039;a&amp;quot; (infixl &amp;quot;⋅&amp;quot; 70)&lt;br /&gt;
    and neutro (&amp;quot;𝟭&amp;quot;) &lt;br /&gt;
    and inverso (&amp;quot;_^&amp;quot; [100] 100)&lt;br /&gt;
  assumes asociativa: &amp;quot;(x ⋅ y) ⋅ z = x ⋅ (y ⋅ z)&amp;quot;&lt;br /&gt;
      and neutro_i:   &amp;quot;𝟭 ⋅ x = x&amp;quot;&lt;br /&gt;
      and neutro_d:   &amp;quot;x ⋅ 𝟭 = x&amp;quot;&lt;br /&gt;
      and inverso_i:  &amp;quot;x^ ⋅ x = 𝟭&amp;quot;&lt;br /&gt;
&lt;br /&gt;
(* Notas sobre notación:&lt;br /&gt;
   * El producto es ⋅ y se escribe con \ cdot (sin espacio entre ellos). &lt;br /&gt;
   * El neutro es 𝟭 y se escribe con \ y one (sin espacio entre ellos).&lt;br /&gt;
   * El inverso de x es x^ y se escribe pulsando 2 veces en ^. *)&lt;br /&gt;
&lt;br /&gt;
context grupo&lt;br /&gt;
begin&lt;br /&gt;
&lt;br /&gt;
― ‹Auxiliar para una implicación:›&lt;br /&gt;
&lt;br /&gt;
lemma inverso_d: &lt;br /&gt;
  &amp;quot;x ⋅ x^ = 𝟭&amp;quot;&lt;br /&gt;
proof -&lt;br /&gt;
  have &amp;quot;x ⋅ x^ = 𝟭 ⋅ (x ⋅ x^)&amp;quot; &lt;br /&gt;
    by (simp only: neutro_i)&lt;br /&gt;
  also have &amp;quot;… = (𝟭 ⋅ x) ⋅ x^&amp;quot; &lt;br /&gt;
    by (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… = (((x^)^ ⋅ x^) ⋅ x) ⋅ x^&amp;quot; &lt;br /&gt;
    by (simp only: inverso_i)&lt;br /&gt;
  also have &amp;quot;… = ((x^)^ ⋅ (x^ ⋅ x)) ⋅ x^&amp;quot; &lt;br /&gt;
    by (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… = ((x^)^ ⋅ 𝟭) ⋅ x^&amp;quot; &lt;br /&gt;
    by (simp only: inverso_i)&lt;br /&gt;
  also have &amp;quot;… = (x^)^ ⋅ (𝟭 ⋅ x^)&amp;quot; &lt;br /&gt;
    by (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… = (x^)^ ⋅ x^&amp;quot; &lt;br /&gt;
    by (simp only: neutro_i)&lt;br /&gt;
  also have &amp;quot;… = 𝟭&amp;quot; &lt;br /&gt;
    by (simp only: inverso_i)&lt;br /&gt;
  finally show ?thesis &lt;br /&gt;
    by this&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
lemma &lt;br /&gt;
  assumes &amp;quot;((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭&amp;quot;&lt;br /&gt;
  shows   &amp;quot;x ⋅ y = y ⋅ x&amp;quot;&lt;br /&gt;
proof -&lt;br /&gt;
  have &amp;quot;x ⋅ y = (x ⋅ y) ⋅ 𝟭&amp;quot; &lt;br /&gt;
    by (rule neutro_d [THEN sym])&lt;br /&gt;
  also have &amp;quot;… =  (x ⋅ y) ⋅ (((y^ ⋅ x^) ⋅ y) ⋅ x)&amp;quot; &lt;br /&gt;
    using assms by (rule arg_cong [THEN sym])&lt;br /&gt;
  also have &amp;quot;… =  (x ⋅ ((y ⋅ y^) ⋅ x^) ⋅ y) ⋅ x&amp;quot; &lt;br /&gt;
    by (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… =  ((x ⋅ (𝟭 ⋅ x^)) ⋅ y) ⋅ x&amp;quot; &lt;br /&gt;
    by (simp only: inverso_d)&lt;br /&gt;
  also have &amp;quot;… =  (x ⋅ ((𝟭 ⋅ x^) ⋅ y)) ⋅ x &amp;quot; &lt;br /&gt;
    by  (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… =  (x ⋅ (x^ ⋅ y)) ⋅ x&amp;quot; &lt;br /&gt;
    by  (simp only: neutro_i)&lt;br /&gt;
  also have &amp;quot;… =  ((x ⋅ x^) ⋅ y) ⋅ x&amp;quot; &lt;br /&gt;
    by  (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… = (𝟭 ⋅ y) ⋅ x&amp;quot; &lt;br /&gt;
    by  (simp only: inverso_d)&lt;br /&gt;
  also have &amp;quot;… = 𝟭 ⋅ (y ⋅ x)&amp;quot; &lt;br /&gt;
    by  (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;… = y ⋅ x&amp;quot; &lt;br /&gt;
    by (simp only: neutro_i)&lt;br /&gt;
  finally show  &amp;quot;x ⋅ y = y ⋅ x&amp;quot; &lt;br /&gt;
    by this&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
― ‹Recíproco:›&lt;br /&gt;
lemma &lt;br /&gt;
  assumes &amp;quot;x ⋅ y = y ⋅ x&amp;quot;&lt;br /&gt;
  shows   &amp;quot;((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭&amp;quot;&lt;br /&gt;
proof -&lt;br /&gt;
  have &amp;quot;y ⋅ x = x ⋅ y&amp;quot; using assms by (rule sym)&lt;br /&gt;
  then have &amp;quot;x^ ⋅ (y ⋅ x) = x^ ⋅ (x ⋅ y)&amp;quot; by (rule arg_cong)&lt;br /&gt;
  then have &amp;quot;y^ ⋅ (x^ ⋅ (y ⋅ x)) =y^ ⋅ (x^ ⋅ (x ⋅ y))&amp;quot; by (rule arg_cong)&lt;br /&gt;
  then have &amp;quot;((y^ ⋅ x^) ⋅ y) ⋅ x =y^ ⋅ ((x^ ⋅ x) ⋅ y)&amp;quot; &lt;br /&gt;
    by (simp only: asociativa)&lt;br /&gt;
  also have &amp;quot;... = y^ ⋅ (𝟭 ⋅ y)&amp;quot; by (simp only: inverso_i)&lt;br /&gt;
  also have &amp;quot;... = y^ ⋅ y &amp;quot; by (simp only: neutro_i)&lt;br /&gt;
  also have &amp;quot;... = 𝟭&amp;quot; by (simp only: inverso_i)&lt;br /&gt;
  finally show &amp;quot;((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭&amp;quot; by this&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
text ‹------------------------------------------------------------------&lt;br /&gt;
  Ejercicio 4. Se define la clausura reflexiva, simétrica y transitiva &lt;br /&gt;
  de una relación binaria r como sigue:&lt;br /&gt;
     inductive rst :: &amp;quot;(&amp;#039;a ⇒ &amp;#039;a ⇒ bool) ⇒ &amp;#039;a ⇒ &amp;#039;a ⇒ bool&amp;quot;  &lt;br /&gt;
      for r where&lt;br /&gt;
       refl1: &amp;quot;rst r x x&amp;quot;&lt;br /&gt;
     | trans1: &amp;quot;r x y ⟹ rst r y z ⟹ rst r x z&amp;quot;&lt;br /&gt;
     | trans2: &amp;quot;r y x ⟹ rst r y z ⟹ rst r x z&amp;quot; &lt;br /&gt;
                     &lt;br /&gt;
  Demostrar detalladamente que la relación (rst es r) simétrica. &lt;br /&gt;
  ---------------------------------------------------------------------›&lt;br /&gt;
&lt;br /&gt;
inductive rst :: &amp;quot;(&amp;#039;a ⇒ &amp;#039;a ⇒ bool) ⇒ &amp;#039;a ⇒ &amp;#039;a ⇒ bool&amp;quot;  &lt;br /&gt;
 for r where&lt;br /&gt;
  refl1: &amp;quot;rst r x x&amp;quot;&lt;br /&gt;
| trans1: &amp;quot;r x y ⟹ rst r y z ⟹ rst r x z&amp;quot;&lt;br /&gt;
| trans2: &amp;quot;r y x ⟹ rst r y z ⟹ rst r x z&amp;quot; &lt;br /&gt;
&lt;br /&gt;
― ‹Lemas auxiliares:›&lt;br /&gt;
&lt;br /&gt;
lemma r_subset_rst: &amp;quot;r x y ⟹ rst r x y&amp;quot;&lt;br /&gt;
  by (simp only: refl1 trans1)&lt;br /&gt;
&lt;br /&gt;
lemma r_subset_rst_b: &amp;quot;r x y ⟹ rst r y x&amp;quot;&lt;br /&gt;
  by (simp only: refl1 trans2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lemma rst_sc1_declarativo: &amp;quot;rst r x y  ⟹ r y z ⟹ rst r x z&amp;quot;&lt;br /&gt;
proof  (induct rule:rst.induct)&lt;br /&gt;
  case (refl1 x)&lt;br /&gt;
  then show ?case by (rule r_subset_rst) &lt;br /&gt;
next&lt;br /&gt;
  case (trans1 x y z)&lt;br /&gt;
  then show ?case by (simp only: rst.trans1)&lt;br /&gt;
next&lt;br /&gt;
  case (trans2 y x z)&lt;br /&gt;
  then show ?case  by (simp only: rst.trans2)&lt;br /&gt;
qed&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
lemma rst_sc2_declarativo: &amp;quot;rst r z y ⟹ r x y ⟹ rst r z x&amp;quot;&lt;br /&gt;
proof  (induct rule:rst.induct)&lt;br /&gt;
  case (refl1 x)&lt;br /&gt;
  then show ?case by (rule r_subset_rst_b) &lt;br /&gt;
next&lt;br /&gt;
  case (trans1 x y z)&lt;br /&gt;
  then show ?case by (simp only: rst.trans1)&lt;br /&gt;
next&lt;br /&gt;
  case (trans2 y x z)&lt;br /&gt;
  then show ?case by (simp only: rst.trans2)&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración declarativa detallada:›&lt;br /&gt;
lemma rstSimetrica_declarativa: &amp;quot;rst r x y ⟹ rst r y x&amp;quot;&lt;br /&gt;
proof (induct rule: rst.induct)&lt;br /&gt;
  fix x &lt;br /&gt;
  show &amp;quot;rst r x x&amp;quot; by (rule refl1)&lt;br /&gt;
next&lt;br /&gt;
  fix x y z&lt;br /&gt;
  assume &amp;quot;r x y&amp;quot; and &amp;quot;rst r y z&amp;quot; and &amp;quot;rst r z y&amp;quot;&lt;br /&gt;
  then show &amp;quot;rst r z x&amp;quot; by (simp only: rst_sc2_declarativo)&lt;br /&gt;
next &lt;br /&gt;
  fix x y z&lt;br /&gt;
  assume &amp;quot;r y x&amp;quot; and &amp;quot;rst r y z&amp;quot; and &amp;quot;rst r z y&amp;quot;&lt;br /&gt;
  then show &amp;quot;rst r z x&amp;quot; by (simp only: rst_sc1_declarativo)        &lt;br /&gt;
qed&lt;br /&gt;
 &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mjoseh</name></author>
		
	</entry>
</feed>