命题演算、集合论和布尔代数之间的关系是什么?
命题逻辑中的连接词∧(连接)与集合论中的∩(交集)本质上是相同的,如果我们认为“假”是“非成员”,“真”是“成员”。德摩根定律、交换定律、幂等定律适用于其中的三种。真值表存在于命题逻辑和布尔代数中——隶属表存在于集合论中。为什么?
是不是因为这些系统中的变量是二进制的(真或假,在集合中而不是在集合中,0-1),并且在给定定义运算符的情况下,只有两个可能值的变量之间的关系是相同的,而不管这两个选择是什么?
如果我在命题逻辑中证明了一个表达式,那么它对应的布尔表达式也同样成立吗?卡诺图对简化逻辑表达式也有效吗?
这些系统是否共享公理?
答案是响亮的“是”!它们都是同一事物的影子,那就是“它们都是”布尔代数。
更清楚一点:如果你有一个集合X,那么幂集P(X)(所有子集的集合)是一个布尔代数,其中∧由。然后你可以检查最基本的规则,或者布尔代数的公理。从某种意义上说,这是“必须手工完成的”,但这几乎是微不足道的。一旦你做到了这一点,任何你能从布尔代数公理中证明的公式都适用于集合X的子集,即隶属关系。
类似地,如果你有一组命题变量,看看基于这些变量的命题公式集Frm,那么它不是一个布尔代数,但它几乎是一个布尔代数。事实上,如果你用关系φ∼ψ⟺φ与ψ相等,那么所有的∧,∨,∨都传递给商,然后你就得到了布尔代数。再说一次,你只需要检查公理。
如何做到这一点取决于你所说的“等价”是什么意思(在语法上等价,即有⊢φ的正式证明)↔ψ、 或者在语义上等价,也就是说,对V的任何解释,φ和ψ的结果都是一样的-结果证明“等价”的这两个意思是等价的[不是双关语],但这是一个定理,如果你不知道,那么根据你的定义,证明会有所不同),但不管怎样,它都会起作用。因此,你能从布尔代数公理中证明的任何公式,都必须(达到等价)适用于公式。
这两个结果被称为“稳健性”。
然而,你的问题实际上是反方向的,问“如果我能证明命题逻辑中的某些东西,那么它是否适用于布尔表达式?”;我把布尔表达式解释为“它是否适用于所有布尔代数?”(事实证明,这和要求有语法证据是一样的)。现在这个问题在某种程度上是健全性的“反面”:你要求的是完整性。但幸运的是,这些语义是完整的!
这是什么意思?这里还有两件事,所以有两个定理:
如果p=q形式的定律仅能用∩,∪,(-)c表示,则当你用∧转换它时,它适用于所有的动力装置p(X)↔∩,∨↔∪,¬↔(−)c,它适用于所有布尔代数,因此也适用于“布尔表达式”。
如果你能证明两个命题公式φ和ψ是等价的,那么它们在布尔表达式中的明显转换就可以用布尔公理来证明是相等的(这与说它对所有布尔代数都成立一样)
还有更好的(或更糟的,取决于你的观点):如果你有两个布尔表达式p(x1,…,xn),q(x1,…xn),那么它们可以从布尔代数公理中证明相等当且仅当所有赋值xi↦0或1,它们给出相同的结果:这是证明使用真值表的结果,因为要检查两个表达式是否相同,只要对0,1的每个赋值进行检查就足够了。
我将更进一步,并注意到这一切都取决于使用经典逻辑,特别是排除中间法则,即x∨x始终成立。如果你去掉这个定律,你就进入了直觉逻辑的领域,我刚才说的很多东西都失效了:你可以通过改变一些东西来挽救一些部分,但是你完全失去了使用真值表的能力。
What is the relationship between propositional calculus, set theory, and Boolean algebra?
The connective ∧ (conjunction) in propositional logic is essentially the same as ∩ (intersection) in set theory if one thinks of 'false' as 'not a member' and 'true' as 'a member'. De Morgan's laws, commutative laws, idempotent laws, etc apply in three of them. Truth tables exist in both propositional logic and Boolean algebra--membership tables exist in set theory. Why?
Is it because the variables in these systems are binary (true-false, in the set-not in the set, 0-1)and the relationship between variables that have only two possible values given the defined operators is the same regardless of what the two choices are?
If I prove something about an expression in propositional logic, is it valid to conclude that the same holds for its corresponding Boolean expression? Is Karnaugh map valid for simplifying logical expressions too?
Do these systems share axioms?
The answer is a resounding "yes" ! They're all shadows of the same thing, which is that "they're all" boolean algebras.
To make it clearer : if you have a set X, then the powerset P(X) (set of all subsets) is a boolean algebra with ∧ given by ∩,∨ given by ∪, ¬ given by (−)c (complement in X). Then you can check the most basic rules, or axioms of boolean algebras. This you "have to do by hand" in a sense, but it's pretty much trivial. Once you have done this, any formula you can prove from the axioms of boolean algebras holds for subsets of a set X, that is, for the membership relation.
Similarly, if you have a set V of propositional variables and look at the set Frm of propositional formulas based on these variables, then it's not quite a boolean algebra, but it's almost one. Indeed, if you quotient it by the relation φ∼ψ⟺φ is equivalent to ψ, then all the operations ∧,∨,¬ pass to the quotient, and then you do get a boolean algebra. Again, you only have to check the axioms.
How you do that will depend on what you mean by equivalent (syntactically equivalent, i.e. there is a formal proof of ⊢φ↔ψ; or semantically equivalent, i.e. any interpretation of V gives the same result for φ and ψ - it turns out that these two meanings of "equivalent" are equivalent [no pun intended], but it's a theorem, and if you don't know it, then depending on your definition the proofs will look different), but it will work no matter what. Therefore again, any formula you can prove from the axioms of boolean algebras will necessarily hold (up to equivalence) for formulas.
These two results are called "soundness".
However your question actually goes in the reverse direction and asks "if I can prove something in propositional logic, does it then hold for boolean expressions ?"; I interpret boolean expressions to mean "does it then hold for all boolean algebras ?" (it turns out that this is the same as asking that there is a syntactical proof of it). Now this question is somehow the "converse" of soundness : you're asking for completeness. But lucky you, it turns out that these semantics are complete !
What does this mean ? Well again there are two things at hand here, so two theorems :
If a law of the form p=q expressible only with ∩,∪,(−)c holds for all powersets P(X), then when you translate it with ∧↔∩,∨↔∪,¬↔(−)c, it holds for all boolean algebras and therefore holds for "boolean expressions".
If you can prove that two propositional formulas φ and ψ are equivalent, then their obvious translation in boolean expressions can be proved to be equal using the boolean axioms (which is the same as to say it holds for all boolean algebras)
There is even better (or worse, depending on your point of view) : if you have two boolean expressions p(x1,...,xn),q(x1,...xn), then they can be proved equal from the boolean algebra axioms if and only if for all assignments xi↦0 or 1, they give the same result : this is the result that justifies the use of truth tables, because to check that two expressions are the same it suffices to check it against every assignment to 0,1.
I'll go a bit further and note that this all depends crucially on using classical logic and so specifically the law of excluded middle, that states that x∨¬x always holds. If you remove that law, you enter the realm of intuitionistic logic, and a lot of what I just said breaks down : you can salvage some parts by changing some stuff, but you completely lose the ability to use truth tables for instance.