Loading...
Loading...
Math for CS · Axiom Academy
"For all" — making claims about every element in a domain The symbol is an upside-down "A" — think A for "All." The claim must hold for every single element, with no exceptions. Let the domain be (all real numbers). x\,(x^2 0) — True. Every real number squared is non-negative. x\,(x > 0) — False. Counterexample: x = -1 . x\,(x + 0 = x) — True. Zero is the additive identity for all reals. Unlike existential proofs (find one witness), universal proofs must cover all cases. Common strategies: The key phrase is "let x be arbitrary" — by not choosing a specific value, the argument applies to all values. To show x\, P(x) is false , exhibit a single counterexample . "It's NOT the case that all x satisfy P " means "there EXISTS an x that does NOT satisfy P ." Combined with the existential negation rule, we get a complete picture: Negation always flips the quantifier and negates the predicate . Loop invariants: "For all iterations, this condition holds" — the foundation of correctness proofs Type systems: forall a. a -> a in Haskell means "for all types a , this function works" Testing: array.every(x => x > 0) checks x ,\; x > 0 Assertions: assert all(x > 0 for x in data) in Python SQL: Checking all rows satisfy a condition uses NOT EXISTS ... WHERE NOT x\, P(x) is true only if every domain element satisfies P . Prove it with an arbitrary element argument; disprove it with one counterexample . x\, P(x) x\, P(x) — negation flips the quantifier.
This is the written version of the interactive lesson above. See the full Math for CS course.