Logical conjunction

In logic and mathematics, logical conjunction or and is a two-place logical operation that results in a value of true if both of its operands are true, otherwise a value of false.

Definition
Logical conjunction is an operation on two logical values, typically the values of two propositions, that produces a value of true if and only if both of its operands are true.

Truth table
The truth table of p AND q (also written as p &and; q (logic), p && q (computer science), or p$$\cdot$$q (electronics)).

Venn diagram
The Venn diagram of "A and B"



The analogue of conjunction for a (possibly infinite) family of statements is universal quantification, which is part of predicate logic.

Introduction and elimination rules
As a rule of inference, conjunction introduction is a classically valid, simple argument form. The argument form has two premises, A and B. Intuitively, it permits the inference of their conjunction.


 * A,
 * B.
 * Therefore, A and B.

or in logical operator notation:
 * $$ A, $$
 * $$ B $$
 * $$ \vdash A \and B $$

Here is an example of an argument that fits the form conjunction introduction:


 * Everyone should vote.
 * Democracy is the best system of government.
 * Therefore, everyone should vote and democracy is the best system of government.

Conjunction elimination is another classically valid, simple argument form. Intuitively, it permits the inference from any conjunction of either element of that conjunction.


 * A and B.
 * Therefore, A.

...or alternately,


 * A and B.
 * Therefore, B.

In logical operator notation:
 * $$ A \and B $$
 * $$ \vdash A $$

...or alternately,


 * $$ A \and B $$
 * $$ \vdash B $$

Properties
The following properties apply to conjunction:


 * associativity: $$a \land (b \land c) \equiv (a \land b) \land c $$


 * commutativity: $$a \land b \equiv b \land a $$


 * distributivity: $$(a \land (b \lor c)) \equiv ((a \land b) \lor (a \land c))$$
 * $$(a \land (b \land c)) \equiv ((a \land b) \land (a \land c))$$


 * idempotency: $$a \land a \equiv a $$


 * monotonicity: $$(a \rightarrow b) \rightarrow ((c \land a) \rightarrow (c \land b))$$
 * $$(a \rightarrow b) \rightarrow ((a \land c) \rightarrow (b \land c))$$


 * truth-preserving: The interpretation under which all variables are assigned a truth value of 'true' produces a truth value of 'true' as a result of conjunction.


 * falsehood-preserving: The interpretation under which all variables are assigned a truth value of 'false' produces a truth value of 'false' as a result of conjunction.

If using binary values for true (1) and false (0), then logical conjunction works exactly like normal arithmetic multiplication.

Bitwise operation
Logical conjunction is often used for bitwise operations. Examples:


 * 0 and 0 = 0
 * 0 and 1 = 0
 * 1 and 0 = 0
 * 1 and 1 = 1


 * 1100 and 1010 = 1000

Use in programming
In high-level computer programming, the logical conjunction "and" is commonly represented by the infix operator "and" or the ampersand (&). Many languages also provide short-circuit control structures corresponding to logical conjunction.

Boolean "and" is also used in SQL operations. Some database systems are case-sensitive and require "AND".

In computer science, the AND operator can be used to select part of a bitstring using a bit mask. For example,  examines the fifth bit of a bitstring.

Set-theoretic intersection
The intersection used in set theory is defined in terms of a logical conjunction: x ∈ A ∩ B if and only if (x ∈ A) ∧ (x ∈ B). Because of this, logical conjunction satisfies many of the same identities as set-theoretic intersection, such as associativity, commutativity, distributivity, and de Morgan's laws.

Rhetorical considerations
The classical "trivium" divides the study of articulate argumentation into the disciplines of grammar, logic, and rhetoric. Grammar concerns those aspects of language that are internal to the language itself, in other words, that can be abstracted from considerations of the object world and the language user. Logic deals with the properties of language and reasoning that are independent of particular manners of interpretation and invariant over conceivable languages. Rhetoric treats those aspects of language and its use in reasoning that necessarily take the nature of the interpreter into consideration.

Natural languages are evolved for many purposes beyond their use in logical argumentation, and so any study of logic in a natural language context must sort out those aspects of natural language that are pertinent to its use in logic and those that are not.

English "and" has properties not captured by logical conjunction, because "and" can sometimes imply order. For example, "They got married and had a child" in common discourse means that the marriage came before the child. Then again the word "and" in common usage can imply a partition of a thing into parts, as "The American flag is red, white, and blue." Here it is not meant that the flag is at once red, white, and blue, but rather that it has a part of each color.

The word "and" can also serve as a logical disjunction (called OR in logic), e.g. "Damage caused by scratches and dents is not reimbursable," when what is meant is that damage cause by one or the other isn't reimbursable. This overload of meaning on "and" happens when the word is used to amplify "or"; the second sentence, on an insurance contract, looks and reads weak. In the same way "or" can be used to mean AND: the sentence "It might work, or it might not" is equivalent to "It might work, and it might not".

A minor issue of logic and language is the role of the word "but". Logically, the sentence "it's raining, but the sun is shining" is equivalent to "it's raining, and the sun is shining", so logically, "but" is equivalent to "and". However, "but" and "and" are semantically distinct in natural language. Speakers use "but", a conjunction of contradiction, to mark their surprise or reservation vis-a-vis a circumstance that goes against a trend.

One way to resolve this problem of correspondence between symbolic logic and natural language is to observe that the first sentence (using "but"), implies the existence of a hidden but mistaken assumption, namely that the sun does not shine when it rains. We might say that, given probability p that it rains and the sun shines, and probability 1 &minus; p that it rains and the sun does not shine, or that it does not rain at all, we would say "but" in place of "and" when p was low enough to warrant our incredulity.

That implication captures the semantic difference of "and" and "but" without disturbing their logical equivalence. On the other hand, in Brazilian logic, the logical equivalence is broken between A BUT NOT B (where "BUT NOT" is a single operator) and A AND (NOT B), which is a weaker statement.

"But" is also sometimes disjunctive (It never rains but it pours); sometimes minutive (Canada has had but three shots on goal); sometimes contrastive (He was not God, but merely an exalted man); sometimes a spatial preposition (He's waiting but the house); and sometimes interjective (My, but that's a lovely boat). These uses await semantic assimilation with conjunctive "but".

Like "and", "but" is sometimes non-commutative: "He got here, but he got here late" is not equivalent to "He got here late, but he got here". This example shows also that unlike "and", "but" can be felicitously used to conjoin sentences that entail each other; compare "He got here late, and he got here".