PRACTICE →↑ BACK TO TOP

Let's talk

contact@adriamics.com

Logic

GitHub Changelog -

  • 1

Propositions and truth values

A proposition is a declarative statement that is either true or false, but not both.

Examples:

  • " is prime." is a proposition.

  • "Close the door." is not a proposition.

  • "" is not a proposition until is specified or quantified.

A proposition is assigned one of two truth values:

  • for true

  • for false

Atomic and compound propositions

  • Atomic propositions are basic statements such as , , or .

  • Compound propositions are built from atomic propositions using logical connectives.

Example:

Truth tables

Truth tables list the truth value of a compound proposition for every combination of inputs.

They are the most direct way to test equivalence or validity for small propositional formulas.


Logical connectives

The standard connectives are negation, conjunction, disjunction, implication, and biconditional.

Negation

Meaning: "not ".

Truth table:

TF
FT

Conjunction

Meaning: " and ". True only when both parts are true.

TTT
TFF
FTF
FFF

Disjunction

Meaning: " or " in the inclusive sense: at least one is true.

TTT
TFT
FTT
FFF

Implication

Meaning: "if , then ." It is false only when is true and is false.

TTT
TFF
FTT
FFT

This truth table often surprises people. The statement does not claim that causes ; it only says the truth of cannot occur without .

Equivalent readings of :

  • implies

  • If , then

  • only if

  • is sufficient for

  • is necessary for

Biconditional

Meaning: " if and only if ." True when both statements have the same truth value.

TTT
TFF
FTF
FFT

Exclusive or

The exclusive or is often written as .

It is true when exactly one of and is true.


Logical equivalence and algebra of propositions

Two propositions are logically equivalent if they have the same truth table.

Write this as:

Equivalent formulas can replace each other in proofs and simplification.

Core equivalences

Double negation

De Morgan's laws

Implication

Contrapositive

Biconditional

Distributive laws

Identity and domination

Idempotent laws

Complement laws

Tautology, contradiction, contingency

  • A tautology is always true.

  • A contradiction is always false.

  • A contingency is sometimes true and sometimes false.

Examples:

is a tautology.

is a contradiction.

Common implication patterns

  • Converse of is .

  • Inverse is .

  • Contrapositive is .

Only the contrapositive is logically equivalent to the original implication.


Predicates and quantifiers

Predicate logic extends propositional logic by allowing statements about objects.

A predicate is a statement with variables, such as:

When a variable is assigned a value, the predicate becomes a proposition.

Quantifiers

Universal quantifier

Meaning: "for all , holds."

Existential quantifier

Meaning: "there exists at least one such that holds."

Negating quantifiers

Negation flips the quantifier and negates the predicate:

These are among the most important rules in logic.

Order matters

In general,

is not equivalent to

Example:

  • For every person, there exists a friend.

  • There exists one person who is friend to everyone.

These say different things.

Domain of discourse

The meaning of a quantified statement depends on the domain.

Example:

is true over the real numbers, integers, and natural numbers, but not meaningful without a specified domain.


Rules of inference

Rules of inference describe valid argument forms.

Propositional rules

Modus ponens

Modus tollens

Hypothetical syllogism

Disjunctive syllogism

Addition

Simplification

Conjunction

Resolution

Quantifier rules

Universal instantiation

From , infer for any specific in the domain.

Universal generalization

If is true for an arbitrary element , infer .

Existential instantiation

From , introduce a new symbol with .

Existential generalization

From , infer .

Valid argument form

An argument is valid when no case exists where all premises are true and the conclusion is false.

To test validity, you can use:

  • Truth tables for small propositional arguments

  • Equivalence transformations

  • Formal proof rules

  • Counterexamples


Proof methods

Direct proof

Assume the hypotheses and derive the conclusion step by step.

Typical structure:

  1. Assume the given premises.

  2. Apply definitions and known theorems.

  3. Reach the desired statement.

Example target:

Assume and show .

Contrapositive proof

To prove , prove the equivalent statement:

This is often useful when the negated conclusion is easier to work with.

