Part VII Teoria de la demostracion en logica de predicados

Remark 25.10.

Los simbolos de funcion no son necesarios para la logica de predicados. Se pueden “simular” con predicados.

Example 25.11.

D={personas}D=\left\{\text{personas}\right\}

m(x):m(x)\colon la madre de xM(x,y):x\rightarrow M(x,y): x es la madre de yy.

“La madre de Antonio es rubia”.

R(x):R(x)\colon x es rubio. R(m(a))R(m(a)).

x(M(x,a)R(x))\forall x(M(x,a)\rightarrow R(x))

“Todos los hermanos de Antonio son rubios” x(H(x,a)R(x))\Rightarrow\forall x(H(x,a)\rightarrow R(x)) (que no la puedo hacer con funciones).

Vamos a ampliar el sistema de Gentzen para la logica proposicional, añadiendo a las 8 relgas que teniamos 4 nuevas reglas para los cuantificadores. El sistema de demostracion resultante es valido para la logica de predicados sin igualdad (definir un sistema que sea valido para la logica de predicados con igualdad que hemos introducido en los temas 5 y 6 requeriria reglas adicionales y tiene cierto grado de complejidad).

Los nombres de las 4 nuevas reglas de inferencia son:

EE\forall II\forall
EE\exists II\exists
Proposition 25.12.
  • φ,ψ,\varphi,\psi,\ldots representaran formulas cualesquiera de la logica de predicados.

  • φ(x)\varphi(x) denotara una formula donde la variable xx tiene apariciones libres. Si despues escribimos φ(t)\varphi(t), donde tt puede ser un termino cualquiera, esto representara la formula φ\varphi donde todas las apariciones libres de xx se han sustituido por tt.

  • Llamaremos variable fresca a una variable que no ha aparecido previamente en el razonamiento.

Definition 25.13 (Regla de eliminacion del universal, EE\forall).

Sea tt un termino cualquiera

xφ(x)φ(t)\begin{array}[]{c}\forall x\varphi(x)\\ \hline\cr\varphi(t)\end{array}
Definition 25.14 (Regla de introduccion del existencial, II\exists).

Sea tt un termino cualquiera

φ(t)xφ(x)\begin{array}[]{c }\varphi(t)\\ \hline\cr\exists x\varphi(x)\end{array}
Example 25.15.

Demostrar la validez de {x(P(x)Q(x)),P(a)}Q(a)\left\{\forall x(P(x)\to Q(x)),P(a)\right\}\vdash Q(a).

  1. 1.

    x(P(x)Q(x))\forall x(P(x)\to Q(x)) Pr

  2. 2.

    P(a)P(a) Pr

  3. 3.

    P(a)Q(a)E,1,x=aP(a)\to Q(a)\quad E\forall,1,x=a

  4. 4.

    Q(a)E,2,3Q(a)\quad E\rightarrow,2,3

Example 25.16.

Demostrar la validez de {P(b),xP(x)Q(a)}Q(a)\left\{P(b),\exists xP(x)\to Q(a)\right\}\vdash Q(a).

  1. 1.

    P(b)P(b) Pr

  2. 2.

    xP(x)toQ(a)\exists xP(x)toQ(a) Pr

  3. 3.

    xP(x)I,1\exists xP(x)\quad I\exists,1

  4. 4.

    Q(a)E,2,3Q(a)\quad E\rightarrow,2,3

Definition 25.17 (Regla de introduccion del universal, II\forall).
y Variable fresca φ ( y ) xφ(x)\begin{array}[]{c}\noindent\framebox{\parbox{426.82pt}{ $y\qquad\qquad\quad\;\text{Variable fresca}$ \par$\vdots$ \par$\varphi(y)$}}\vspace{0.2cm}\\ \hline\cr\forall x\varphi(x)\end{array}
Remark 25.18.

Este es el unico caso en el que usamos una demostracion auxiliar que no empieza con una premisa auxiliar, sino con una variable libre y que no sirve para introducir un implica sino un para todo.

Example 25.19.

Demostrar la validez de xP(x)xQ(x)x(P(x)Q(x))\forall xP(x)\wedge\forall xQ(x)\vdash\forall x(P(x)\wedge Q(x))

  1. 1.

    xP(x)xQ(x)\forall xP(x)\wedge\forall xQ(x)

[resume] 1.yy Variable fresca 2.xP(x)E,1\forall xP(x)\quad E\wedge,1 3.P(y)E,3,x=yP(y)\quad E\forall,3,x=y 4.xQ(x)E,1\forall xQ(x)\quad E\wedge,1 5.Q(y)E,5,x=yQ(y)\quad E\forall,5,x=y 6.P(y)Q(y)P(y)\wedge Q(y)

  1. 8.

    x(P(x)Q(x))I(27)\forall x(P(x)\wedge Q(x))\quad I\forall(2-7)

Example 25.20.

Demostrar la validez de x(P(x)Q(x))xP(x)xQ(x)\forall x(P(x)\wedge Q(x))\vdash\forall xP(x)\wedge\forall xQ(x).

  1. 1.

    x(P(x)Q(x))\forall x(P(x)\wedge Q(x)) Pr

