Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 59 3 c Solution Created 2026-10-03 Updated 2026-10-07
The AND-NOT circuit value problem belongs to P: validate the Boolean circuit and evaluate its gates in a topological ordering. Evaluation takes polynomial time even if its description is not already in a topological ordering.
For P-completeness we use logspace many-one reductions. Start from the supplied circuit value problem over the usual AND (logical conjunction), OR (logical disjunction) and NOT (negation) basis. Retain AND and NOT gates, and replace every OR gate by the De Morgan's laws gadgetThis adds only a constant number of gates per old gate, preserves its truth value for all inputs and keeps the Boolean circuit acyclic. If the format includes constant source nodes, replace them by additional input nodes assigned fixed bits zero and one; these are inputs, not disallowed gates. Larger fan-in gates can first be replaced by binary trees of their inputs.
To output the new description, keep the old gate index and a constant-size gadget position, rescan old references when necessary, and assign consistent new indices to each gadget's terminal output. These counters and references occupy bits; the input assignment is copied with any constant-source bits appended. Thus the construction is a logspace many-one reduction preserving acceptance. Since Boolean circuit Value is P-complete under such reductions,
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 20 3 Solution Created 2026-10-03 Updated 2026-10-06
A first-order signature specifies sorts, function symbols with specified input and output sorts, and relation symbols with specified input sorts. A coherent formula is built from atomic relations and equalities using , , finite logical conjunctions, finite logical disjunctions, and existential quantification. A coherent theory is a set of sequents between coherent formulas in a common finite context; its axioms are interpreted as universally closed implications. Neither general negation nor universal quantification is allowed inside coherent formulas.
One complete presentation of coherent logic consists of the following axiom and rule schemes, together with the theory's sequents. All displayed formulas have compatible sorts and contexts, and bound variables can be renamed.
Identity and cut give andSubstitution replaces the free variables of any derivable sequent by well-typed terms, avoiding capture. Contexts can be enlarged by unused variables, and permuted or renamed.
The finite-meet rules are , , , andThe finite-join rules are , , , andInclude distributivity .
Existential introduction is . Existential elimination iswhere is absent from . Equivalently, the quantifier is left adjoint to weakening along the context projection. Include the Frobenius rule in coherent logicIt can also be derived from the usual coherent natural-deduction rules.
Equality has and the substitution schemeincluding atomic formulas and terms of the signature. Symmetry, transitivity and congruence for all functions and relations follow. These schemes impose no unintended inhabitedness axiom on a sort.
The coherent syntactic category has objects formulas in context , up to renaming. An arrow from to is an equivalence class, modulo provable equivalence, of formulas satisfyingandThese are provably total functional relations. The identity is the equality graph restricted by . If and are consecutive arrows, their composite is represented by . Equality, cut and existential rules give the category laws.
A coherent category has finite limits, pullback-stable regular-epi/mono image factorizations, and finite unions of subobjects stable under pullback. We verify these structures syntactically. The terminal object is the empty-context truth formula. Products conjoin formulas in disjoint contexts; equalizers add equality of the two output tuples. For a functional relation , its image in the target is represented by . Its factor onto that image is regular epic: two arrows out of the image agreeing on the source agree by existential elimination, and the same argument with the kernel pair gives the coequalizer property. Frobenius makes these image factorizations stable under pullback.
Every subobject of is represented by a formula with . Indeed, take the existential image of a monic functional relation; uniqueness makes its map to that image an isomorphism. Subobject inclusion is exactly provable implication. Finite unions are consequently disjunctions, with bottom as the empty subobject; distributivity and substitution make them pullback-stable. Hence is coherent.
The conservative syntactic model interprets a sort by , a function by its term graph, and a relation by its atomic-formula subobject. Induction on coherent formulas shows that is interpreted by the subobject of its context object. It satisfies every theory axiom by construction. Conversely, a sequent holds in this model exactly when the corresponding subobject inclusion holds, which is exactly derivability in . ThereforeThis is conservativity for coherent sequents, not a claim about non-coherent formulas.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 21 3 Solution Created 2026-10-03 Updated 2026-10-06
Every countable structure in a countable first-order language has a Scott sentence whose countable models are precisely its isomorphic copies. In particular two countable structures with the same countable infinitary logic sentences are isomorphic. Countability of both structures is essential to the back-and-forth conclusion; the sentence need not exclude uncountable models.
Let be a nonempty countable structure in a countable first-order language. The countable infinitary logic permits countable logical conjunctions and logical disjunctions, but only finite strings of quantifiers and finitely many free variables in each formula. We construct a Scott formula for every finite tuple from and every countable ordinal .
At stage zero, let be the conjunction of all atomic formulas true of and the negations of all atomic formulas false of . Include atomic formulas involving arbitrary terms and constants, not just relation symbols applied directly to variables. There are only countably many such formulas. This complete atomic description ensures that matching tuples determine a partial isomorphism of structures.
At successors putAt a nonzero limit ordinal , put . All these are formulas of countable infinitary logic: each indexing set is countable, and the free variables are only the fixed finite tuple. Rename bound variables when necessary. Transfinite induction also shows .
For tuples of the same length within , define by . Induction identifies this with the usual symmetric back-and-forth method equivalence: the tuples have the same atomic description at stage zero, and at a successor every one-element extension on either side has a matching extension at the previous stage. Thus these are decreasing equivalence relations, simultaneously for every finite tuple length.
There are only countably many pairs of finite tuples in . A pair can cease to be equivalent at most once. The supremum of the first separation stages of all pairs that separate below is a countable ordinal. Choose a countable at least that supremum. No pair can first separate at , soThis justifies stabilization without assuming that all tuples stabilize at one predetermined finite stage.
Now form the following Scott sentence, where the case has no displayed variables or quantifiers:It is a sentence of countable infinitary logic, because the family of all finite tuples is countable. The stabilization above and the truth of show .
Suppose a countable structure satisfies . Start with the empty matching tuples, and maintain . The corresponding conjunct of upgrades this to . The existential conjuncts extend the match by any specified element of . The universal-disjunction conjunct extends it by any specified element of . The atomic formula information makes a new element on one side match a new element on the other, and makes repeated elements agree with their earlier matches.
Enumerate both structures and alternate these two extension steps, including the least element not yet covered at each step. The union is a bijection preserving and reflecting every atomic formula, hence an isomorphism; for function symbols, eventually include both a tuple and the value of its function term to see explicitly that the function is preserved. For finite structures the same construction stops when both are covered. Conversely every isomorphic copy of satisfies , since isomorphisms preserve formulas of countable infinitary logic by induction on their construction. ThereforeIf countable have the same sentences, satisfies this Scott sentence of and is isomorphic to . This proves Scott isomorphism theorem.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 23 1 b Solution Created 2026-10-03 Updated 2026-10-06
Take and the proper filter on a set . In the first-order language with unary predicates , let both factors be one-element first-order structures. Set true and false in the first factor, and reverse these truth values in the second.
The reduced product also has one element . Neither nor holds there: their truth sets are and , neither belonging to . ThusLogical disjunction can therefore break the equivalence. A union can belong to a filter on a set without either summand belonging to it; the corresponding union property does hold for an ultrafilter.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 135 5 Solution Created 2026-10-03 Updated 2026-10-05
Use the Gödel-Gentzen negative translation, writing for the translated first-order formula. On atomic formulas , including logical equality, put , and put . Extend recursively byLogical negation abbreviates logical implication to logical falsity, so . The displayed logical disjunction and existential clauses are intuitionistically equivalent to the usual negative clauses and , respectively. Thus these clauses specify the same negative interpretation. Translation commutes with capture-avoiding substitution of terms for free variables.
First prove by structural induction the stability of a formula under double negation:Every double logical negation is stable, since intuitionistic first-order logic proves ; logical falsity is stable as well. Stability passes to logical conjunction by obtaining double logical negation of each component. For a logical implication with stable , assume and . An assumption would give , a contradiction, so and then . For a universal first-order formula, implies for arbitrary fresh ; use stability pointwise and generalize. Logical disjunction and existential translations are already double negations. This proves all cases.
Now regard classical first-order natural deduction as intuitionistic natural deduction plus unrestricted double-negation elimination, and induct on a classical derivation. The rules for logical conjunction, logical implication, universal quantification and logical falsity translate directly. Logical disjunction introduction gives and then its double logical negation. For logical disjunction elimination, the translated premise is and the two translated branches yield the stable conclusion . Assuming makes each branch contradictory, giving and , hence , which contradicts the premise. We have and remove it by stability.
Existential introduction likewise adds a double logical negation to the ordinary witness introduction. In existential elimination, the witness branch has the original fresh-variable condition. Assuming makes that branch give ; generalization gives and therefore , contradicting the translated premise. Again stability supplies . The universal-rule side conditions are preserved because the translation introduces no new free variables.
For logical equality, reflexivity gives and then its double logical negation. For substitution, from and , temporarily assume . An assumption would transport to by intuitionistic logical equality substitution, so it gives a contradiction and hence . The first premise contradicts this. Thus holds and stability gives . Finally a classical double-negation elimination step translates precisely to , already proved. Every rule is therefore covered, giving negative translation of a classical proof:In particular a classical thesis has an intuitionistic, constructive translated proof. If nonlogical assumptions are present, they must be translated too.
In classical logic, double-negation elimination gives on atoms. Structural induction propagates equivalence through logical conjunction, logical implication and both quantifiers, and removes the added double negations on logical disjunction and existence. Therefore
Past exam of the mathematics course of the University of Cambridge 2022 iii Paper 120 1 a Solution 2026-09-28
Under the Curry-Howard correspondence, Intuitionistic propositional logic propositions are types and proofs are typed terms. Assumptions correspond to typed variables. The logical implication corresponds to the function type, logical conjunction to the product type, logical disjunction to the sum type, logical truth to the unit type, and logical falsity to the empty type.
The rules of natural deduction become term constructors. Implication introduction sends a derivation of from a variable to the abstraction , while implication elimination becomes application . Pairing and projection implement conjunction, and injections with case analysis implement disjunction. Under this correspondence, normalization of proofs is computation by beta reduction in the simply typed lambda calculus.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 124 1 ii Solution Created 2026-09-24 Updated 2026-09-25
The problem belongs to NP: an assignment in is a polynomial-length certificate in computational complexity, and substitution verifies every equation in polynomial time.
For NP-hardness, reduce the Circuit satisfiability problem. Introduce one variable in for every wire of a Boolean circuit. A logical negation gate is enforced by , and a logical conjunction gate is enforced by . For a logical disjunction gate use the suggested quadratic equationwhich is equivalent to for bits . Add the linear equation for the designated output wire.
The construction introduces one variable and one equation per wire or gate, so it is a polynomial-time many-one reduction. A satisfying circuit input extends uniquely through its gates to a solution of the equations, and any solution gives a consistent accepting circuit computation. Since circuit satisfiability is NP-complete, quadratic-equation satisfiability over F2 is therefore
Propositional logic Created 2026-09-24 Updated 2026-10-14
Propositional logic studies reasoning with whole propositions represented by letters such as and , and propositional formulas built from them using logical connectives. The classical two-valued, truth-functional presentation below assigns each primitive proposition either true or false: each compound value depends only on its component values. This is classical propositional logic; other systems, including Intuitionistic propositional logic, have different semantics and rules.
Starting with and , one can build by logical negation, by logical conjunction, by logical disjunction, and by logical implication, then combine these into larger propositional formulas. Parentheses specify the construction: has logical conjunction as its outermost logical connective. Primitive propositions have no internal structure in this language; a first-order formula can additionally describe objects and quantify over them. The formation rules are given in forall x: Calgary, chapter 6.
The following truth table shows the four basic logical connectives. Logical disjunction is inclusive: is true when either or both inputs are true. Classical logical implication has exactly the same values as ; its only false row has true and false. These truth conditions are specified in forall x: Calgary, chapter 9.
Evaluate from the inside out: first the logical implication, then the outer logical conjunction. The final column also tests the logical implication expressing the modus ponens rule:At , the logical implication is false, so the logical conjunction is false. The abstract syntax tree below separates the construction of the propositional formula from the values propagated through it. Both occurrences of receive the same value from the Boolean valuation. With the opposite assignment , the logical implication is true but the logical conjunction is still false because its second input is false. Recursive evaluation and exhaustive truth tables are explained in forall x: Calgary, chapter 11.
The last column is always true: is a tautology. This expresses the logical validity of the modus ponens rule: whenever both premises and are true, is true. It does not say the premises are true under every Boolean valuation; their logical conjunction is true only on the first row. For a short natural deduction proof outline, assume , extract both conjuncts, apply the implication elimination rule to obtain , then discharge the assumption by the implication introduction rule. See forall x: Calgary, sections 17.3–17.5.
Three tests answer different questions: Boolean satisfiability requires at least one true row, a tautology requires every row true, and a contradiction has every row false. Thus is a tautology, is a contradiction, and is satisfiable but not a tautology: it is true only at . See forall x: Calgary, sections 12.1–12.4.
Propositional logic is useful because an inference pattern can be checked once and reused for many choices of propositions. Its beauty is that a finite truth table completely settles classical truth-functional questions about a fixed propositional formula. But logical validity does not verify real atomic claims. If means “the switch is closed” and means “the lamp is lit”, a valid use of the modus ponens rule still requires establishing its premises about the apparatus; the truth table supplies neither an observation nor a causal explanation. See forall x: Calgary, chapter 2 and chapter 10.
Reduced product 2026-10-06
Given nonempty first-order structures and a proper filter on a set , a reduced product identifies product functions when . Operations are interpreted coordinatewise, and relations hold when their coordinate truth sets belong to . For an ultrafilter this is an ultraproduct. Primitive positive formulas transfer through an arbitrary proper filter, whereas logical disjunction and logical negation can fail to transfer.
Set union Created 2026-09-24 Updated 2026-10-14
The union collects the set elements belonging to either set, including those belonging to both:Thus membership in a union uses logical disjunction (OR). For and , the union is : the shared member occurs only once, because a set records membership without repeated entries.
In this Venn diagram, belong only to , belongs to both sets, belongs only to , and belong to neither. The surrounding universal set is . Numbers are placed by membership; circle areas do not represent cardinalities. Each panel shades the region selected by its operation.
For a database illustration, let collect records matching one condition and collect records matching another. Their union selects records matching at least one condition, with a record satisfying both still appearing once. This interpretation turns an abstract operation into a reusable rule for combining selections. For an authored treatment of union, intersection, set difference, and complement, see Lehman, Leighton and Meyer, Mathematics for Computer Science (2015), Definition 4.1.1, pp. 82–83.
More generally, the union contains exactly the set elements belonging to at least one set :The existential quantification expresses “at least one”. With no indexing members, the union is the empty set. Combining a set with the empty set leaves it unchanged: .


