Search Knowledge

© 2026 LIBREUNI PROJECT

Mathematical Notation and Logic

Mathematical Notation and Logic

Mathematics uses a concise symbolic language to express complex ideas. Understanding this notation is essential for reading and writing formal proofs.

Logical Operators

The building blocks of mathematical logic are propositions and operators:

  • Negation (¬P\neg P): “Not PP“.
  • Conjunction (PQP \land Q): ”PP and QQ“.
  • Disjunction (PQP \lor Q): ”PP or QQ“.
  • Implication (P    QP \implies Q): “If PP, then QQ“.
  • Equivalence (P    QP \iff Q): ”PP if and only if QQ“.
python
1def logical_implication(p, q):
2 # P => Q is equivalent to (not P) or Q
3 return (not p) or q
4 
5print("Truth Table for P => Q")
6print("P | Q | P => Q")
7for p in [True, False]:
8 for q in [True, False]:
9 print(f"{p} | {q} | {logical_implication(p, q)}")

Quantifiers

Quantifiers allow us to make statements about sets of elements:

  • Universal Quantifier (\forall): “For all”.
  • Existential Quantifier (\exists): “There exists”.
python
1numbers = [1, 2, 3, 4, 5]
2 
3# For all x in numbers, x > 0
4all_positive = all(x > 0 for x in numbers)
5print(f"Universal (forall x > 0): {all_positive}")
6 
7# There exists x in numbers such that x is even
8exists_even = any(x % 2 == 0 for x in numbers)
9print(f"Existential (exists x even): {exists_even}")

What is the negation of 'For all x, P(x) is true'?

Set Notation

  • xAx \in A: ”xx is an element of AA“.
  • ABA \subseteq B: ”AA is a subset of BB“.
  • ABA \cap B: Intersection.
  • ABA \cup B: Union.

If A = {1, 2} and B = {2, 3}, what is A intersect B?

Previous Module Propositional Logic
Next Module Number Theory