<?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_2C_sol</id>
	<title>Examen 2C 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_2C_sol"/>
	<link rel="alternate" type="text/html" href="https://www.glc.us.es/~jalonso/LMF2020/index.php?title=Examen_2C_sol&amp;action=history"/>
	<updated>2026-09-19T06:37:22Z</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_2C_sol&amp;diff=1281&amp;oldid=prev</id>
		<title>Mjoseh: Protegió «Examen 2C 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_2C_sol&amp;diff=1281&amp;oldid=prev"/>
		<updated>2020-09-10T08:20:02Z</updated>

		<summary type="html">&lt;p&gt;Protegió «&lt;a href=&quot;/~jalonso/LMF2020/index.php/Examen_2C_sol&quot; title=&quot;Examen 2C sol&quot;&gt;Examen 2C 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 08:20 10 sep 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_2C_sol&amp;diff=1280&amp;oldid=prev</id>
		<title>Mjoseh: Página creada con «&lt;source lang = &quot;isabelle&quot;&gt; theory examen_9_sep_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_2C_sol&amp;diff=1280&amp;oldid=prev"/>
		<updated>2020-09-10T08:19:49Z</updated>

		<summary type="html">&lt;p&gt;Página creada con «&amp;lt;source lang = &amp;quot;isabelle&amp;quot;&amp;gt; theory examen_9_sep_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_9_sep_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. (2.5 puntos) Demostrar detalladamente con Isabelle, &lt;br /&gt;
  sin usar métodos automáticos (como simp, auto, ...) sino sólo las &lt;br /&gt;
  reglas básicas, que el siguiente argumento es correcto:&lt;br /&gt;
  Ningún individuo que sea candidato será derrotado si hace una&lt;br /&gt;
  buena campaña. Todo individuo que se postula es un candidato. Cualquier&lt;br /&gt;
  candidato que no sea derrotado, será elegido. Todo individuo que sea&lt;br /&gt;
  elegido hace una buena campaña. Por tanto, todo individuo que se &lt;br /&gt;
  postula será elegido si y sólo si hace una buena campaña. &lt;br /&gt;
&lt;br /&gt;
  Simbología: I(x): x es individuo, C(x): x es candidato,&lt;br /&gt;
              D(x): x es derrotado, B(x): x hace una buena campaña, &lt;br /&gt;
              P(x): x se postula, E(x): x es elegido. &lt;br /&gt;
