We will prove that the following program swap value: x:=x+y; y:=x-y; x:=x-y, assuming the program terminates and x, y map to arbitrary constant.
The strategy is to break the statement one by one:
assume there exist state transition w \to w_1 \to w_2 \to w_3=v
then derive the expression value for expression x and y from state w_3 back to w
then we finished the proof
valid: true no matter which truth values we assign to the variables
satisfiable: there is some way to assign truth values to the variables so that the resulting formula is true
There are many choices, and the same concepts may admit many different formalization, suitable for different purposes. For example, we could have very few inference rules (in propositional logic often just one!) and many axioms, usually called a Hilbert-style system. Or we could have many rules and essentially no axioms.
simple sequent (statement): e.g. F_1, ..., F_n \vdash G
antecedents (assumption, left): F_1, ..., F_n, a collection of antecedents could be abbrivate to \Gamma
succedent (goal, right): G
turnstile(entails): \vdash
conclusion: things below the line
premises: things above the line
example of right rule:
example of left rule:
rule of identity:
We write (and read) this rule bottom-up. We can branch top with smaller proofs (leaves), and eventually leads to all leaves to identities to finish proof. The difference between \to and \vdash is only that \vdash have an explicit "left" and "right" side, but proposition containing \to has no such notion of "left" and "right" side. Like, \vdash establishes a pointer.
If there are multiple things on the top (splitting), then it is "and"-related.
We can use the following left and right and rule.
However, the above can't prove (p \to p) \to q \vdash q, indicating the system is incomplete. We could fix it be letting the right hand rule be:
But the following rule (not invertible) can't prove p \lor (p \to q).
In intuitionistic logic, proofs correspond to (functional) programs, and propositions correspond to their types. For example, an intuitionistic proof of F \to G is a function of type F \to G that takes a proof of F into a proof of G.
We fix this problem by allowing "all the left hand side to prove any of the right hand side" (ie F_1, ..., F_n \vdash G_1, ..., G_m is valid if whenever all F_i are true then at least one G_j is true.)
The disjunctive right hand rule (invertible) becomes:
Sound: never prove false statement
Complete: every true statement is provable
Decidable: we can prove or disprove any statement
Consistent: cannot prove both a statement and its negation
Gödel’s incompleteness theorem: "No sufficiently powerful logic can be both consistent and complete."
To prove soundness of a system, you can prove all rules are sound. That is: We assume all premise (top) as well as assumption (buttom left), and show conclusion (bottom right).
Invertible means we don't lose information by applying rules. This makes our proving system no need to backtrack.
To prove invertible of a system, you can prove all rules are invertible.
To prove invertible of a rule, just prove from bottom up. (ie. assume bottom, and top left, prove top right)
Every premise of every rule is smaller than its conclusion (bottom). Each rule removes at least one of the boolean connectives (e.g. \land, \lor) when going up.
Termination: when terminate, we might end up
a statement with no premises (always true, proved it)
a sequent with no connectives like p_1, ..., p_n \vdash q_1, ..., q_m which is true iff one of p_i is equal to one of q_j. (disproved it)
There is a small matter of strategy: in such a prover, we should probably apply 0-premise rules (proof is done!), before 1-premise rules (a proof goal replaced by an equivalent, smaller one), before 2-premise rules (because we now have two sequents to prove). This is only a heuristic and a matter of efficiency
For propositional language (not other system with integers and general arithmetic), invertibility and termination implies completeness.
clarification on terminology:
deduction / derivation: an object we manipulate in this context
proof: general mathematical reasoning
Table of Content