Proposition Logic
Proposition
<aside>
💡 Proposition: a sentence (or statement) that have a truth value (either True/False)
- Anything that can be put in an if(…) is a proposition
</aside>
$\forall$ : forall
$\exists$: there exists
Variable
<aside>
💡 Variable can be aused to represent a proposition
</aside>
- Examples:
- $p:\text{It is raining} \\ q: \text{I am sick}$
Logial Operators
<aside>
💡 Logical operators are used to combine variables into a proposition
</aside>
- Negation
- $\neg \ p$ denotes the proposition “not p”
- Conjuction
- $p \wedge q$ denotes the proposition “p and q”
- Disjunction
- $p\vee q$ denotes the proposition “p or q”
- Implication
- ‣
- $p\to q$ denotes the proposition “if p, then q”
- $p$ is called premise, $q$ is called the consequence
- Explanation:
- Think of $p\to q$ as a “promise”: I promise $q$ if $p$ happen
- The whole statement
- Contrapositive
- ‣
- $\neg p\to \neg q$ is the contrapositive of $q\to p$
- $\neg p\to \neg q$ have same truth value as $q \to p$
- Biconditional
- ‣
- $p\leftrightarrow q$ only true when $p,q$ have same values
- either both p and q are true, or both are false
- $p\leftrightarrow q \equiv (p\to q)\wedge (q\to p)$
- $p\leftrightarrow q$ is essentially a “mutual promise” from both sides
- Promise 1: if $p$ then $q$ ($p\to q)$
- Promise 2: if $q$ then $p$ ($q\to p$)
Proposition classification
<aside>
💡 Propositon (with variables) called
Tautology: when proposition always true
Contradiction: when proposition always false
</aside>
Predicates and Quantifiers
- Example: “___ is blue” or “___ is an integer”
- ___ is the variable
- the latter is the predicate