---------------------------------------------------------------------›&lt;br /&gt;
lemma &lt;br /&gt;
  assumes &amp;quot;∀x. (I(x)∧C(x))∧B(x)⟶¬D(x)&amp;quot;&lt;br /&gt;
          &amp;quot;∀x. I(x)∧P(x) ⟶ C(x)&amp;quot;&lt;br /&gt;
          &amp;quot;∀x. C(x) ∧ ¬D(x) ⟶ E(x)&amp;quot;&lt;br /&gt;
          &amp;quot;∀x. I(x)∧E(x) ⟶ B(x)&amp;quot;&lt;br /&gt;
  shows   &amp;quot;∀x. I(x)∧P(x)⟶(E(x)⟷B(x))&amp;quot;&lt;br /&gt;
  proof (rule allI)&lt;br /&gt;
  fix a&lt;br /&gt;
  show &amp;quot;I(a)∧P(a) ⟶ (E(a)⟷B(a))&amp;quot;&lt;br /&gt;
    proof&lt;br /&gt;
      assume &amp;quot;I(a)∧P(a)&amp;quot;&lt;br /&gt;
      show &amp;quot;E(a)⟷B(a)&amp;quot;&lt;br /&gt;
        proof&lt;br /&gt;
          assume &amp;quot;E(a)&amp;quot;&lt;br /&gt;
          show  &amp;quot;B(a)&amp;quot;&lt;br /&gt;
             proof -&lt;br /&gt;
              have &amp;quot;I(a)&amp;quot; using ‹I(a)∧P(a)› by (rule conjunct1)&lt;br /&gt;
              then have 1:&amp;quot;I(a)∧E(a)&amp;quot; using ‹E(a)› by (rule conjI)&lt;br /&gt;
              have &amp;quot;I(a)∧E(a) ⟶ B(a)&amp;quot; using assms(4) by (rule allE)&lt;br /&gt;
              then show &amp;quot;B(a)&amp;quot; using 1 by (rule mp)&lt;br /&gt;
             qed  &lt;br /&gt;
        next&lt;br /&gt;
          assume &amp;quot;B(a)&amp;quot;&lt;br /&gt;
          show   &amp;quot;E(a)&amp;quot;&lt;br /&gt;
             proof -&lt;br /&gt;
              have &amp;quot;I(a)∧P(a) ⟶ C(a)&amp;quot; using assms(2) by (rule allE)&lt;br /&gt;
              then have &amp;quot;C(a)&amp;quot; using   ‹I(a)∧P(a)› by (rule mp)&lt;br /&gt;
              have &amp;quot;I(a)&amp;quot; using  ‹I(a)∧P(a)› by (rule conjunct1)&lt;br /&gt;
              then have &amp;quot;I(a)∧C(a)&amp;quot; using ‹C(a)› by (rule conjI)&lt;br /&gt;
              then have 2:&amp;quot;(I(a)∧C(a))∧B(a)&amp;quot; using ‹B(a)› &lt;br /&gt;
                by (rule conjI)&lt;br /&gt;
              have &amp;quot;(I(a)∧C(a))∧B(a)⟶¬D(a)&amp;quot; using assms(1) &lt;br /&gt;
                by (rule allE)&lt;br /&gt;
              then have &amp;quot;¬D(a)&amp;quot; using 2 by (rule mp)&lt;br /&gt;
              have 3:&amp;quot;C(a) ∧ ¬D(a) ⟶ E(a)&amp;quot; using assms(3) &lt;br /&gt;
                by (rule allE)&lt;br /&gt;
              have &amp;quot;C(a)∧¬D(a)&amp;quot; using ‹C(a)› ‹¬D(a)› by (rule conjI)&lt;br /&gt;
              with 3 show &amp;quot;E(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;
&lt;br /&gt;
text ‹ -----------------------------------------------------------------&lt;br /&gt;
  Ejercicio 2. (2.5 puntos) Consideramos la función&lt;br /&gt;
     menores :: int ⇒ int list ⇒ bool&lt;br /&gt;
  tal que (menores a xs) es la lista de los elementos de la lista xs que &lt;br /&gt;
  son menores que a. Por ejemplo,&lt;br /&gt;
     value &amp;quot;menores 2 [3,0,1] = [0,1]&amp;quot;&lt;br /&gt;
     value &amp;quot;menores 2 [3,0,5] = [0]&amp;quot;&lt;br /&gt;
-----------------------------------------------------------------------›&lt;br /&gt;
 &lt;br /&gt;
fun menores :: &amp;quot;int ⇒ int list ⇒ int list&amp;quot; where&lt;br /&gt;
  &amp;quot;menores a []     = []&amp;quot;&lt;br /&gt;
| &amp;quot;menores a (x#xs) = (if x &amp;lt; a then x # (menores a xs)&lt;br /&gt;
                                else (menores a xs))&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
value &amp;quot;menores 2 [3,0,1] = [0,1]&amp;quot;&lt;br /&gt;
value &amp;quot;menores 2 [3,0,5] = [0]&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
text ‹ -----------------------------------------------------------------&lt;br /&gt;
  Demostrar que la longitud de la lista de elementos menores que uno &lt;br /&gt;
  dado es menor o igual que la longitud de la lista original.&lt;br /&gt;
-----------------------------------------------------------------------›&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración estructurada:›&lt;br /&gt;
&lt;br /&gt;
lemma menores_menor_1:&lt;br /&gt;
  &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
proof(induct xs)&lt;br /&gt;
    show &amp;quot;length (menores x [])&amp;lt;Suc(length [])&amp;quot; by simp&lt;br /&gt;
  next&lt;br /&gt;
    fix xs a&lt;br /&gt;
    assume HI: &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
    show &amp;quot;length (menores x (a#xs))&amp;lt; Suc(length (a#xs))&amp;quot;&lt;br /&gt;
    proof(cases &amp;quot;a&amp;lt;x&amp;quot;)&lt;br /&gt;
      case True&lt;br /&gt;
      then have &amp;quot;length (menores x (a#xs)) = length(a#(menores x xs))&amp;quot; &lt;br /&gt;
        by simp&lt;br /&gt;
      also have &amp;quot;... = Suc(length(menores x xs))&amp;quot; by simp&lt;br /&gt;
      also have &amp;quot;...&amp;lt; Suc(Suc( length  xs))&amp;quot; using HI by simp&lt;br /&gt;
      also have &amp;quot;... = Suc(length(a#xs))&amp;quot; by simp&lt;br /&gt;
      finally show ?thesis by simp&lt;br /&gt;
  next&lt;br /&gt;
    case False&lt;br /&gt;
    then have &amp;quot;length (menores x (a#xs)) = length(menores x xs)&amp;quot; by simp&lt;br /&gt;
    also have &amp;quot;... &amp;lt; Suc (length xs)&amp;quot; using HI by simp&lt;br /&gt;
    also have &amp;quot;... &amp;lt; Suc (length (a#xs))&amp;quot; by simp&lt;br /&gt;
    finally show ?thesis by simp&lt;br /&gt;
  qed&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración detallada:›&lt;br /&gt;
&lt;br /&gt;
lemma menores_menor_detallada:&lt;br /&gt;
  &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
proof(induct xs)&lt;br /&gt;
  show &amp;quot;length (menores x []) &amp;lt; Suc (length [])&amp;quot; &lt;br /&gt;
    by  (simp only: list.size lessI menores.simps(1))&lt;br /&gt;
next&lt;br /&gt;
  fix xs a&lt;br /&gt;
  assume HI: &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
  show &amp;quot;length (menores x (a#xs))&amp;lt; Suc(length (a#xs))&amp;quot;&lt;br /&gt;
  proof (cases &amp;quot;a&amp;lt;x&amp;quot;)&lt;br /&gt;
    case True&lt;br /&gt;
    then have &amp;quot;menores x (a#xs) = a#(menores x xs)&amp;quot; &lt;br /&gt;
      by (simp only:if_True menores.simps)&lt;br /&gt;
    then have &amp;quot;length (menores x (a#xs)) = length(a#(menores x xs))&amp;quot; &lt;br /&gt;
     by (simp only:)&lt;br /&gt;
    also have &amp;quot;... = Suc(length(menores x xs))&amp;quot; by (simp only:list.size)&lt;br /&gt;
    also have &amp;quot;...&amp;lt; Suc(Suc( length  xs))&amp;quot; using HI by (simp only:)&lt;br /&gt;
    also have &amp;quot;... = Suc(length(a#xs))&amp;quot; by (simp only: list.size)&lt;br /&gt;
    finally show ?thesis by this&lt;br /&gt;
  next&lt;br /&gt;
    case False&lt;br /&gt;
    then have &amp;quot;menores x (a#xs) = menores x xs&amp;quot; &lt;br /&gt;
      by (simp only: if_False menores.simps(2))&lt;br /&gt;
    then have &amp;quot;length (menores x (a#xs)) = length(menores x xs)&amp;quot; &lt;br /&gt;
      by (simp only:)&lt;br /&gt;
    also have &amp;quot;... &amp;lt; Suc (length xs)&amp;quot; using HI by (simp only:)&lt;br /&gt;
    also have &amp;quot;... &amp;lt; Suc (length (a#xs))&amp;quot; by (simp only: list.size)&lt;br /&gt;
    finally show ?thesis by this&lt;br /&gt;
  qed&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración aplicativa:›&lt;br /&gt;
&lt;br /&gt;
lemma menores_menor_aplicativa:&lt;br /&gt;
  &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
  apply (induct xs)&lt;br /&gt;
   apply (simp only: list.size lessI menores.simps(1))&lt;br /&gt;
  apply (simp only:menores.simps(2))&lt;br /&gt;
  apply(split if_split)&lt;br /&gt;
  apply (rule conjI)&lt;br /&gt;
   apply (rule impI)&lt;br /&gt;
   apply (simp only: list.size)&lt;br /&gt;
  apply (rule impI)&lt;br /&gt;
  apply (simp only: list.size)&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
― ‹Demostración automática:›&lt;br /&gt;
&lt;br /&gt;
lemma menores_menor_auto:&lt;br /&gt;
  &amp;quot;length (menores x xs) &amp;lt; Suc (length xs)&amp;quot;&lt;br /&gt;
by (induct xs) auto&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
lemma &lt;br /&gt;
  &amp;quot;length (menores x xs) &amp;lt; 1 + length xs&amp;quot;&lt;br /&gt;
proof(induct xs)&lt;br /&gt;
  show &amp;quot;length (menores x []) &amp;lt; 1 + (length [])&amp;quot; &lt;br /&gt;
    by  (simp only: list.size lessI menores.simps(1))&lt;br /&gt;
next&lt;br /&gt;
  fix xs a&lt;br /&gt;
  assume HI: &amp;quot;length (menores x xs) &amp;lt; 1 + length xs&amp;quot;&lt;br /&gt;
  show &amp;quot;length (menores x (a#xs)) &amp;lt; 1 + length (a#xs)&amp;quot;&lt;br /&gt;
  proof (cases &amp;quot;a&amp;lt;x&amp;quot;)&lt;br /&gt;
    case True&lt;br /&gt;
    then have &amp;quot;menores x (a#xs) = a#(menores x xs)&amp;quot; &lt;br /&gt;
      by (simp only:if_True menores.simps)&lt;br /&gt;
    then have &amp;quot;length (menores x (a#xs)) = length(a#(menores x xs))&amp;quot; &lt;br /&gt;
     by (simp only:)&lt;br /&gt;
    also have &amp;quot;... = 1 + (length(menores x xs))&amp;quot; by (simp only:list.size)&lt;br /&gt;
    also have &amp;quot;...&amp;lt; 1 + (1 + ( length  xs))&amp;quot; using HI by (simp only:)&lt;br /&gt;
    also have &amp;quot;... = 1 + (length(a#xs))&amp;quot; by (simp only: list.size)&lt;br /&gt;
    finally show ?thesis by this&lt;br /&gt;
  next&lt;br /&gt;
    case False&lt;br /&gt;
    then have &amp;quot;menores x (a#xs) = menores x xs&amp;quot; &lt;br /&gt;
      by (simp only: if_False menores.simps(2))&lt;br /&gt;
    then have &amp;quot;length (menores x (a#xs)) = length(menores x xs)&amp;quot; &lt;br /&gt;
      by (simp only:)&lt;br /&gt;
    also have &amp;quot;... &amp;lt; 1 +  (length xs)&amp;quot; using HI by (simp only:)&lt;br /&gt;
    also have &amp;quot;... &amp;lt; 1 +  (length (a#xs))&amp;quot; by (simp only: list.size)&lt;br /&gt;
    finally show ?thesis by this&lt;br /&gt;
  qed&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
text ‹------------------------------------------------------------------&lt;br /&gt;
  Ejercicio 3. (2.5 puntos) Sea G un grupo. Demostrar que si se verifica&lt;br /&gt;
   ∀x y. (((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭), entonces también se verifica&lt;br /&gt;
   ∀x. ∀y. ∀z. x ⋅ y = z ⋅ x ⟶ y = z&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_d:  &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;
lemma&lt;br /&gt;
  assumes  &amp;quot;((y^ ⋅ x^) ⋅ y) ⋅ x = 𝟭&amp;quot;&lt;br /&gt;
  shows &amp;quot;x ⋅ y = z ⋅ x ⟶ y = z&amp;quot;&lt;br /&gt;
proof (rule impI)&lt;br /&gt;
  assume 1: &amp;quot;x ⋅ y = z ⋅ x&amp;quot;&lt;br /&gt;
  show &amp;quot;y = z&amp;quot;&lt;br /&gt;
  proof-&lt;br /&gt;
    have  2: &amp;quot;x ⋅ y = y ⋅ x&amp;quot;&lt;br /&gt;
    proof-&lt;br /&gt;
      have &amp;quot;x ⋅ y = (x ⋅ y) ⋅ 𝟭&amp;quot; by (simp only:  neutro_d)&lt;br /&gt;
      also have &amp;quot;… =  (x ⋅ y) ⋅ (((y^ ⋅ x^) ⋅ y) ⋅ x)&amp;quot; &lt;br /&gt;
        using assms by (simp only:)&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: neutro_d)&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: 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;
     have &amp;quot;y ⋅ x = z ⋅ x&amp;quot; using 1 2 by (simp only:)&lt;br /&gt;
     then have &amp;quot;(y ⋅ x) ⋅ x^ = (z ⋅ x) ⋅ x^&amp;quot; by (simp only:)&lt;br /&gt;
     then have &amp;quot;y ⋅ (x ⋅ x^) = z ⋅ (x ⋅ x^)&amp;quot; by (simp only:asociativa)&lt;br /&gt;
     then have &amp;quot;y ⋅ 𝟭 = z ⋅ 𝟭&amp;quot; by (simp only:inverso_d)&lt;br /&gt;
     then show &amp;quot;y = z &amp;quot; by (simp only:neutro_d)&lt;br /&gt;
    qed&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
text ‹-----------------------------------------------------------------&lt;br /&gt;
 Ejercicio 4. (2.5 puntos) El conjunto de los conjuntos finitos &lt;br /&gt;
 se define inductivamente por&lt;br /&gt;
    inductive_set Finito :: &amp;quot;&amp;#039;a set set&amp;quot;&lt;br /&gt;
      where&lt;br /&gt;
        vacioI:   &amp;quot;{} ∈ Finito&amp;quot; |&lt;br /&gt;
        insertaI: &amp;quot;A ∈ Finito ⟹ insert a A ∈ Finito&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 Demostrar detalladamente que la unión de dos conjuntos finitos es &lt;br /&gt;
 finito; es decir.&lt;br /&gt;
     ⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&lt;br /&gt;
&lt;br /&gt;
 Nota: Los únicos métodos que se pueden usar son induct y &lt;br /&gt;
 (simp only: ...).  &lt;br /&gt;
 ---------------------------------------------------------------------›&lt;br /&gt;
&lt;br /&gt;
inductive_set Finito :: &amp;quot;&amp;#039;a set set&amp;quot;&lt;br /&gt;
  where&lt;br /&gt;
    vacioI:   &amp;quot;{} ∈ Finito&amp;quot; |&lt;br /&gt;
    insertaI: &amp;quot;A ∈ Finito ⟹ insert a A ∈ Finito&amp;quot;&lt;br /&gt;
&lt;br /&gt;
― ‹ Demostración declarativa  detallada ›&lt;br /&gt;
lemma &amp;quot;⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&amp;quot;&lt;br /&gt;
proof (induct rule: Finito.induct)&lt;br /&gt;
  assume &amp;quot;B ∈ Finito&amp;quot;&lt;br /&gt;
  then show &amp;quot;{} ∪ B ∈ Finito&amp;quot; by (simp only: Un_empty_left)&lt;br /&gt;
next&lt;br /&gt;
  fix A a&lt;br /&gt;
  assume AF: &amp;quot;A ∈ Finito&amp;quot; and&lt;br /&gt;
         HI: &amp;quot;B ∈ Finito ⟹ A ∪ B ∈ Finito&amp;quot; and&lt;br /&gt;
         BF: &amp;quot;B ∈ Finito&amp;quot;&lt;br /&gt;
  have &amp;quot;A ∪ B ∈ Finito&amp;quot; by (simp only: HI BF)&lt;br /&gt;
  then have &amp;quot;insert a (A ∪ B) ∈ Finito&amp;quot; by (simp only: insertaI)&lt;br /&gt;
  then show &amp;quot;(insert a A) ∪ B ∈ Finito&amp;quot; &lt;br /&gt;
    by (simp only: Set.Un_insert_left)&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
― ‹ Demostración estructurada ›&lt;br /&gt;
lemma &amp;quot;⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&amp;quot;&lt;br /&gt;
proof (induct rule: Finito.induct)&lt;br /&gt;
  assume &amp;quot;B ∈ Finito&amp;quot;&lt;br /&gt;
  then show &amp;quot;{} ∪ B ∈ Finito&amp;quot; by simp&lt;br /&gt;
next&lt;br /&gt;
  fix A a&lt;br /&gt;
  assume &amp;quot;A ∈ Finito&amp;quot; &lt;br /&gt;
         &amp;quot;B ∈ Finito ⟹ A ∪ B ∈ Finito&amp;quot; &lt;br /&gt;
         &amp;quot;B ∈ Finito&amp;quot;&lt;br /&gt;
  then have &amp;quot;A ∪ B ∈ Finito&amp;quot; by simp&lt;br /&gt;
  then show &amp;quot;(insert a A) ∪ B ∈ Finito&amp;quot; by (simp add: insertaI)&lt;br /&gt;
qed&lt;br /&gt;
&lt;br /&gt;
― ‹ Demostración aplicativa  detallada ›&lt;br /&gt;
lemma &amp;quot;⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&amp;quot;&lt;br /&gt;
  apply (erule Finito.induct)&lt;br /&gt;
   apply (simp only: Un_empty_left)&lt;br /&gt;
  apply (simp only: Set.Un_insert_left)&lt;br /&gt;
  apply (simp only: insertaI)&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
― ‹ Demostración aplicativa estructurada ›&lt;br /&gt;
lemma &amp;quot;⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&amp;quot;&lt;br /&gt;
  apply (erule Finito.induct)&lt;br /&gt;
   apply simp &lt;br /&gt;
  apply (auto intro: insertaI)&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
― ‹ Demostración automática ›&lt;br /&gt;
lemma &amp;quot;⟦ A ∈ Finito; B ∈ Finito ⟧ ⟹ A ∪ B ∈ Finito&amp;quot;&lt;br /&gt;
  by (induct rule: Finito.induct)&lt;br /&gt;
     (auto intro: insertaI)&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>