Logic Lab
Build any propositional formula and explore its truth table, its syntax tree, whether it is a tautology, and how it compares with another formula. Every result is computed with the exact two-valued semantics.
Use letters for statements and ¬ ∧ ∨ → ↔ (or ~ & | -> <->). Example: P ∧ Q → P
Truth table
| P | Q | Q → P | P → Q → P |
|---|---|---|---|
| T (true) | T (true) | T (true) | T (true) |
| T (true) | F (false) | T (true) | T (true) |
| F (false) | T (true) | F (false) | T (true) |
| F (false) | F (false) | T (true) | T (true) |
In Lean: (P Q : Prop) → P → Q → P
Syntax tree
P → Q → P
Switches
Value in this situation: True
A complete truth table checks every possible situation, so for propositional logic it is a proof. It does not extend to claims about infinitely many objects.
Natural deduction
p1 : P → Q⊢ ¬Q → ¬PLean:
(P Q : Prop) (p1 : P → Q) : ¬Q → ¬P1 open · 0 invalid
- openGoal: ¬Q → ¬P
Compare two formulas
Use letters for statements and ¬ ∧ ∨ → ↔ (or ~ & | -> <->). Example: P ∧ Q → P
Use letters for statements and ¬ ∧ ∨ → ↔ (or ~ & | -> <->). Example: P ∧ Q → P
Equivalent: they agree in every row
| P | Q | P → Q | ¬Q → ¬P | same? |
|---|---|---|---|---|
| T (true) | T (true) | T (true) | T (true) | ✓ |
| T (true) | F (false) | F (false) | F (false) | ✓ |
| F (false) | T (true) | T (true) | T (true) | ✓ |
| F (false) | F (false) | T (true) | T (true) | ✓ |