From 6ba651c41bd37976fa091af9c3e6800b30b8ae8f Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Sun, 21 Jul 2024 06:16:08 -0600 Subject: [PATCH] Reorganize types of logic and formal systems. --- .../plugins/obsidian-to-anki-plugin/data.json | 23 +- notes/_journal/2024-07-21.md | 11 + notes/_journal/{ => 2024-07}/2024-07-20.md | 0 notes/formal-system/index.md | 279 +++++++ notes/formal-system/logical-system/index.md | 47 ++ .../logical-system}/pred-logic.md | 54 +- .../logical-system/prop-logic.md | 322 ++++++++ .../proof-system}/equiv-trans.md | 506 +++++++++++- notes/formal-system/proof-system/index.md | 71 ++ notes/logic/classical/index.md | 8 + notes/logic/{ => classical}/truth-tables.md | 4 +- notes/logic/index.md | 2 + notes/logic/prop-logic.md | 758 ------------------ notes/ontology/dialetheism.md | 4 +- notes/{logic => programming}/short-circuit.md | 3 +- notes/set/functions.md | 4 +- notes/x86-64/instructions/condition-codes.md | 2 +- 17 files changed, 1276 insertions(+), 822 deletions(-) create mode 100644 notes/_journal/2024-07-21.md rename notes/_journal/{ => 2024-07}/2024-07-20.md (100%) create mode 100644 notes/formal-system/index.md create mode 100644 notes/formal-system/logical-system/index.md rename notes/{logic => formal-system/logical-system}/pred-logic.md (85%) create mode 100644 notes/formal-system/logical-system/prop-logic.md rename notes/{logic => formal-system/proof-system}/equiv-trans.md (69%) create mode 100644 notes/formal-system/proof-system/index.md create mode 100644 notes/logic/classical/index.md rename notes/logic/{ => classical}/truth-tables.md (88%) delete mode 100644 notes/logic/prop-logic.md rename notes/{logic => programming}/short-circuit.md (97%) diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index 6dba2cc..4d8ffaa 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -164,7 +164,7 @@ "journal/2024-02-01.md": "3aa232387d2dc662384976fd116888eb", "journal/2024-02-02.md": "a3b222daee8a50bce4cbac699efc7180", "journal/2024-02-03.md": "c6d411f0e2e964270399dd3a99f48382", - "logic/index.md": "46cdc7a552900e99a7d2d0140971118c", + "logic/index.md": "717099c8fefb416eed7dcf83a2284297", "logic/propositional.md": "1ac07079aff07a7c2cb09daacefbb960", "lua/index.md": "fd3d0b66765f0e9df233e8e02ce33e94", "nix/callPackage.md": "9aeeaa22878434d3c4498cb92cfe230b", @@ -457,7 +457,7 @@ "_journal/2024-05-16.md": "580c7ec61ec56be92fa8d6affcf0a5f6", "_journal/2024-05/2024-05-15.md": "4e6a7e6df32e93f0d8a56bc76613d908", "logic/pred-logic.md": "a709cb45e7554ffc578cba0eb1e86e57", - "logic/prop-logic.md": "daa927c5eb31813fcf21bcb18ba0f1ec", + "logic/prop-logic.md": "e169a413c5f5866d1ea0b7c61e4bedf6", "_journal/2024-05-17.md": "fb880d68077b655ede36d994554f3aba", "_journal/2024-05/2024-05-16.md": "9fdfadc3f9ea6a4418fd0e7066d6b10c", "_journal/2024-05-18.md": "c0b58b28f84b31cea91404f43b0ee40c", @@ -517,7 +517,7 @@ "_journal/2024-06/2024-06-07.md": "c6bfc4c1e5913d23ea7828a23340e7d3", "lambda-calculus/alpha-conversion.md": "007828faf9b4ace5bd30b87a36a90dcf", "lambda-calculus/index.md": "64efe9e4f6036d3f5b4ec0dc8cd3e7b9", - "x86-64/instructions/condition-codes.md": "5524d1c49bb184b336f814194622a0ee", + "x86-64/instructions/condition-codes.md": "67d325298b9b605a59c4855d0c9f2043", "x86-64/instructions/logical.md": "818428b9ef84753920dc61e5c2de9199", "x86-64/instructions/arithmetic.md": "271218d855e7291f119f96e91f582738", "x86-64/instructions/access.md": "c19bc3392cf493fcc9becf46c818cc50", @@ -536,7 +536,7 @@ "_journal/2024-06/2024-06-12.md": "f82dfa74d0def8c3179d3d076f94558e", "_journal/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", "_journal/2024-06/2024-06-13.md": "e2722a00585d94794a089e8035e05728", - "set/functions.md": "b41c04a596a7e711801c32eff9333a3e", + "set/functions.md": "5740a88e79df5fcd8096485954c0a26a", "_journal/2024-06-15.md": "92cb8dc5c98e10832fb70c0e3ab3cec4", "_journal/2024-06/2024-06-14.md": "5d12bc272238ac985a1d35d3d63ea307", "lambda-calculus/beta-reduction.md": "6c9a9f4983b0974e0184acaee7c27a22", @@ -613,13 +613,24 @@ "_journal/2024-07/2024-07-16.md": "149222eab7a7f58993b8e4dc8a3fb884", "_journal/2024-07-18.md": "a9d26ce938228973f07178a15128a681", "_journal/2024-07/2024-07-17.md": "0c816cd6110bdd14d3eac4e5b82510cf", - "ontology/dialetheism.md": "fa71c557744e009a067c68f9650a09b1", + "ontology/dialetheism.md": "56dd05b38519f90c5cab93637978b3b3", "abstract-rewriting-systems/index.md": "b7486b7635cb0d8bafc2a2f095af90fb", "abstract-rewriting-systems/normal-form.md": "2fff9a1d85bca0a2941a54b0084a0309", "_journal/2024-07-19.md": "ced9d4c4759468885d85efa0b87b7823", "_journal/2024-07/2024-07-18.md": "237918b58424435959cbc949d01e7932", "_journal/2024-07-20.md": "d8685729effc374e4ece1e618c2fdad3", - "_journal/2024-07/2024-07-19.md": "e9fe4569f88e1ba9393292bcf092edfc" + "_journal/2024-07/2024-07-19.md": "e9fe4569f88e1ba9393292bcf092edfc", + "_journal/2024-07-21.md": "682ee0ada782dd281d8fd217227e985c", + "_journal/2024-07/2024-07-20.md": "d8685729effc374e4ece1e618c2fdad3", + "logic/classical/index.md": "ee0a4b2bfcfa2cab0880db449cb62df1", + "logic/classical/truth-tables.md": "b739e2824a4a5c26ac446e7c15ce02aa", + "formal-system/proof-system/index.md": "1c95481cbb2e79ae27f6be1869599657", + "formal-system/proof-system/equiv-trans.md": "00f6d209a448ab25acaa3bff7fd5c6b6", + "formal-system/logical-system/index.md": "708bb1547e7343c236068c18da3f5dc0", + "formal-system/logical-system/pred-logic.md": "2524ccc09561bc219dab3f32010a0161", + "formal-system/logical-system/prop-logic.md": "b61ce051795d5a951c763b928ec5cea8", + "formal-system/index.md": "3d31c99bffdcb05de9f2e32ac6319952", + "programming/short-circuit.md": "c256ced42dc3b493aff5a356e5383b6e" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2024-07-21.md b/notes/_journal/2024-07-21.md new file mode 100644 index 0000000..5001192 --- /dev/null +++ b/notes/_journal/2024-07-21.md @@ -0,0 +1,11 @@ +--- +title: "2024-07-21" +--- + +- [ ] Anki Flashcards +- [ ] KoL +- [ ] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Begin classification of [[formal-system/index|formal systems]] under different types of logic. \ No newline at end of file diff --git a/notes/_journal/2024-07-20.md b/notes/_journal/2024-07/2024-07-20.md similarity index 100% rename from notes/_journal/2024-07-20.md rename to notes/_journal/2024-07/2024-07-20.md diff --git a/notes/formal-system/index.md b/notes/formal-system/index.md new file mode 100644 index 0000000..c7e330e --- /dev/null +++ b/notes/formal-system/index.md @@ -0,0 +1,279 @@ +--- +title: Logic +TARGET DECK: Obsidian::STEM +FILE TAGS: formal-system +tags: + - formal-system + - logic +--- + +## Overview + +A **formal system** is an abstract structure and formalization of an axiomatic system used for inferring theorems from axioms by a set of inference rules. It consists of two components: a **formal language** and a **deductive system**. + +%%ANKI +Basic +How are conclusions drawn in deductive reasoning? +Back: From valid inferences on a set of premises. +Reference: “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). + +END%% + +%%ANKI +Basic +How are conclusions drawn in inductive reasoning? +Back: By generalizing from some body of observations. +Reference: “Inductive Reasoning,” in _Wikipedia_, May 6, 2024, [https://en.wikipedia.org/w/index.php?title=Inductive_reasoning](https://en.wikipedia.org/w/index.php?title=Inductive_reasoning&oldid=1222455892). + +END%% + +%%ANKI +Basic +Do formal systems employ inductive or deductive reasoning? +Back: Deductive reasoning. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +Is the study of logic concerned with deductive or inductive reasoning? +Back: Deductive reasoning. +Reference: “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). + +END%% + +%%ANKI +Basic +Which of deductive or inductive reasoning can provide "genuinely new information"? +Back: Inductive reasoning. +Reference: “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). + +END%% + +%%ANKI +Basic +What does it mean for inductive reasoning to provide "genuinely new information"? +Back: Information not found in the premises can be produced. +Reference: “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). + +END%% + +%%ANKI +Basic +Which of deductive or inductive reasoning is considered more formal? +Back: Deductive reasoning. +Reference: “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). + +END%% + +%%ANKI +Basic +What two parts make up a formal system? +Back: A formal language and a deductive system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +Which of a formal system or a deductive system is defined in terms of the other? +Back: The formal system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What does a formal system specify that a deductive system does not? +Back: A formal language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What does a formal system specify that a formal language does not? +Back: A deductive system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +The term "formal system" can be seen as a portmanteau of what other terms? +Back: A **formal** language and a deductive **system**. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +A formal language comprises of an **alphabet** and a **formal grammar**. The grammer has associated rules describing how symbols of the alphabet are manipulated to create **well-formed formulas** (WFFs). The **syntax** of a language describes the set of possible expressions that are valid utterances. The **semantics** of a language describe what these valid utterances actually mean. + +%%ANKI +Basic +What two parts make up a formal language? +Back: An alphabet and a formal grammer. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What is the purpose of a formal language's alphabet? +Back: It defines the set of valid symbols used in the language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What is the purpose of a formal language's grammar? +Back: It defines how to construct well-formed formulas from the alphabet. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What is WFF an acronym for? +Back: **W**-ell-**f**ormed **f**ormula. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +Is the following a WFF of propositional logic? +Back: $(a \Rightarrow b) \Leftrightarrow c$ +Back: Yes. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). +Tags: formal-system::propositional + +END%% + +%%ANKI +Basic +Is the following a WFF of propositional logic? +Back: $(a \Rightarrow b( \Leftrightarrow c$ +Back: No. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). +Tags: formal-system::propositional + +END%% + +%%ANKI +Basic +Is the following a WFF of propositional logic? +Back: $\forall x, x \in A \Rightarrow x = y$ +Back: No. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). +Tags: logic::propositional logic::predicate +END%% + +%%ANKI +Basic +With respect to formal languages, what is syntax? +Back: The set of possible expressions that are valid in the language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +With respect to formal languages, what is semantics? +Back: What valid expressions of the language mean. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +A deductive system can be further subcategorized as either a [[formal-system/proof-system/index|proof system]] or a [[formal-system/logical-system/index|logical system]]. In both cases, the general principle is to define a (possibly empty) set of **axioms** alongside a set of **inference rules** that together can be used to infer **theorems**. + +%%ANKI +Basic +How are deductive systems further subcategorized? +Back: As proof systems and logical systems. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +Axioms belong to which of the two parts of a formal system? +Back: The deductive system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +Inference rules belong to which of the two parts of a formal system? +Back: The deductive system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +An alphabet belong to which of the two parts of a formal system? +Back: The formal language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +A formal grammar belong to which of the two parts of a formal system? +Back: The formal language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +A deductive system derives {1:theorems} using {1:inference rules} starting with {1:axioms}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +{1:Proof} systems are {2:syntactic} whereas {2:logical} systems are {1:syntactic and semantic}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +A {metalanguage} refers to the {language used to talk about a formal system}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +An {object language} refers to the {formal language found in a formal system}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +In a discussion of propositional logic, what is the metalanguage? +Back: English (or whatever natural language is being used). +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +In a discussion of propositional logic, what is the object language? +Back: The formal language of propositional logic. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +## Bibliography + +* “Deductive Reasoning,” in _Wikipedia_, June 16, 2024, [https://en.wikipedia.org/w/index.php?title=Deductive_reasoning](https://en.wikipedia.org/w/index.php?title=Deductive_reasoning&oldid=1229329170). +* “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). +* “Inductive Reasoning,” in _Wikipedia_, May 6, 2024, [https://en.wikipedia.org/w/index.php?title=Inductive_reasoning](https://en.wikipedia.org/w/index.php?title=Inductive_reasoning&oldid=1222455892). \ No newline at end of file diff --git a/notes/formal-system/logical-system/index.md b/notes/formal-system/logical-system/index.md new file mode 100644 index 0000000..9fdbab8 --- /dev/null +++ b/notes/formal-system/logical-system/index.md @@ -0,0 +1,47 @@ +--- +title: Logical Systems +TARGET DECK: Obsidian::STEM +FILE TAGS: formal-system +tags: + - formal-system + - logic +--- + +## Overview + +A deductive system found in certain formal systems. Logical systems are syntactic and semantic. The syntax of WFFs found in these systems are interpretable and often defined recursively (e.g. propositional and predicate logic). + +%%ANKI +Basic +*Why* do we say formal systems using logical systems are semantic? +Back: An interpretation is usually attached to the WFFs of the language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +Logical systems are {syntactic} and {semantic}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What kind of deductive system is propositional logic usually categorized as? +Back: A logical system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What kind of deductive system is predicate logic usually categorized as? +Back: A logical system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +## Bibliography + +* “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). \ No newline at end of file diff --git a/notes/logic/pred-logic.md b/notes/formal-system/logical-system/pred-logic.md similarity index 85% rename from notes/logic/pred-logic.md rename to notes/formal-system/logical-system/pred-logic.md index adf167f..76d248e 100644 --- a/notes/logic/pred-logic.md +++ b/notes/formal-system/logical-system/pred-logic.md @@ -1,7 +1,7 @@ --- title: Predicate Logic TARGET DECK: Obsidian::STEM -FILE TAGS: logic::predicate +FILE TAGS: formal-system::predicate tags: - logic - predicate @@ -9,7 +9,7 @@ tags: ## Overview -A branch of logic that uses quantified variables over non-logical objects. A **predicate** is a sentence with some number of free variables. A predicate with free variables "plugged in" is a [[prop-logic|proposition]]. +**Predicate logic** is a logical system that uses quantified variables over non-logical objects. A **predicate** is a sentence with some number of free variables. A predicate with free variables "plugged in" is a [[prop-logic|proposition]]. %%ANKI Cloze @@ -70,7 +70,9 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -* **Existential quantification** ($\exists$) asserts the existence of at least one member in a set satisfying a property. +### Existentials + +**Existential quantification** ($\exists$) asserts the existence of at least one member in a set satisfying a property. %%ANKI Basic @@ -112,7 +114,9 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -* **Universal quantification** ($\forall$) asserts that every member of a set satisfies a property. +### Universals + +**Universal quantification** ($\forall$) asserts that every member of a set satisfies a property. %%ANKI Basic @@ -167,7 +171,9 @@ Back: $\neg \forall x : S, \neg P(x)$ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. END%% -* **Counting quantification** ($\exists^{=k}$ or $\exists^{\geq k}$) asserts that (at least) $k$ (say) members of a set satisfy a property. +### Counting + +**Counting quantification** ($\exists^{=k}$ or $\exists^{\geq k}$) asserts that (at least) $k$ (say) members of a set satisfy a property. %%ANKI Basic @@ -245,7 +251,7 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre END%% -### Identifiers +## Identifiers Identifiers are said to be **bound** if they are parameters to a quantifier. Identifiers that are not bound are said to be **free**. A first-order logic formula is said to be in **prenex normal form** (PNF) if written in two parts: the first consisting of quantifiers and bound variables (the **prefix**), and the second consisting of no quantifiers (the **matrix**). @@ -305,42 +311,6 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -## As Sets - -A **state** is a function that maps identifiers to values. A predicate can be equivalently seen as a representation of the set of states in which it is true. - -%%ANKI -Basic -Is $(i \geq 0)$ well-defined in $\{(i, -10)\}$? -Back: Yes. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Is $(i \geq 0)$ well-defined in $\{(j, -10)\}$? -Back: No. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What predicate represents states $\{(i, 0), (i, 2), (i, 4), \ldots\}$? -Back: $i \geq 0$ is even. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is sloppy about phrase "the states in $i + j = 0$"? -Back: $i + j = 0$ is not a set but a representation of a set (of states). -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - ## Bibliography * Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. diff --git a/notes/formal-system/logical-system/prop-logic.md b/notes/formal-system/logical-system/prop-logic.md new file mode 100644 index 0000000..94784a2 --- /dev/null +++ b/notes/formal-system/logical-system/prop-logic.md @@ -0,0 +1,322 @@ +--- +title: Propositional Logic +TARGET DECK: Obsidian::STEM +FILE TAGS: formal-system::propositional +tags: + - logic + - propositional +--- + +## Overview + +**Propositional logic** is a logical system derived from negation ($\neg$), conjunction ($\land$), disjunction ($\lor$), implication ($\Rightarrow$), and biconditionals ($\Leftrightarrow$). A **proposition** is a sentence that can be assigned a truth value. + +%%ANKI +Cloze +{Propositional} logic is also known as {zeroth}-order logic. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What are the basic propositional logical operators? +Back: $\neg$, $\land$, $\lor$, $\Rightarrow$, and $\Leftrightarrow$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is a proposition? +Back: A declarative sentence that can be assigned a truth value. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What two categories do propositions fall within? +Back: Atomic and molecular propositions. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What is an atomic proposition? +Back: One that cannot be broken up into smaller propositions. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What is a molecular proposition? +Back: One that can be broken up into smaller propositions. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Cloze +A {molecular} proposition can be broken up into {atomic} propositions. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What distinguishes a sentence from a proposition? +Back: The latter has an associated truth value. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What are constant propositions? +Back: Propositions that contain only constants as operands. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How does Lean define propositional equality? +Back: Expressions `a` and `b` are propositionally equal iff `a = b` is true. +Reference: Avigad, Jeremy. ‘Theorem Proving in Lean’, n.d. +Tags: lean + +END%% + +%%ANKI +Basic +How does Lean define `propext`? +Back: +```lean +axiom propext {a b : Prop} : (a ↔ b) → (a = b) +``` +Reference: Avigad, Jeremy. ‘Theorem Proving in Lean’, n.d. +Tags: lean + +END%% + +## Implication + +Implication is denoted as $\Rightarrow$. In classical logic, it has truth table $$\begin{array}{c|c|c} p & q & p \Rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \end{array}$$ + +Implication has a few "equivalent" English expressions that are commonly used. +Given propositions $P$ and $Q$, we have the following equivalences: + +* $P$ if $Q$ +* $P$ only if $Q$ +* $P$ is necessary for $Q$ +* $P$ is sufficient for $Q$ + +%%ANKI +Basic +What name is given to operand $a$ in $a \Rightarrow b$? +Back: The antecedent. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What name is given to operand $b$ in $a \Rightarrow b$? +Back: The consequent. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How do you write "$P$ if $Q$" in propositional logic? +Back: $Q \Rightarrow P$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ if $Q$" using "necessary"? +Back: $P$ is necessary for $Q$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ if $Q$" using "sufficient"? +Back: $Q$ is sufficient for $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ only if $Q$" in propositional logic? +Back: $P \Rightarrow Q$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ only if $Q$" using "necessary"? +Back: $Q$ is necessary for $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ only if $Q$" using "sufficient"? +Back: $P$ is sufficient for $Q$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is necessary for $Q$" in propositional logic? +Back: $Q \Rightarrow P$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is necessary for $Q$" using "if"? +Back: $P$ if $Q$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is necessary for $Q$" using "only if"? +Back: $Q$ only if $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is sufficient for $Q$" in propositional logic? +Back: $P \Rightarrow Q$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is sufficient for $Q$" using "if"? +Back: $Q$ if $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is sufficient for $Q$" using "only if"? +Back: $P$ only if $Q$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ if $Q$" using "only if"? +Back: $Q$ only if $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is sufficient for $Q$" using "necessary"? +Back: $Q$ is necessary for $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ only if $Q$" using "if"? +Back: $Q$ if $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +How do you write "$P$ is necessary for $Q$" using "sufficient"? +Back: $Q$ is sufficient for $P$. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +Which logical operator maps to "if and only if"? +Back: $\Leftrightarrow$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +Which logical operator maps to "necessary and sufficient"? +Back: $\Leftrightarrow$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What is the converse of $P \Rightarrow Q$? +Back: $Q \Rightarrow P$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +When is implication equivalent to its converse? +Back: It's indeterminate. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +What is the contrapositive of $P \Rightarrow Q$? +Back: $\neg Q \Rightarrow \neg P$ +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +When is implication equivalent to its contrapositive? +Back: They are always equivalent. +Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). + +END%% + +%%ANKI +Basic +Given propositions $p$ and $q$, $p \Leftrightarrow q$ is equivalent to the conjunction of what two expressions? +Back: $p \Rightarrow q$ and $q \Rightarrow p$. +Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +## Bibliography + +* Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. +* “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). +* * Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). +* “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). \ No newline at end of file diff --git a/notes/logic/equiv-trans.md b/notes/formal-system/proof-system/equiv-trans.md similarity index 69% rename from notes/logic/equiv-trans.md rename to notes/formal-system/proof-system/equiv-trans.md index 56d61ee..e2b8130 100644 --- a/notes/logic/equiv-trans.md +++ b/notes/formal-system/proof-system/equiv-trans.md @@ -1,7 +1,7 @@ --- title: Equivalence Transformation TARGET DECK: Obsidian::STEM -FILE TAGS: programming::equiv-trans +FILE TAGS: formal-system::equiv-trans tags: - equiv-trans - logic @@ -10,9 +10,7 @@ tags: ## Overview -**Equivalence-transformation** refers to a class of calculi for [[prop-logic|propositional logic]] derived from negation ($\neg$), conjunction ($\land$), disjunction ($\lor$), implication ($\Rightarrow$), and equality ($=$). - -Gries covers two in "The Science of Programming": a system of evaluation and a formal system. The system of evaluation mirrors how a computer processes instructions, at least in an abstract sense. The formal system serves as a theoretical framework for reasoning about propositions and their transformations without resorting to "lower-level" operations like substitution. +**Equivalence-transformation** is a [[formal-system/index|formal-system]] based on classical truth-functional [[pred-logic|predicate logic]] developed by David Gries. It is the foundation upon which [[pred-trans|predicate transformers]] are based. %%ANKI Basic @@ -46,9 +44,7 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -## Equivalence Schemas - -A proposition is said to be a **tautology** if it evaluates to $T$ in every state it is well-defined in. We say propositions $E1$ and $E2$ are **equivalent** if $E1 = E2$ is a tautology. In this case, we say $E1 = E2$ is an **equivalence**. +A [[prop-logic|proposition]] is said to be a **tautology** if it evaluates to $T$ in every state it is well-defined in. We say propositions $E1$ and $E2$ are **equivalent** if $E1 = E2$ is a tautology. In this case, we say $E1 = E2$ is an **equivalence**. %%ANKI Basic @@ -114,7 +110,299 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% -## Equivalence Rules +## Axioms + +### Commutativity + +For propositions $E1$ and $E2$: + +* $(E1 \land E2) = (E2 \land E1)$ +* $(E1 \lor E2) = (E2 \lor E1)$ +* $(E1 = E2) = (E2 = E1)$ + +%%ANKI +Basic +Which of the basic logical operators do the commutative laws apply to? +Back: $\land$, $\lor$, and $=$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What do the commutative laws allow us to do? +Back: Reorder operands. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the commutative law of e.g. $\land$? +Back: $E1 \land E2 = E2 \land E1$ + +END%% + +### Associativity + +For propositions $E1$, $E2$, and $E3$: + +* $E1 \land (E2 \land E3) = (E1 \land E2) \land E3$ +* $E1 \lor (E2 \lor E3) = (E1 \lor E2) \lor E3$ + +%%ANKI +Basic +Which of the basic logical operators do the associative laws apply to? +Back: $\land$ and $\lor$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What do the associative laws allow us to do? +Back: Remove parentheses. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the associative law of e.g. $\land$? +Back: $E1 \land (E2 \land E3) = (E1 \land E2) \land E3$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +### Distributivity + +For propositions $E1$, $E2$, and $E3$: + +* $E1 \lor (E2 \land E3) = (E1 \lor E2) \land (E1 \lor E3)$ +* $E1 \land (E2 \lor E3) = (E1 \land E2) \lor (E1 \land E3)$ + +%%ANKI +Basic +Which of the basic logical operators do the distributive laws apply to? +Back: $\land$ and $\lor$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What do the distributive laws allow us to do? +Back: "Factor" propositions. +Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the distributive law of e.g. $\land$ over $\lor$? +Back: $E1 \land (E2 \lor E3) = (E1 \land E2) \lor (E1 \land E3)$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +### De Morgan's + +For propositions $E1$ and $E2$: + +* $\neg (E1 \land E2) = \neg E1 \lor \neg E2$ +* $\neg (E1 \lor E2) = \neg E1 \land \neg E2$ + +%%ANKI +Basic +Which of the basic logical operators do De Morgan's laws involve? +Back: $\neg$, $\land$, and $\lor$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How is De Morgan's law (distributing $\land$) expressed as an equivalence? +Back: $\neg (E1 \land E2) = \neg E1 \lor \neg E2$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +### Law of Negation + +For any proposition $E1$, it follows that $\neg (\neg E1) = E1$. + +%%ANKI +Basic +How is the law of negation expressed as an equivalence? +Back: $\neg (\neg E1) = E1$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +### Law of Excluded Middle + +For any proposition $E1$, it follows that $E1 \lor \neg E1 = T$. + +%%ANKI +Basic +Which of the basic logical operators does the law of excluded middle involve? +Back: $\lor$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How is the law of excluded middle expressed as an equivalence? +Back: $E1 \lor \neg E1 = T$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +"This sentence is false" questions which classical principle? +Back: The law of excluded middle. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +### Law of Contradiction + +For any proposition $E1$, it follows that $E1 \land \neg E1 = F$. + +%%ANKI +Basic +Which of the basic logical operators does the law of contradiction involve? +Back: $\land$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How is the law of contradiction expressed as an equivalence? +Back: $E1 \land \neg E1 = F$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Cloze +The law of {1:excluded middle} is to {2:$\lor$} whereas the law of {2:contradiction} is to {1:$\land$}. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What does the principle of explosion state? +Back: That any statement can be proven from a contradiction. +Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). + +END%% + +%%ANKI +Basic +How is the principle of explosion stated in first-order logic? +Back: $\forall P, F \Rightarrow P$ +Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). + +END%% + +%%ANKI +Basic +What does the law of contradiction say? +Back: For any proposition $P$, it holds that $\neg (P \land \neg P)$. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How does the principle of explosion relate to the law of contradiction? +Back: If a contradiction could be proven, then anything can be proven. +Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). + +END%% + +%%ANKI +Basic +Suppose $P$ and $\neg P$. Show schematically how to use the principle of explosion to prove $Q$. +Back: $$\begin{align*} P \\ \neg P \\ P \lor Q \\ \hline Q \end{align*}$$Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). + +END%% + +%%ANKI +Cloze +The law of {contradiction} and law of {excluded middle} create a dichotomy in "logical space". +Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). + +END%% + +%%ANKI +Basic +Which property of partitions is analagous to the law of contradiction on "logical space"? +Back: Disjointedness. +Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). + +END%% + +%%ANKI +Basic +Which property of partitions is analagous to the law of excluded middle on "logical space"? +Back: Exhaustiveness. +Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). + +END%% + +%%ANKI +Cloze +The law of {1:contradiction} is to "{2:mutually exclusive}" whereas the law of {2:excluded middle} is "{1:jointly exhaustive}". +Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). + +END%% + +%%ANKI +Basic +Which logical law proves equivalence of the law of contradiction and excluded middle? +Back: De Morgan's law. +Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). + +END%% + +### Law of Implication + +For any propositions $E1$ and $E2$, it follows that $E1 \Rightarrow E2 = \neg E1 \lor E2$. + +### Law of Equality + +For any propositions $E1$ and $E2$, it follows that $(E1 = E2) = (E1 \Rightarrow E2) \land (E2 \Rightarrow E1)$. + +### Law of Or-Simplification + +For any propositions $E1$ and $E2$, it follows that: + +* $E1 \lor E1 = E1$ +* $E1 \lor T = T$ +* $E1 \lor F = E1$ +* $E1 \lor (E1 \land E2) = E1$ + +### Law of And-Simplification + +For any propositions $E1$ and $E2$, it follows that: + +* $E1 \land E1 = E1$ +* $E1 \land T = E1$ +* $E1 \land F = F$ +* $E1 \land (E1 \lor E2) = E1$ + +### Law of Identity + +For any proposition $E1$, $E1 = E1$. + +## Inference Rules * Rule of Substitution * Let $P(r)$ be a predicate and $E1 = E2$ be an equivalence. Then $P(E1) = P(E2)$ is an equivalence. @@ -1081,6 +1369,208 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% +## States + +A **state** is a function that maps identifiers to $T$ or $F$. A proposition can be equivalently seen as a representation of the set of states in which it is true. + +%%ANKI +Basic +What is a state? +Back: A function mapping identifiers to values. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Is $(b \land c)$ well-defined in $\{\langle b, T \rangle, \langle c, F \rangle\}$? +Back: Yes. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Is $(b \lor d)$ well-defined in $\{\langle b, T \rangle, \langle c, F \rangle\}$? +Back: No. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +A proposition is well-defined with respect to what? +Back: A state to evaluate against. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What proposition represents states $\{(b, T), (c, T)\}$ and $\{(b, F), (c, F)\}$? +Back: $(b \land c) \lor (\neg b \land \neg c)$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What set of states does proposition $a \land b$ represent? +Back: $\{\{\langle a, T \rangle, \langle b, T \rangle\}\}$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What set of states does proposition $a \lor b$ represent? +Back: $\{\{\langle a, T \rangle, \langle b, T \rangle\}, \{\langle a, T \rangle, \langle b, F \rangle\}, \{\langle a, F \rangle, \langle b, T \rangle\}\}$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is sloppy about phrase "the states in $b \lor \neg c$"? +Back: $b \lor \neg c$ is not a set but a representation of a set (of states). +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the weakest proposition? +Back: $T$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What set of states does $T$ represent? +Back: The set of all states. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the strongest proposition? +Back: $F$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What set of states does $F$ represent? +Back: The set of no states. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What does a proposition *represent*? +Back: The set of states in which it is true. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +When is $p$ stronger than $q$? +Back: When $p \Rightarrow q$. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +If $p \Rightarrow q$, which of $p$ or $q$ is considered stronger? +Back: $p$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +When is $p$ weaker than $q$? +Back: When $q \Rightarrow p$. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +If $p \Rightarrow q$, which of $p$ or $q$ is considered weaker? +Back: $q$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Why is $b \land c$ stronger than $b \lor c$? +Back: The former represents a subset of the states the latter represents. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Given sets $a$ and $b$, $a = b$ is equivalent to the conjunction of what two expressions? +Back: $a \subseteq b$ and $b \subseteq a$. +Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Cloze +{$a \Rightarrow b$} is to propositional logic as {$a \subseteq b$} is to sets. +Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Cloze +{$a \Leftrightarrow b$} is to propositional logic as {$a = b$} is to sets. +Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Is $(i \geq 0)$ well-defined in $\{(i, -10)\}$? +Back: Yes. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Is $(i \geq 0)$ well-defined in $\{(j, -10)\}$? +Back: No. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What predicate represents states $\{(i, 0), (i, 2), (i, 4), \ldots\}$? +Back: $i \geq 0$ is even. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is sloppy about phrase "the states in $i + j = 0$"? +Back: $i + j = 0$ is not a set but a representation of a set (of states). +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + ## Bibliography * Avigad, Jeremy. ‘Theorem Proving in Lean’, n.d. diff --git a/notes/formal-system/proof-system/index.md b/notes/formal-system/proof-system/index.md new file mode 100644 index 0000000..3a9304c --- /dev/null +++ b/notes/formal-system/proof-system/index.md @@ -0,0 +1,71 @@ +--- +title: Proof Systems +TARGET DECK: Obsidian::STEM +FILE TAGS: formal-system +tags: + - formal-system + - logic +--- + +## Overview + +A deductive system found in certain formal systems. Proof systems are syntactic in nature. Proofs are sequences of WFFs, each of which are entailed from previous ones in the sequence. A theorem is then the last WFF in any valid sequence of WFFs. + +%%ANKI +Basic +*Why* do we say formal systems using proof systems are purely syntactic? +Back: No meaning is attached to the WFFs of the formal language. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Cloze +Proof systems are {syntactic}, not {semantic}. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +How is it purely syntactic proof systems can produce theorems? +Back: Inference rules define how to produce theorems from sequences of WFFs. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +What kind of deductive system is natural deduction usually categorized as? +Back: A proof system. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +In a proof system, a proof is used to produce what? +Back: A theorem. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +In a proof system, a proof is a sequence of what? +Back: Well-formed formulas. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +%%ANKI +Basic +In a proof system, how are WFFs produced from one another? +Back: Via inference rules. +Reference: “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). + +END%% + +## Bibliography + +* “Formal System,” in _Wikipedia_, May 10, 2024, [https://en.wikipedia.org/w/index.php?title=Formal_system](https://en.wikipedia.org/w/index.php?title=Formal_system&oldid=1223254138). \ No newline at end of file diff --git a/notes/logic/classical/index.md b/notes/logic/classical/index.md new file mode 100644 index 0000000..965fad5 --- /dev/null +++ b/notes/logic/classical/index.md @@ -0,0 +1,8 @@ +--- +title: Classical Logic +TARGET DECK: Obsidian::STEM +FILE TAGS: logic::classical +tags: + - classical + - logic +--- diff --git a/notes/logic/truth-tables.md b/notes/logic/classical/truth-tables.md similarity index 88% rename from notes/logic/truth-tables.md rename to notes/logic/classical/truth-tables.md index 15d7471..3e759ce 100644 --- a/notes/logic/truth-tables.md +++ b/notes/logic/classical/truth-tables.md @@ -1,14 +1,14 @@ --- title: Truth Tables TARGET DECK: Obsidian::STEM -FILE TAGS: logic +FILE TAGS: logic::classical tags: - logic --- ## Overview -Every proposition can be written in **disjunctive normal form** (DNF) and **conjunctive normal form** (CNF). This is evident with the use of truth tables. To write a proposition in DNF, write its corresponding truth table and $\lor$ each row that evaluates to $T$. To write the same proposition in CNF, apply $\lor$ to each row that evaluates to $F$ and negate it. +In classical logic, every [[prop-logic|proposition]] can be written in **disjunctive normal form** (DNF) and **conjunctive normal form** (CNF). This is evident with the use of truth tables. To write a proposition in DNF, write its corresponding truth table and $\lor$ each row that evaluates to $T$. To write the same proposition in CNF, apply $\lor$ to each row that evaluates to $F$ and negate it. $$\neg (a \Rightarrow b) \Leftrightarrow c$$ diff --git a/notes/logic/index.md b/notes/logic/index.md index 20ed7a5..0d2f6d8 100644 --- a/notes/logic/index.md +++ b/notes/logic/index.md @@ -1,5 +1,7 @@ --- title: Logic +TARGET DECK: Obsidian::STEM +FILE TAGS: logic tags: - logic --- diff --git a/notes/logic/prop-logic.md b/notes/logic/prop-logic.md deleted file mode 100644 index 861e115..0000000 --- a/notes/logic/prop-logic.md +++ /dev/null @@ -1,758 +0,0 @@ ---- -title: Propositional Logic -TARGET DECK: Obsidian::STEM -FILE TAGS: logic::propositional -tags: - - logic - - propositional ---- - -## Overview - -A branch of logic derived from negation ($\neg$), conjunction ($\land$), disjunction ($\lor$), implication ($\Rightarrow$), and biconditionals ($\Leftrightarrow$). A **proposition** is a sentence that can be assigned a truth or false value. - -%%ANKI -Cloze -{Propositional} logic is also known as {zeroth}-order logic. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What are the basic propositional logical operators? -Back: $\neg$, $\land$, $\lor$, $\Rightarrow$, and $\Leftrightarrow$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is a proposition? -Back: A declarative sentence which is either true or false. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What two categories do propositions fall within? -Back: Atomic and molecular propositions. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What is an atomic proposition? -Back: One that cannot be broken up into smaller propositions. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What is a molecular proposition? -Back: One that can be broken up into smaller propositions. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Cloze -A {molecular} proposition can be broken up into {atomic} propositions. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What distinguishes a sentence from a proposition? -Back: The latter has an associated truth value. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What are constant propositions? -Back: Propositions that contain only constants as operands. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How does Lean define propositional equality? -Back: Expressions `a` and `b` are propositionally equal iff `a = b` is true. -Reference: Avigad, Jeremy. ‘Theorem Proving in Lean’, n.d. -Tags: lean - -END%% - -%%ANKI -Basic -How does Lean define `propext`? -Back: -```lean -axiom propext {a b : Prop} : (a ↔ b) → (a = b) -``` -Reference: Avigad, Jeremy. ‘Theorem Proving in Lean’, n.d. -Tags: lean - -END%% - -## Implication - -Implication is denoted as $\Rightarrow$. It has truth table $$\begin{array}{c|c|c} p & q & p \Rightarrow q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \end{array}$$ - -Implication has a few "equivalent" English expressions that are commonly used. -Given propositions $P$ and $Q$, we have the following equivalences: - -* $P$ if $Q$ -* $P$ only if $Q$ -* $P$ is necessary for $Q$ -* $P$ is sufficient for $Q$ - -%%ANKI -Basic -What name is given to operand $a$ in $a \Rightarrow b$? -Back: The antecedent -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What name is given to operand $b$ in $a \Rightarrow b$? -Back: The consequent -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How do you write "$P$ if $Q$" in propositional logic? -Back: $Q \Rightarrow P$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ if $Q$" using "necessary"? -Back: $P$ is necessary for $Q$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ if $Q$" using "sufficient"? -Back: $Q$ is sufficient for $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ only if $Q$" in propositional logic? -Back: $P \Rightarrow Q$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ only if $Q$" using "necessary"? -Back: $Q$ is necessary for $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ only if $Q$" using "sufficient"? -Back: $P$ is sufficient for $Q$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is necessary for $Q$" in propositional logic? -Back: $Q \Rightarrow P$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is necessary for $Q$" using "if"? -Back: $P$ if $Q$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is necessary for $Q$" using "only if"? -Back: $Q$ only if $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is sufficient for $Q$" in propositional logic? -Back: $P \Rightarrow Q$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is sufficient for $Q$" using "if"? -Back: $Q$ if $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is sufficient for $Q$" using "only if"? -Back: $P$ only if $Q$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ if $Q$" using "only if"? -Back: $Q$ only if $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is sufficient for $Q$" using "necessary"? -Back: $Q$ is necessary for $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ only if $Q$" using "if"? -Back: $Q$ if $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -How do you write "$P$ is necessary for $Q$" using "sufficient"? -Back: $Q$ is sufficient for $P$. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -Which logical operator maps to "if and only if"? -Back: $\Leftrightarrow$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -Which logical operator maps to "necessary and sufficient"? -Back: $\Leftrightarrow$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What is the converse of $P \Rightarrow Q$? -Back: $Q \Rightarrow P$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -When is implication equivalent to its converse? -Back: It's indeterminate. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -What is the contrapositive of $P \Rightarrow Q$? -Back: $\neg Q \Rightarrow \neg P$ -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -When is implication equivalent to its contrapositive? -Back: They are always equivalent. -Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). - -END%% - -%%ANKI -Basic -Given propositions $p$ and $q$, $p \Leftrightarrow q$ is equivalent to the conjunction of what two expressions? -Back: $p \Rightarrow q$ and $q \Rightarrow p$. -Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -## Laws - -### Commutativity - -For propositions $E1$ and $E2$: - -* $(E1 \land E2) = (E2 \land E1)$ -* $(E1 \lor E2) = (E2 \lor E1)$ -* $(E1 = E2) = (E2 = E1)$ - -%%ANKI -Basic -Which of the basic logical operators do the commutative laws apply to? -Back: $\land$, $\lor$, and $=$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What do the commutative laws allow us to do? -Back: Reorder operands. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is the commutative law of e.g. $\land$? -Back: $E1 \land E2 = E2 \land E1$ - -END%% - -### Associativity - -For propositions $E1$, $E2$, and $E3$: - -* $E1 \land (E2 \land E3) = (E1 \land E2) \land E3$ -* $E1 \lor (E2 \lor E3) = (E1 \lor E2) \lor E3$ - -%%ANKI -Basic -Which of the basic logical operators do the associative laws apply to? -Back: $\land$ and $\lor$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What do the associative laws allow us to do? -Back: Remove parentheses. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is the associative law of e.g. $\land$? -Back: $E1 \land (E2 \land E3) = (E1 \land E2) \land E3$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -### Distributivity - -For propositions $E1$, $E2$, and $E3$: - -* $E1 \lor (E2 \land E3) = (E1 \lor E2) \land (E1 \lor E3)$ -* $E1 \land (E2 \lor E3) = (E1 \land E2) \lor (E1 \land E3)$ - -%%ANKI -Basic -Which of the basic logical operators do the distributive laws apply to? -Back: $\land$ and $\lor$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What do the distributive laws allow us to do? -Back: "Factor" propositions. -Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is the distributive law of e.g. $\land$ over $\lor$? -Back: $E1 \land (E2 \lor E3) = (E1 \land E2) \lor (E1 \land E3)$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -### De Morgan's - -For propositions $E1$ and $E2$: - -* $\neg (E1 \land E2) = \neg E1 \lor \neg E2$ -* $\neg (E1 \lor E2) = \neg E1 \land \neg E2$ - -%%ANKI -Basic -Which of the basic logical operators do De Morgan's laws involve? -Back: $\neg$, $\land$, and $\lor$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How is De Morgan's law (distributing $\land$) expressed as an equivalence? -Back: $\neg (E1 \land E2) = \neg E1 \lor \neg E2$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. -Tags: programming::equiv-trans - -END%% - -### Law of Negation - -For any proposition $E1$, it follows that $\neg (\neg E1) = E1$. - -%%ANKI -Basic -How is the law of negation expressed as an equivalence? -Back: $\neg (\neg E1) = E1$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. -Tags: programming::equiv-trans - -END%% - -### Law of Excluded Middle - -For any proposition $E1$, it follows that $E1 \lor \neg E1 = T$. - -%%ANKI -Basic -Which of the basic logical operators does the law of excluded middle involve? -Back: $\lor$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How is the law of excluded middle expressed as an equivalence? -Back: $E1 \lor \neg E1 = T$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. -Tags: programming::equiv-trans - -END%% - -%%ANKI -Basic -Which equivalence schema is "refuted" by sentence, "This sentence is false." -Back: The law of excluded middle -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -### Law of Contradiction - -For any proposition $E1$, it follows that $E1 \land \neg E1 = F$. - -%%ANKI -Basic -Which of the basic logical operators does the law of contradiction involve? -Back: $\land$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How is the law of contradiction expressed as an equivalence? -Back: $E1 \land \neg E1 = F$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. -Tags: programming::equiv-trans - -END%% - -%%ANKI -Cloze -The law of {1:excluded middle} is to {2:$\lor$} whereas the law of {2:contradiction} is to {1:$\land$}. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What does the principle of explosion state? -Back: That any statement can be proven from a contradiction. -Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). - -END%% - -%%ANKI -Basic -How is the principle of explosion stated in first-order logic? -Back: $\forall P, F \Rightarrow P$ -Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). - -END%% - -%%ANKI -Basic -What does the law of contradiction say? -Back: For any proposition $P$, it holds that $\neg (P \land \neg P)$. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -How does the principle of explosion relate to the law of contradiction? -Back: If a contradiction could be proven, then anything can be proven. -Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). - -END%% - -%%ANKI -Basic -Suppose $P$ and $\neg P$. Show schematically how to use the principle of explosion to prove $Q$. -Back: $$\begin{align*} P \\ \neg P \\ P \lor Q \\ \hline Q \end{align*}$$Reference: “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). - -END%% - -%%ANKI -Cloze -The law of {contradiction} and law of {excluded middle} create a dichotomy in "logical space". -Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). - -END%% - -%%ANKI -Basic -Which property of partitions is analagous to the law of contradiction on "logical space"? -Back: Disjointedness. -Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). - -END%% - -%%ANKI -Basic -Which property of partitions is analagous to the law of excluded middle on "logical space"? -Back: Exhaustiveness. -Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). - -END%% - -%%ANKI -Cloze -The law of {1:contradiction} is to "{2:mutually exclusive}" whereas the law of {2:excluded middle} is "{1:jointly exhaustive}". -Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). - -END%% - -%%ANKI -Basic -Which logical law proves equivalence of the law of contradiction and excluded middle? -Back: De Morgan's law. -Reference: “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). - -END%% - -## As Sets - -A **state** is a function that maps identifiers to $T$ or $F$. A proposition can be equivalently seen as a representation of the set of states in which it is true. - -%%ANKI -Basic -What is a state? -Back: A function mapping identifiers to values. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Is $(b \land c)$ well-defined in $\{\langle b, T \rangle, \langle c, F \rangle\}$? -Back: Yes. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Is $(b \lor d)$ well-defined in $\{\langle b, T \rangle, \langle c, F \rangle\}$? -Back: No. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -A proposition is well-defined with respect to what? -Back: A state to evaluate against. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What proposition represents states $\{(b, T), (c, T)\}$ and $\{(b, F), (c, F)\}$? -Back: $(b \land c) \lor (\neg b \land \neg c)$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What set of states does proposition $a \land b$ represent? -Back: $\{\{\langle a, T \rangle, \langle b, T \rangle\}\}$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What set of states does proposition $a \lor b$ represent? -Back: $\{\{\langle a, T \rangle, \langle b, T \rangle\}, \{\langle a, T \rangle, \langle b, F \rangle\}, \{\langle a, F \rangle, \langle b, T \rangle\}\}$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is sloppy about phrase "the states in $b \lor \neg c$"? -Back: $b \lor \neg c$ is not a set but a representation of a set (of states). -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is the weakest proposition? -Back: $T$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What set of states does $T$ represent? -Back: The set of all states. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What is the strongest proposition? -Back: $F$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What set of states does $F$ represent? -Back: The set of no states. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -What does a proposition *represent*? -Back: The set of states in which it is true. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -When is $p$ stronger than $q$? -Back: When $p \Rightarrow q$. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -If $p \Rightarrow q$, which of $p$ or $q$ is considered stronger? -Back: $p$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -When is $p$ weaker than $q$? -Back: When $q \Rightarrow p$. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -If $p \Rightarrow q$, which of $p$ or $q$ is considered weaker? -Back: $q$ -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Why is $b \land c$ stronger than $b \lor c$? -Back: The former represents a subset of the states the latter represents. -Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Basic -Given sets $a$ and $b$, $a = b$ is equivalent to the conjunction of what two expressions? -Back: $a \subseteq b$ and $b \subseteq a$. -Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Cloze -{$a \Rightarrow b$} is to propositional logic as {$a \subseteq b$} is to sets. -Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -%%ANKI -Cloze -{$a \Leftrightarrow b$} is to propositional logic as {$a = b$} is to sets. -Reference: Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. - -END%% - -## Bibliography - -* Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. -* “Law of Noncontradiction,” in _Wikipedia_, June 14, 2024, [https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction](https://en.wikipedia.org/w/index.php?title=Law_of_noncontradiction&oldid=1229006759). -* * Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). -* “Principle of Explosion,” in _Wikipedia_, July 3, 2024, [https://en.wikipedia.org/w/index.php?title=Principle_of_explosion](https://en.wikipedia.org/w/index.php?title=Principle_of_explosion&oldid=1232334233). \ No newline at end of file diff --git a/notes/ontology/dialetheism.md b/notes/ontology/dialetheism.md index 925b5fc..48e882f 100644 --- a/notes/ontology/dialetheism.md +++ b/notes/ontology/dialetheism.md @@ -9,11 +9,11 @@ tags: ## Overview -A **dialetheia** is a sentence $A$ such that both it and its negation ($\neg A$) are true. **Dialetheism** is the view that there are dialetheias. In other words, dialetheism admits the existence of true contradictions. +A **dialetheia** is a proposition $A$ such that both it and its negation ($\neg A$) are true. **Dialetheism** is the view that there are dialetheias. In other words, dialetheism admits the existence of true contradictions. %%ANKI Cloze -A {dialetheia} is a {sentence such that both it and its negation are true}. +A {dialetheia} is a {proposition such that both it and its negation are true}. Reference: Graham Priest, Francesco Berto, and Zach Weber, “Dialetheism,” in _The Stanford Encyclopedia of Philosophy_, ed. Edward N. Zalta and Uri Nodelman, Summer 2024 (Metaphysics Research Lab, Stanford University, 2024), [https://plato.stanford.edu/archives/sum2024/entries/dialetheism/](https://plato.stanford.edu/archives/sum2024/entries/dialetheism/). END%% diff --git a/notes/logic/short-circuit.md b/notes/programming/short-circuit.md similarity index 97% rename from notes/logic/short-circuit.md rename to notes/programming/short-circuit.md index 81b780d..711981c 100644 --- a/notes/logic/short-circuit.md +++ b/notes/programming/short-circuit.md @@ -1,9 +1,10 @@ --- title: Short-Circuit TARGET DECK: Obsidian::STEM -FILE TAGS: logic +FILE TAGS: programming::short-circuit tags: - logic + - programming --- ## Overview diff --git a/notes/set/functions.md b/notes/set/functions.md index 97a76c5..30bd417 100644 --- a/notes/set/functions.md +++ b/notes/set/functions.md @@ -211,7 +211,7 @@ Basic Suppose `Function.Injective f` for $f \colon A \rightarrow B$. What predicate logical formula describes $f$? Back: $\forall a_1, a_2 \in A, (f(a_1) = f(a_2) \Rightarrow a_1 = a_2$) Reference: “Bijection, Injection and Surjection,” in _Wikipedia_, May 2, 2024, [https://en.wikipedia.org/w/index.php?title=Bijection_injection_and_surjection](https://en.wikipedia.org/w/index.php?title=Bijection,_injection_and_surjection&oldid=1221800163). -Tags: lean logic::predicate +Tags: lean formal-system::predicate END%% @@ -470,7 +470,7 @@ Basic Suppose `Function.Surjective f` for $f \colon A \rightarrow B$. What predicate logical formula describes $f$? Back: $\forall b \in B, \exists a \in A, f(a) = b$ Reference: “Bijection, Injection and Surjection,” in _Wikipedia_, May 2, 2024, [https://en.wikipedia.org/w/index.php?title=Bijection_injection_and_surjection](https://en.wikipedia.org/w/index.php?title=Bijection,_injection_and_surjection&oldid=1221800163). -Tags: lean logic::predicate +Tags: lean formal-system::predicate END%% diff --git a/notes/x86-64/instructions/condition-codes.md b/notes/x86-64/instructions/condition-codes.md index 47e640d..9af8eed 100644 --- a/notes/x86-64/instructions/condition-codes.md +++ b/notes/x86-64/instructions/condition-codes.md @@ -236,7 +236,7 @@ END%% %%ANKI Basic -In terms of condition codes, what value does `setz` put in its specified destination? +In terms of condition codes, what value does `sets` put in its specified destination? Back: `SF` Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.