Proof by contradiction

Assume the statement is false and derive a contradiction.

To prove , assume and show an impossibility.

This method is powerful, but do not confuse a contradiction inside the proof with a contradiction in the actual statement.

Proof by cases

Split into exhaustive cases and prove the conclusion in each one.

If is known, prove the result separately under and under .

Biconditional proofs

To prove , prove both directions:

Counterexample

To disprove a universal statement, it is enough to find one counterexample.

Example:

To disprove "all even numbers are prime," use .


Normal forms and simplification

Normal forms standardize formulas so they can be compared or processed systematically.

Conjunctive normal form

A formula is in conjunctive normal form (CNF) if it is an AND of OR-clauses.

Example:

Disjunctive normal form

A formula is in disjunctive normal form (DNF) if it is an OR of AND-terms.

Example:

How to simplify a formula

A reliable workflow is:

  1. Remove biconditionals.

  2. Replace implications using .

  3. Push negations inward with De Morgan's laws.

  4. Use distributive laws to reach CNF or DNF.

  5. Cancel tautological or contradictory pieces.

Example transformation

Convert

into an equivalent formula.

Solution:

Tautology checking

A formula is a tautology if its negation is unsatisfiable.

Equivalently, to test whether is always true, check whether can ever be true.


Logic and sets

Set operations mirror logical connectives closely.

Let and be subsets of a universe .

LogicSets
or

De Morgan for sets

These are direct analogues of the logical laws.

Subset proof pattern

To prove :

  1. Let be arbitrary.

  2. Show .

  3. Conclude .

This is the set-theoretic version of a universal implication proof.


Satisfiability and consistency

A formula is satisfiable if there exists at least one assignment of truth values that makes it true.

A set of formulas is consistent if all of them can be true at the same time.

Relationships

  • Unsatisfiable means no assignment makes the formula true.

  • A contradiction is unsatisfiable.

  • A tautology is true under every assignment.

Why satisfiability matters

Satisfiability is central in:

  • Automated theorem proving

  • Circuit design

  • Constraint solving

  • Verification of software and hardware

Quick checks

A formula is unsatisfiable if you can derive both and from it, or if every simplification path leads to contradiction.

A formula may be satisfiable even when it is not a tautology.

Example:

is satisfiable but not a tautology.


Common pitfalls

Confusing implication with causation

is a logical relation, not a causal claim.

Mixing up converse and contrapositive

Only the contrapositive is equivalent to the original implication.

Negating quantifiers incorrectly

Remember:

not .

Ignoring the domain

A quantified statement can change meaning if the domain changes.

Using existential instantiation carelessly

When you instantiate , the symbol you introduce must represent an arbitrary witness, not a special value you are free to reuse later.

Treating "or" as exclusive by default

In mathematics, is usually inclusive unless explicitly stated otherwise.

Assuming converse laws

From , you cannot conclude .


Problem-solving workflow

When solving a logic problem, work in this order:

  1. Identify whether the task is propositional logic, predicate logic, set logic, or proof construction.

  2. Rewrite the statement into symbols if helpful.

  3. Expand definitions of implication, biconditional, and quantifiers.

  4. Simplify using equivalence laws.

  5. Choose the right proof method.

  6. Check edge cases and counterexamples.

  7. Translate the result back into plain language.

Workflow examples

To prove an implication

If the goal is :

  • Assume .

  • Derive .

  • Or prove .

To disprove a universal claim

If the claim is :

  • Find one such that .

To prove equality of sets

Show both inclusions:

To negate a statement

Apply negation rules mechanically:

  • Flip to

  • Flip to

  • Apply De Morgan's laws

  • Negate the innermost predicate


Formula sheet

Core equivalences

Quantifiers

Standard inference rules

Set analogues

Quick reminders

  • A universal statement is disproved by one counterexample.

  • A biconditional needs both directions.

  • The contrapositive preserves meaning; the converse does not.

  • Nested quantifiers are order-sensitive.

  • Always state the domain when quantifiers are involved.

Sources