[resume] 1.yy Variable fresca 2.P(y)Q(y)E,1,x=yP(y)\wedge Q(y)\quad E\forall,1,x=y 3.P(y)E,3P(y)\quad E\wedge,3

  1. 5.

    xP(x)I(23)\forall xP(x)\quad I\forall(2-3)

6.zz Variable fresca 7.P(z)Q(z)E,1,x=zP(z)\wedge Q(z)\quad E\forall,1,x=z 8.Q(z)E,7Q(z)\quad E\wedge,7

  1. 9.

    xQ(x)I(68)\forall xQ(x)\quad I\forall(6-8)

  2. 10.

    xP(x)xQ(x)I,5,9\forall xP(x)\wedge\forall xQ(x)\quad I\wedge,5,9

Definition 25.21 (Regla de eliminacion del existencial, EE\exists).

Sea yy una variable fresca y que no aparece libre en ψ\psi.

xφ(x)φ(v)ψψ\begin{array}[]{c}\exists x\varphi(x)\\ \varphi(v)\to\psi\\ \hline\cr\psi\end{array}
Remark 25.22.

Tipicamente la regla EE\exists se usa cuando se tiene una formula xφ(x)\exists x\varphi(x), iniciando una demostracion auxiliar que tiene como premisa auxiliar φ(y)\varphi(y) y llegando a una conclusion que no dependa de yy.

xφ(x)\exists x\varphi(x)

φ(y)Premisa auxiliar\varphi(y)\qquad\quad\text{Premisa auxiliar} \vdots ψ\psi φ(y)ψIψE\begin{array}[]{lr}\varphi(y)\rightarrow\psi&I\rightarrow\\ \psi&E\exists\end{array}

Example 25.23.

Demostrar la validez de {x(P(x)Q(x)),xP(x)}xQ(x)\left\{\forall x(P(x)\to Q(x)),\exists xP(x)\right\}\vdash\exists xQ(x).

  1. 1.

    xP(x)\exists xP(x) Pr

  2. 2.

    x(P(x)Q(x))\forall x(P(x)\to Q(x)) Pr

[resume] 1.P(y)P(y) Pr aux (var fresca) 2.P(y)Q(y)E,2,x=yP(y)\to Q(y)\quad E\forall,2,x=y 3.Q(y)E,3,4Q(y)\quad E\to,3,4 4.xQ(x)I,5,x=y\exists xQ(x)\quad I\exists,5,x=y

  1. 7.

    P(y)xQ(x)I(36)P(y)\to\exists xQ(x)\quad I\to(3-6)

  2. 8.

    xQ(x)E,1,7\exists xQ(x)\quad E\exists,1,7

Example 25.24.

Demostrar la validez de {xP(x),xQ(x)}xy(P(x)Q(y))\left\{\exists xP(x),\exists xQ(x)\right\}\vdash\exists x\exists y(P(x)\wedge Q% (y)).

  1. 1.

    xP(x)\exists xP(x) Pr

  2. 2.

    xQ(x)\exists xQ(x) Pr

[resume] 1.P(z)P(z) Pr aux (z var fresca) 4.Q(t)Q(t) Pr aux (t var fresca) 5.P(z)Q(t)I,3,4P(z)\wedge Q(t)\quad I\wedge,3,4 6.y(P(z)Q(y))I,5,y=t\exists y(P(z)\wedge Q(y))\quad I\exists,5,y=t 7.Q(t)y(P(z)Q(y))I(46)Q(t)\to\exists y(P(z)\wedge Q(y))\quad I\to(4-6) 8.y(P(z)Q(y))E,2,7\exists y(P(z)\wedge Q(y))\quad E\exists,2,7 9.xy(P(x)Q(y))I,8,x=z\exists x\exists y(P(x)\wedge Q(y))\quad I\exists,8,x=z

  1. 10.

    P(z)xy(P(x)Q(y))I(39)P(z)\to\exists x\exists y(P(x)\wedge Q(y))\quad I\to(3-9)

  2. 11.

    xy(P(x)Q(y))E,1,10\exists x\exists y(P(x)\wedge Q(y))\quad E\exists,1,10

Example 25.25.

Demostrar la validez de yxP(x,y)xyP(x,y)\exists y\forall xP(x,y)\vdash\forall x\exists yP(x,y).

  1. 1.

    yxP(x,y)\exists y\forall xP(x,y) Pr

[resume] 1.xP(x,z)\forall xP(x,z) Pr aux (var fresca) 3.tt Var fresca 4.P(t,z)E,2,x=tP(t,z)\quad E\forall,2,x=t 5.yP(x,y)I,4,y=z\exists yP(x,y)\quad I\exists,4,y=z 6.xyP(x,y)I(35)\forall x\exists yP(x,y)\quad I\forall(3-5)

  1. 7.

    xP(x,z)xyP(x,y)I(26)\forall xP(x,z)\to\forall x\exists yP(x,y)\quad I\to(2-6)

  2. 8.

    xyP(x,y)E,1,7\forall x\exists yP(x,y)\quad E\exists,1,7

Remark 25.26.

Se puede demostrar que el sistema de Gentzen que hemos introducido es correcto y completo para la logica de predicados. Sin embargo, esta logica no es decidible.