# 逻辑双条件

**逻辑双条件**是二元命题联结词↔，写作“P 当且仅当 Q”（缩写为“iff”），当且仅当其两个成分公式真值相同时为真，否则为假<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup>。当 P 与 Q 同真时、以及二者同假时，它都为真；在两个真假混合的行中为假<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup><sup> • </sup><sup>[2](https://www.math.fsu.edu/~wooland/hm/Unit1Module6/UNIT1MODULE6.doc.pdf)</sup>。在硬件中它表现为同或门（XNOR gate），在布尔代数中表现为比特相等，在数学中则表现为定义与刻画的联结词<sup>[3](https://math.libretexts.org/Courses/Stanford_Online_High_School/Logic_for_All%3A_An_Introduction_to_Logical_Reasoning/07%3A_The_Biconditional)</sup>。

| 关键事实 | 细节 |
|---|---|
| 真值条件 | P↔Q 当且仅当 P 与 Q 求值相同时为真；四行 TT、TF、FT、FF 分别给出 T、F、F、T<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup><sup> • </sup><sup>[2](https://www.math.fsu.edu/~wooland/hm/Unit1Module6/UNIT1MODULE6.doc.pdf)</sup> |
| 归约为蕴涵 | P↔Q 逻辑等价于 (P→Q)∧(Q→P)<sup>[4](https://human.libretexts.org/Bookshelves/Philosophy/Logic_and_Reasoning/A_Modern_Formal_Logic_Primer_(Teller)/02%3A_Volume_I-_Sentence_Logic/2.04%3A_Validity_and_Conditionals/2.4.05%3A_The_Biconditional)</sup> |
| 否定 | ¬(P↔Q) 即异或：P⊕Q ≡ ¬(P↔Q)<sup>[5](https://users.encs.concordia.ca/~ford/C232F10/logelxs.pdf)</sup> |
| 结合性 | ((P↔Q)↔R) ↔ (P↔(Q↔R)) 是一条定理，似乎最早由武卡谢维奇（Łukasiewicz）于1923年前后发现<sup>[6](https://us.metamath.org/mpeuni/biass.html)</sup> |
| 电路形式 | 二输入同或门在行 00 与 11 上输出 1；它需要5个与非门或4个或非门，在静态 CMOS 中需要12个晶体管<sup>[7](https://truthtablekit.com/xnor-gate/)</sup><sup> • </sup><sup>[8](https://truthtablekit.com/universal-gates/)</sup> |
| 记号历史 | ≡ 可追溯至《数学原理》（1910）；↔ 似乎最早由阿尔布雷希特·贝克尔（Albrecht Becker）于1933年使用；⇔ 由布尔巴基（Bourbaki）于1954年使用；“iff”由安德烈·韦伊（André Weil）声称发明，但他怀疑自己是否真是首创者<sup>[9](https://proofwiki.org/wiki/Definition:Biconditional/Notational_Variants)</sup><sup> • </sup><sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)</sup> |

## 定义与真值条件

双条件是按真值函数方式定义的：只要 φ 与 ψ 求值相同，φ↔ψ 就被赋为真，否则为假<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup>。真值表有四行，该陈述在第一行和第四行为真，即 p 的真值与 q 的真值相匹配之处<sup>[2](https://www.math.fsu.edu/~wooland/hm/Unit1Module6/UNIT1MODULE6.doc.pdf)</sup>。同假那一行是“同值”标准的推论，而非特例：两个假陈述彼此仍然一致。

在通常的数学语言中读“P 当且仅当 Q”，它同时断言 P→Q 与 Q→P，从而保证该条件既必要又充分；在数学中，iff 陈述表达定义与刻画<sup>[3](https://math.libretexts.org/Courses/Stanford_Online_High_School/Logic_for_All%3A_An_Introduction_to_Logical_Reasoning/07%3A_The_Biconditional)</sup>。

## 与蕴涵的关系及替代定义

标准归约通过条件句来表达双条件：φ↔ψ 为真当且仅当 φ→ψ 与 ψ→φ 都为真<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup>。特勒（Teller）将其表述为双条件律：X≡Y 逻辑等价于 (X⊃Y)&(Y⊃X)<sup>[4](https://human.libretexts.org/Bookshelves/Philosophy/Logic_and_Reasoning/A_Modern_Formal_Logic_Primer_(Teller)/02%3A_Volume_I-_Sentence_Logic/2.04%3A_Validity_and_Conditionals/2.4.05%3A_The_Biconditional)</sup>；不列颠哥伦比亚大学（UBC）的教材则将 (P↔Q) ≡ ((P⟹Q)∧(Q⟹P)) 列入标准等价式<sup>[11](https://personal.math.ubc.ca/~PLP/book/plp-7-4.html)</sup>。

也存在替代归约。双条件可定义为 P↔Q ≡ (P∧Q)∨(¬P∧¬Q)，即“同真或同假”<sup>[5](https://users.encs.concordia.ca/~ford/C232F10/logelxs.pdf)</sup>。Metamath 的新基础探索者（New Foundations Explorer）则将 (φ↔ψ) 定义为 ¬((φ→ψ)→¬(ψ→φ)) 的缩写，这是向其原始联结词的保守归约<sup>[12](https://us.metamath.org/nfeuni/df-bi.html)</sup>。借助真值常量，该系统证明 (⊤↔⊤)↔⊤、(⊤↔⊥)↔⊥、(⊥↔⊤)↔⊥ 以及 (⊥↔⊥)↔⊤，仅凭定义就重现了经典真值表<sup>[12](https://us.metamath.org/nfeuni/df-bi.html)</sup>。

双条件的否定是异或：P⊕Q 定义为 ¬(P↔Q)<sup>[5](https://users.encs.concordia.ca/~ford/C232F10/logelxs.pdf)</sup>。这两个算子互补：↔ 在一致时为真，⊕ 在不一致时为真。

## 代数性质与三变量之谜

由于双条件具有对称的定义，它的两个成分没有像条件句的前件与后件那样获得不同的名称<sup>[4](https://human.libretexts.org/Bookshelves/Philosophy/Logic_and_Reasoning/A_Modern_Formal_Logic_Primer_(Teller)/02%3A_Volume_I-_Sentence_Logic/2.04%3A_Validity_and_Conditionals/2.4.05%3A_The_Biconditional)</sup>。它还具有结合性：定律 ((φ↔ψ)↔χ)↔(φ↔(ψ↔χ)) 在 Metamath 中有形式证明，并作为弗拉基米尔·利夫希茨（Vladimir Lifschitz）《论计算式证明》（On calculational proofs，《纯粹与应用逻辑年鉴》，113:207–224，2002）中 DS 系统的一条公理<sup>[6](https://us.metamath.org/mpeuni/biass.html)</sup>。Metamath 指出，这条定律未被收入《数学原理》，但似乎最早由扬·武卡谢维奇（Jan Łukasiewicz）于1923年前后发现<sup>[6](https://us.metamath.org/mpeuni/biass.html)</sup>；塔尔斯基（Tarski）在《论逻辑斯蒂的原始词项》（On the primitive term of logistic）中同样将其归功于武卡谢维奇<sup>[13](https://doi.org/10.1016/s0020-0190(00)00205-2)</sup>，而戴克斯特拉（Dijkstra）与斯霍尔滕（Scholten）在1980年代初指出，等价与一般意义上的相等不同，它是结合的<sup>[13](https://doi.org/10.1016/s0020-0190(00)00205-2)</sup>。

结合性产生了一种令大多数读者惊讶的读法。连等式 p ≡ q ≡ r 若按合取方式读作 (p≡q)∧(q≡r)，则与结合读法不同：假 ≡ 假 ≡ 真按合取为假，按结合则为真，因为 (假 ≡ 假) ≡ 真 化简为真<sup>[13](https://doi.org/10.1016/s0020-0190(00)00205-2)</sup>。同一篇论文指出，大多数计算机科学家至今不知道这一结合性，而教科书通常把等价表述为“当且仅当”，即两个条件句的合取，而不是把它当作一个独立的算子<sup>[13](https://doi.org/10.1016/s0020-0190(00)00205-2)</sup>。

## 联结词与逻辑等价、相等

双条件是对象语言中的联结词，由两个公式构成一个公式；逻辑等价则是关于公式的陈述。两个陈述 R 与 S 逻辑等价，当且仅当 R↔S 是重言式，记作 R≡S<sup>[11](https://personal.math.ubc.ca/~PLP/book/plp-7-4.html)</sup>。在 MathOverflow 上，这一区分被表述为：P⇔Q 意味着 P↔Q 是重言式，因此 ↔ 是联结词，而 ⇔ 则像是命题的“等号”<sup>[14](https://mathoverflow.net/questions/24028/what-is-the-difference-between-the-biconditional-iff-and-equality)</sup>。特勒从两个方向表述了同一联系：X≡Y 是逻辑真理当且仅当 X 与 Y 逻辑等价<sup>[4](https://human.libretexts.org/Bookshelves/Philosophy/Logic_and_Reasoning/A_Modern_Formal_Logic_Primer_(Teller)/02%3A_Volume_I-_Sentence_Logic/2.04%3A_Validity_and_Conditionals/2.4.05%3A_The_Biconditional)</sup>。在底层语义中，重言式是在每个真值指派下都为真的公式<sup>[1](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)</sup>。

相等是第三种不同的概念。Metamath 将二者对照：在某种意义上，若两个真值相等，↔ 返回真；而 =（df-cleq）若两个类相等则返回真<sup>[12](https://us.metamath.org/nfeuni/df-bi.html)</sup>。命题上的相等并没有单一含义，可能仅在某些解释下才与逻辑等价重合<sup>[14](https://mathoverflow.net/questions/24028/what-is-the-difference-between-the-biconditional-iff-and-equality)</sup>。记号本身在文献中各不相同，没有全共同体通行的约定，因此读者应根据上下文辨认 ↔ 与 ≡<sup>[11](https://personal.math.ubc.ca/~PLP/book/plp-7-4.html)</sup>。

## 在形式系统中的定义性作用

有些形式系统使用双条件联结词本身来引入定义，这使逻辑能够直接操作定义；在 Metamath 的开发中，df-or 是它的第一个此类用法<sup>[12](https://us.metamath.org/nfeuni/df-bi.html)</sup>。在现代证明助手中，这一模式延续下来。Mathlib 提供 mk_iff_of_inductive_prop，这是一个为归纳定义的命题生成 iff 规则的命令，其形式为 ∀ ps is, i as ↔ ⋁_j, ∃ cs, is = cs<sup>[15](https://github.com/leanprover-community/mathlib4/blob/698d2b68b870f1712040ab0c233d34372d4b56df/Mathlib/Tactic/MkIffOfInductiveProp.lean)</sup>。Lean 4 在其转换规则下使用内置的优化函数 isDefEq 检查定义相等<sup>[16](https://link.springer.com/chapter/10.1007/978-3-031-98682-6_10)</sup>。

## 在电路与计算中的实现

在数字逻辑中，双条件就是同或门。它的二输入真值表有4行，在行 00 与 11 上输出 1，在行 01 与 10 上输出 0；代数上 F = A⊙B = (A⊕B)′ = A·B + A′·B′ = (A+B′)·(A′+B)<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。同或门可用作相等检查电路：输出 A⊙B 仅当两个比特相同时才等于 1，因此检测两个 n 位值是否匹配需要 n 个同或门，其输出送入一个单一的 n 输入与门，这种结构见于幅值比较器的 A=B 输出以及缓存标签比较器中；市售器件包括 74HC7266 以及更早的开漏 74x266<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。

成本的不对称性颇具启发性。从原始门出发，同或门需要5个与非门、4级，或4个或非门、3级；在静态 CMOS 中，二输入同或门需要12个晶体管，与异或门相同，若用传输门则需6个<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。由于在静态 CMOS 中与非门或或非门为4个晶体管，而与门或或门为6个，异或门需要4个与非门但5个或非门，同或门则需要5个与非门但4个或非门，二者在结构上互为对偶<sup>[8](https://truthtablekit.com/universal-gates/)</sup>。

该联结词还塑造了综合数据结构。双条件二元决策图以双条件（基于异或/同或）展开取代香农展开；实验性的 ROBBDD 平均比传统 ROBDD 少37%的节点，而基于 BBDD 的一遍综合方法相比商用综合工具，平均减少49.7%的双极性晶体管数和31.5%的 CMOS 器件数<sup>[17](https://dl.acm.org/doi/10.5555/2485288.2485531)</sup>。

## 数据一览

- 二输入双条件/同或：真值表4行，在行 00 与 11 上输出 1<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。
- 二输入同或门级联：三输入时8行，在第1、2、4、7号最小项上输出 1；四输入时16行，在第0、3、5、6、9、10、12、15号最小项上输出 1<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。
- 门成本：5个与非门（4级）或4个或非门（3级）；静态 CMOS 中12个晶体管，采用传输门时为6个晶体管<sup>[7](https://truthtablekit.com/xnor-gate/)</sup>。
- 与非/或非不对称性：异或4个与非门对5个或非门；同或5个与非门对4个或非门<sup>[8](https://truthtablekit.com/universal-gates/)</sup>。
- 综合：ROBBDD 相比 ROBDD 平均减少37%节点；一遍 BBDD 综合中双极性晶体管减少49.7%，CMOS 器件减少31.5%<sup>[17](https://dl.acm.org/doi/10.5555/2485288.2485531)</sup>。

## 历史与记号

符号的谱系层层叠叠。双条件的记号 p ≡ q 可追溯至1910年怀特海（Whitehead）与罗素（Russell）的《数学原理》；其他变体包括 p↔q、p=q、武卡谢维奇的波兰记号 Epq 以及 p EQ q，而 ⇔ 在数学中常用<sup>[9](https://proofwiki.org/wiki/Definition:Biconditional/Notational_Variants)</sup>。表示逻辑等价的双箭头 ↔ 似乎最早由阿尔布雷希特·贝克尔于1933年在《亚里士多德的可能三段论理论》（*Die Aristotelische Theorie der Möglichkeitsschlüsse*，柏林，1933，第4页）中使用<sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)</sup>。带双线的双箭头 ⇔ 最早由尼古拉·布尔巴基于1954年在《集合论》（*Théorie des ensembles*，第3版，第32页）中使用<sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)</sup>。作为背景，表示蕴涵的单箭头 → 最早由大卫·希尔伯特（David Hilbert）于1922年使用，表示合取的 ∧ 由阿伦特·海廷（Arend Heyting）于1930年使用<sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)</sup>。

“iff”一词有明确的作者。安德烈·韦伊声称对这一缩写负责，他写道，自己最接近不朽的贡献是一个缩写和一个排版符号：“我发明了‘iff’，即‘当且仅当’——但我始终无法相信自己是它真正的首创者”<sup>[10](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)</sup>。一项对20世纪逻辑记号的研究表明，表示等价的竞争记号 ≡ 与 ↔ 在20世纪初至1970年代的数十部著作中并存了数十年<sup>[18](https://members.loria.fr/Roegel/loc/symboles-logiques-eng.pdf)</sup>。现代教科书按条件句约定分流：使用 → 表示条件句的系统用 ↔ 表示双条件，而使用马蹄形符号 ⊃ 的系统通常使用三横线 ≡<sup>[19](https://forallx.openlogicproject.org/bookml/A1.html)</sup>。

## 当代自动推理中的双条件

基于 iff 的重写是证明助手中的活跃基础设施。2024年，Lean 4 改变了其 dsimp 策略，改用 Iff 的 rfl 证明；这一改动导致下游代码大面积失效，并在 Lean Zulip 上引发讨论<sup>[20](https://github.com/leanprover/lean4/pull/3973)</sup>。

在 SMT 求解中，相邻的相等与不等概念带来实际成本。对 Z3 在 SMT-LIB EUF 基准上的性能剖析显示，它花费了不可忽略的时间来操作不等式；Z3 与 cvc5 使用相等嵌入，而 OpenSMT 使用不等边<sup>[21](https://dl.acm.org/doi/10.1145/3704913)</sup>。该论文首次证明了 e-图与其所编码等价关系的自反、对称、传递与同余闭包之间的等价性，并形式化了一个直接支持不等式的扩展<sup>[21](https://dl.acm.org/doi/10.1145/3704913)</sup>。更广泛的 SMT 求解器性能被公开度量：SMT-COMP 2024 公布了单查询竞赛的排名结果，求解器按每种评分方案的表现排序<sup>[22](https://smt-comp.github.io/2024/results/results-single-query/)</sup>。

## References

1. [Semantics of Propositional Logic, CS 245, University of Waterloo](https://cs.uwaterloo.ca/~eblais/cs245e/f25/pl-semantics)
2. [The "if and only if" connective, FSU course module](https://www.math.fsu.edu/~wooland/hm/Unit1Module6/UNIT1MODULE6.doc.pdf)
3. [The Biconditional, Logic for All, LibreTexts](https://math.libretexts.org/Courses/Stanford_Online_High_School/Logic_for_All%3A_An_Introduction_to_Logical_Reasoning/07%3A_The_Biconditional)
4. [The Biconditional, A Modern Formal Logic Primer (Teller), LibreTexts](https://human.libretexts.org/Bookshelves/Philosophy/Logic_and_Reasoning/A_Modern_Formal_Logic_Primer_(Teller)/02%3A_Volume_I-_Sentence_Logic/2.04%3A_Validity_and_Conditionals/2.4.05%3A_The_Biconditional)
5. [Logical Equivalence and Logical Implication, Concordia University course notes](https://users.encs.concordia.ca/~ford/C232F10/logelxs.pdf)
6. [biass, Metamath Proof Explorer](https://us.metamath.org/mpeuni/biass.html)
7. [XNOR Gate — Truth Table, Symbol & Expression, Truth Table Kit](https://truthtablekit.com/xnor-gate/)
8. [Universal Gates — Build Any Gate from NAND or NOR, Truth Table Kit](https://truthtablekit.com/universal-gates/)
9. [Definition:Biconditional/Notational Variants, ProofWiki](https://proofwiki.org/wiki/Definition:Biconditional/Notational_Variants)
10. [Earliest Uses of Symbols of Set Theory and Logic, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/set/)
11. [Logical equivalence, Proof, Sets and Logic, UBC](https://personal.math.ubc.ca/~PLP/book/plp-7-4.html)
12. [df-bi, New Foundations Explorer, Metamath](https://us.metamath.org/nfeuni/df-bi.html)
13. [The associativity of equivalence and the Towers of Hanoi problem](https://doi.org/10.1016/s0020-0190(00)00205-2)
14. [What is the difference between the biconditional iff and equality?, MathOverflow](https://mathoverflow.net/questions/24028/what-is-the-difference-between-the-biconditional-iff-and-equality)
15. [Mathlib/Tactic/MkIffOfInductiveProp.lean, GitHub](https://github.com/leanprover-community/mathlib4/blob/698d2b68b870f1712040ab0c233d34372d4b56df/Mathlib/Tactic/MkIffOfInductiveProp.lean)
16. [Lean-Auto: An Interface Between Lean 4 and Automated Theorem Provers, Springer](https://link.springer.com/chapter/10.1007/978-3-031-98682-6_10)
17. [Biconditional BDD: a novel canonical BDD for logic synthesis targeting XOR-rich circuits, DATE/ACM](https://dl.acm.org/doi/10.5555/2485288.2485531)
18. [A brief survey of 20th century logical notations, Denis Roegel](https://members.loria.fr/Roegel/loc/symboles-logiques-eng.pdf)
19. [Appendix A Symbolic notation, forall x: Calgary](https://forallx.openlogicproject.org/bookml/A1.html)
20. [feat: use rfl proofs of Iff in dsimp, Pull Request #3973, leanprover/lean4](https://github.com/leanprover/lean4/pull/3973)
21. [Dis/Equality Graphs, Proceedings of the ACM on Programming Languages](https://dl.acm.org/doi/10.1145/3704913)
22. [SMT-COMP 2024 — Single Query results](https://smt-comp.github.io/2024/results/results-single-query/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › Formal logic and foundations › Logical calculi and logical syntax › Propositional logic › Propositional formulas, syntax and semantics

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/logical-biconditional

English original: https://www.edgepedia.org/logical-biconditional
