Exemplo n.º 1
0
from proveit.basiclogic import FALSE, Equals, Implies
from proveit.common import A

# FALSE = A
FeqA = Equals(FALSE, A)
# FALSE assumen FALSE=A and A
FeqA.derive_reversed().derive_contradiction().proven({FeqA, A})
# forall_{A} (FALSE=A) => [A => FALSE]
Implies(FeqA, Implies(A, FALSE)).generalize([A]).qed(__file__)
Exemplo n.º 2
0
from proveit.basiclogic import Implies, Equals, TRUE
from proveit.common import A

hypothesis = Equals(TRUE, A)
Implies(hypothesis, hypothesis.derive_reversed(
).derive_via_boolean_equality()).generalize(A).qed(__file__)
Exemplo n.º 3
0
from proveit.basiclogic import Implies, Equals, FALSE
from proveit.common import A

# FeqA := (F=A)
FeqA = Equals(FALSE, A)
# Not(A) assuming FeqA
not_a = FeqA.derive_reversed().derive_via_boolean_equality().proven({FeqA})
Implies(FeqA, not_a).generalize(A).qed(__file__)
Exemplo n.º 4
0
from proveit.basiclogic import Implies, Equals
from proveit.common import x, y, P, Px, Py

# hypothesis = (x=y)
hypothesis = Equals(x, y)
# P(x) assuming x=y and P(y)
hypothesis.derive_reversed().sub_left_side_into(Px, x).proven({hypothesis, Py})
# forall_{P, x, y} {(x=y) => [P(x) => P(y)]}
Implies(hypothesis, Implies(Px, Py)).generalize((P, x, y)).qed(__file__)