Skip to content
The Lumenary
First-year graduateGraduate 150 min

Forcing and independence

How Cohen adjoined a "generic" object to a model of set theory — and proved that the continuum hypothesis can be neither proved nor refuted from ZFC.

Formally verified · 12 LeanComputationally tested · 1 PythonAI-drafted · awaiting human reviewMathematically reviewed: Awaiting human review
MotivationH

After Gödel, the other half

Gödel's constructible universe (see axiomatic set theory) showed that the continuum hypothesis cannot be refuted from ZFC, if ZF is consistent. For twenty-five years nobody could show that it cannot be proved. The difficulty is that LL is the smallest possible model; to make 2ℵ02^{\aleph_0} large one must build models with more sets, and there was no method for adding sets to a model of ZFC while keeping all the axioms true.

In 1963 Paul Cohen found one. Starting from a countable transitive model MM, he adjoined a new set GG — a generic filter on a partial order of "conditions" — and showed that the resulting model M[G]M[G] still satisfies ZFC, has the same ordinals as MM, and can be arranged to satisfy 2ℵ0=ℵ22^{\aleph_0} = \aleph_2. The method, forcing, has since shown hundreds of natural statements to be independent of ZFC, in set theory, topology, algebra and analysis.

IntuitionH

Adjoining a generic object

We want to add to MM a new real number g:ω→2g : \omega \to 2. We cannot describe gg inside MM — then it would already be in MM. Instead we describe the finite pieces of information about gg: the conditions are finite partial functions pp from ω\omega to 22, and pp is stronger than qq if it extends it. A set DD of conditions is dense if every condition can be strengthened into DD: dense sets are requirements that a good gg should meet, such as "g(17)g(17) is decided" or "gg differs from the real xx somewhere". A filter GG is generic if it meets every dense set that MM can see. Then g=⋃Gg = \bigcup G is total and different from every real in MM.

Statements about the new model are controlled by conditions: pp forces φ\varphi if φ\varphi holds in M[G]M[G] for every generic GG containing pp. The miracle of forcing is that this relation can be computed inside MM, so MM "knows" what its extensions will look like without being able to name the generic object.

Analogy, not a formal construction

Adjoining 2\sqrt 2 to Q\Q produces the smallest field containing Q\Q and 2\sqrt 2, and every element of Q(2)\Q(\sqrt 2) has a name a+b2a + b\sqrt 2 with a,b∈Qa, b \in \Q. Similarly M[G]M[G] is the smallest transitive model of ZFC containing MM and GG, and every element of M[G]M[G] has a name in MM. The analogy is loose: 2\sqrt 2 satisfies an equation over Q\Q, whereas a generic GG is characterised by satisfying no special property describable in MM — it is "transcendental" over MM in the strongest sense.

∅110101g
Cohen conditions form the binary tree of finite strings; stronger conditions lie lower. A generic filter is a branch through the tree (gold) that meets every dense set of the ground model; its union is the Cohen real $g$.
DefinitionsH

Definitions

Definition— independence and relative consistency

A sentence φ\varphi is independent of ZFC if ZFC⊬φ\mathsf{ZFC} \nvdash \varphi and ZFC⊬¬φ\mathsf{ZFC} \nvdash \neg\varphi. Since an inconsistent theory proves everything, independence implies Con(ZFC)\mathrm{Con}(\mathsf{ZFC}), which ZFC cannot prove. So set theorists prove relative consistency statements such as Con(ZFC)→Con(ZFC+¬CH)\mathrm{Con}(\mathsf{ZFC}) \to \mathrm{Con}(\mathsf{ZFC} + \neg\mathsf{CH}), and "CH is independent" means: if ZFC is consistent, it neither proves nor refutes CH.

Definition— forcing notion, dense sets, generic filters

A forcing notion is a preorder (P,≤,1)(P, \le, \mathbb 1) with a largest element 1\mathbb 1; p≤qp \le q means "pp is stronger than qq". Conditions p,qp, q are compatible if some rr satisfies r≤pr \le p and r≤qr \le q; an antichain is a set of pairwise incompatible conditions. A set D⊆PD \subseteq P is dense if every p∈Pp \in P has some q≤pq \le p in DD. A filter is a non-empty G⊆PG \subseteq P that is upward closed and in which any two elements have a common extension in GG. If MM is a model containing PP, a filter GG is MM-generic if it meets every dense set D⊆PD \subseteq P with D∈MD \in M.

Definition— countable transitive model

A countable transitive model (ctm) is a countable set MM, transitive (x∈M⇒x⊆Mx \in M \Rightarrow x \subseteq M), such that (M,∈)(M, \in) satisfies the axioms in question (all of ZFC, or a large enough finite part — see the remark on metamathematics). Transitivity makes ω\omega, ordinals, functions and finite sets mean the same in MM as in VV.

Definition— names and the generic extension

By recursion, a PP-name is a set of pairs (σ,p)(\sigma, p) where σ\sigma is a PP-name and p∈Pp \in P; let MPM^P be the set of PP-names in MM. For a filter GG, the interpretation of a name is τG={σG:(σ,p)∈τ for some p∈G}\tau^G = \{\sigma^G : (\sigma, p) \in \tau \text{ for some } p \in G\}, and the generic extension is M[G]={τG:τ∈MP}M[G] = \{\tau^G : \tau \in M^P\}. Each x∈Mx \in M has the check name xˇ={(yˇ,1):y∈x}\check x = \{(\check y, \mathbb 1) : y \in x\} with xˇG=x\check x^G = x, and G˙={(pˇ,p):p∈P}\dot G = \{(\check p, p) : p \in P\} satisfies G˙G=G\dot G^G = G.

Definition— the forcing relation

For p∈Pp \in P, a formula φ\varphi and names τ1,…,τn∈MP\tau_1, \dots, \tau_n \in M^P, p⊩φ(τ1,…,τn)p \Vdash \varphi(\tau_1, \dots, \tau_n) means: for every MM-generic GG with p∈Gp \in G, M[G]⊨φ(τ1G,…,τnG)M[G] \models \varphi(\tau_1^G, \dots, \tau_n^G).

Definition— Cohen forcing and the ccc

For a set II, Fn(I,2)\mathrm{Fn}(I, 2) is the set of finite partial functions from II to 22, ordered by reverse inclusion (p≤qp \le q iff p⊇qp \supseteq q), with 1=∅\mathbb 1 = \varnothing. Cohen forcing adding κ\kappa reals is Add(ω,κ)=Fn(κ×ω,2)\mathrm{Add}(\omega, \kappa) = \mathrm{Fn}(\kappa \times \omega, 2). A forcing notion has the countable chain condition (ccc) if every antichain is countable.

Worked examplesH

Generic filters: existence, non-examples, Cohen reals

Theorem— Rasiowa–Sikorski lemma

If PP is a preorder, p∈Pp \in P, and D\mathcal D is a countable family of dense subsets of PP, there is a filter GG with p∈Gp \in G meeting every D∈DD \in \mathcal D. In particular, if MM is a ctm and P∈MP \in M, then MM-generic filters exist.

Proof

Enumerate D={D0,D1,… }\mathcal D = \{D_0, D_1, \dots\}. Put p0=pp_0 = p and, using density, choose pn+1≤pnp_{n+1} \le p_n with pn+1∈Dnp_{n+1} \in D_n. Then G={q∈P:pn≤q for some n}G = \{q \in P : p_n \le q \text{ for some } n\} is a filter (two members lie above pnp_n and pmp_m, hence both above pmax⁡(n,m)∈Gp_{\max(n, m)} \in G) and meets each DnD_n at pn+1p_{n+1}. If MM is countable, so is the family of dense sets belonging to MM.

∎

Example— Trivial forcing

If PP is finite, every filter GG contains a common extension rr of its finitely many members, and then G={q:q≥r}G = \{q : q \ge r\}; so G∈MG \in M and M[G]=MM[G] = M. Forcing does something only when conditions keep splitting, as the next lemma shows.

Theorem— Lemma (generic filters are new)

Suppose every condition of PP has two incompatible extensions, and GG is MM-generic. Then G∉MG \notin M.

Proof

If G∈MG \in M, then D=P∖GD = P \setminus G is in MM, and it is dense: any pp has incompatible extensions q,rq, r, and a filter cannot contain both, so one of them is in DD. But GG does not meet DD, contradicting genericity.

∎

The lemma also explains why we cannot simply force over the whole universe VV: there is no filter meeting every dense set, because P∖GP \setminus G is always dense. A ctm has only countably many dense sets, which Rasiowa–Sikorski can meet.

Theorem— Theorem (Cohen reals)

Let MM be a ctm, P=Fn(ω,2)P = \mathrm{Fn}(\omega, 2) and GG an MM-generic filter. Then g=⋃Gg = \bigcup G is a function from ω\omega to 22, and g∉Mg \notin M.

Proof

Any two members of GG are compatible, so ⋃G\bigcup G is a function. For n∈ωn \in \omega, Dn={p:n∈dom⁡p}D_n = \{p : n \in \operatorname{dom} p\} is dense and in MM, so GG meets it and n∈dom⁡gn \in \operatorname{dom} g. For x∈M∩ω2x \in M \cap {}^\omega 2, the set Ex={p:p(n)≠x(n) for some n∈dom⁡p}E_x = \{p : p(n) \neq x(n) \text{ for some } n \in \operatorname{dom} p\} is dense (extend pp at a new point nn by 1−x(n)1 - x(n)) and in MM; a condition p∈G∩Exp \in G \cap E_x shows g≠xg \neq x.

∎

ProofH

The generic extension and the failure of CH

Theorem— Generic model theorem (Cohen 1963)

Let MM be a ctm of ZFC, P∈MP \in M a forcing notion and GG an MM-generic filter. Then M[G]M[G] is a ctm of ZFC, M⊆M[G]M \subseteq M[G], G∈M[G]G \in M[G], MM and M[G]M[G] have the same ordinals, and every transitive model of ZF containing M∪{G}M \cup \{G\} contains M[G]M[G].

Theorem— Forcing theorem

(Truth) M[G]⊨φ(τ1G,…,τnG)M[G] \models \varphi(\tau_1^G, \dots, \tau_n^G) if and only if p⊩φ(τ1,…,τn)p \Vdash \varphi(\tau_1, \dots, \tau_n) for some p∈Gp \in G. (Definability) For each φ\varphi, the relation p⊩φ(τ1,…,τn)p \Vdash \varphi(\tau_1, \dots, \tau_n) — for p∈Pp \in P and τi∈MP\tau_i \in M^P — is definable in MM.

Both are proved by defining, inside MM, a relation ⊩∗\Vdash^* by recursion on formulas and on the ranks of names — for atomic formulas by a simultaneous recursion, and then p⊩∗¬φp \Vdash^* \neg\varphi iff no q≤pq \le p forces φ\varphi, p⊩∗∀x φp \Vdash^* \forall x\, \varphi iff p⊩∗φ(τ)p \Vdash^* \varphi(\tau) for every name τ\tau — and showing by induction that ⊩∗\Vdash^* agrees with ⊩\Vdash, using genericity at the negation step. The ZFC axioms in M[G]M[G] then follow: pairing, union and infinity by explicit names; separation and power set from definability of forcing; replacement from reflection in MM. Kunen (1980, chapter VII) gives every detail.

To make CH fail we need two more ingredients: a combinatorial lemma, and the fact that ccc forcing does not collapse cardinals.

Theorem— Δ-system lemma

Every uncountable family A\mathcal A of finite sets has an uncountable subfamily B\mathcal B that is a Δ-system: there is a finite set RR (the root) with a∩b=Ra \cap b = R for all distinct a,b∈Ba, b \in \mathcal B.

Proof

Uncountably many members of A\mathcal A have the same size nn, so assume all do, and induct on nn. For n=1n = 1, distinct singletons are pairwise disjoint (root ∅\varnothing). For n>1n \gt 1: if some point xx lies in uncountably many members, apply the induction hypothesis to {a∖{x}:x∈a∈A}\{a \setminus \{x\} : x \in a \in \mathcal A\} and add xx back to the root. Otherwise every point lies in only countably many members; then choose aξa_\xi for ξ<ω1\xi \lt \omega_1 by recursion, each disjoint from ⋃η<ξaη\bigcup_{\eta \lt \xi} a_\eta — possible because this union is countable and only countably many members meet it. The aξa_\xi are pairwise disjoint.

∎

Theorem— Lemma (Cohen forcing is ccc)

For every set II, Fn(I,2)\mathrm{Fn}(I, 2) has the countable chain condition.

Proof

Let {pξ:ξ<ω1}\{p_\xi : \xi \lt \omega_1\} be uncountably many conditions. By the Δ-system lemma, uncountably many of the domains dom⁡pξ\operatorname{dom} p_\xi form a Δ-system with root RR. There are only 2∣R∣2^{|R|} functions R→2R \to 2, so uncountably many of these pξp_\xi agree on RR. Any two of them agree where their domains overlap, so their union is a common extension: they are compatible. Hence there is no uncountable antichain.

∎

A ccc forcing preserves cardinals (and cofinalities). In outline: if f∈M[G]f \in M[G] maps AA into BB (with A,B∈MA, B \in M), fix a name f˙\dot f and a condition p0∈Gp_0 \in G forcing that f˙\dot f is such a function. In MM let F(a)F(a) be the set of bb for which some q≤p0q \le p_0 forces f˙(aˇ)=bˇ\dot f(\check a) = \check b. Conditions forcing different values are incompatible, so by the ccc each F(a)F(a) is countable, and f(a)∈F(a)f(a) \in F(a) by the truth lemma. If in M[G]M[G] some ff mapped an infinite μ\mu onto an MM-cardinal λ>μ\lambda \gt \mu, then in MM the countable sets F(α)F(\alpha), α<μ\alpha \lt \mu, would cover λ\lambda, giving λ≤∣μ∣⋅ℵ0<λ\lambda \le |\mu| \cdot \aleph_0 \lt \lambda.

Theorem— Cohen (1963): Con(ZFC) implies Con(ZFC + ¬CH)

Let MM be a ctm of ZFC, let κ=ℵ2M\kappa = \aleph_2^M, and let GG be MM-generic for P=Fn(κ×ω,2)MP = \mathrm{Fn}(\kappa \times \omega, 2)^M. Then M[G]⊨2ℵ0≥ℵ2M[G] \models 2^{\aleph_0} \ge \aleph_2.

Proof

Let g=⋃G:κ×ω→2g = \bigcup G : \kappa \times \omega \to 2 (a function, total by density) and gα(n)=g(α,n)g_\alpha(n) = g(\alpha, n). For α≠β\alpha \neq \beta in κ\kappa the set of conditions pp with p(α,n)≠p(β,n)p(\alpha, n) \neq p(\beta, n) for some nn is dense and in MM, so gα≠gβg_\alpha \neq g_\beta. Hence α↦gα\alpha \mapsto g_\alpha is an injection, in M[G]M[G], of κ\kappa into ω2{}^\omega 2. By the ccc, PP preserves cardinals, so κ=ℵ2M=ℵ2M[G]\kappa = \aleph_2^M = \aleph_2^{M[G]}, and M[G]⊨2ℵ0≥ℵ2M[G] \models 2^{\aleph_0} \ge \aleph_2.

∎

Counting "nice names" shows more precisely that M[G]⊨2ℵ0=κM[G] \models 2^{\aleph_0} = \kappa whenever M⊨κℵ0=κM \models \kappa^{\aleph_0} = \kappa. Combined with Gödel's LL: if ZFC is consistent, it neither proves nor refutes CH.

Note

Metamathematics. We do not know that a ctm of ZFC exists — its existence implies Con(ZFC)\mathrm{Con}(\mathsf{ZFC}). The relative consistency proof avoids it: if ZFC+¬CH\mathsf{ZFC} + \neg\mathsf{CH} proved a contradiction, the proof would use finitely many axioms Φ\Phi. By reflection, Löwenheim–Skolem and the Mostowski collapse, ZFC proves that every finite fragment of ZFC has a ctm; choosing a fragment large enough that the argument above makes M[G]M[G] satisfy Φ∪{¬CH}\Phi \cup \{\neg\mathsf{CH}\}, ZFC would prove that Φ∪{¬CH}\Phi \cup \{\neg\mathsf{CH}\} has a model, hence is consistent — contradicting the assumed proof of a contradiction. Alternatively, Boolean-valued models (Scott, Solovay, Vopěnka) force over VV itself without any countable model.

ExplanationH

What forcing has shown

  • The continuum function. Easton (1970): for regular cardinals, κ↦2κ\kappa \mapsto 2^\kappa can be any class function FF that is non-decreasing and satisfies cf⁡(F(κ))>κ\operatorname{cf}(F(\kappa)) \gt \kappa (König's restriction) — forced by a class-sized product of Cohen-type forcings. At singular cardinals the picture is subtler (Silver, Shelah's pcf theory, and Magidor's and Gitik's large-cardinal forcing constructions).
  • Suslin's hypothesis (a complete dense linear order without endpoints in which every family of pairwise disjoint open intervals is countable is isomorphic to R\R) is independent: Jech (1967) and Tennenbaum (1968) forced a Suslin line, and Solovay and Tennenbaum (1971) used iterated ccc forcing to make Suslin's hypothesis true.
  • Martin's axiom (Martin and Solovay, 1970) — "for every ccc forcing and fewer than 2ℵ02^{\aleph_0} dense sets there is a filter meeting them all" — is consistent with ¬\negCH and settles many questions of topology and analysis.
  • Choice and measurability. Cohen also showed that AC is independent of ZF (using symmetric submodels). Solovay (1970), starting from an inaccessible cardinal, built a model of ZF+DC\mathsf{ZF} + \mathsf{DC} in which every set of reals is Lebesgue measurable.
  • Algebra and analysis. Shelah's solution of Whitehead's problem (1974) and the Dales–Esterle / Solovay–Woodin results on automatic continuity show that questions of pure algebra and analysis can be independent.
  • Forcing axioms. Shelah's proper forcing and the forcing axioms PFA and MM (Baumgartner; Foreman, Magidor and Shelah) decide many such questions; PFA implies 2ℵ0=ℵ22^{\aleph_0} = \aleph_2 (Todorčević; Veličković).
Formal mathematicsF

The combinatorics of genericity in Lean

Mathlib does not formalise forcing over models of ZFC. The Lean module formalises the combinatorial core of Cohen forcing, using conditions that are finite binary strings (equivalent, as a forcing, to Fn(ω,2)\mathrm{Fn}(\omega, 2)). It uses the extension order, in which p ≤ q means "q extends p"; in that order Mathlib's Order.Cofinal sets are the dense sets and Mathlib's Order.Ideals are the filters.

CohenLean 4Formally verified
/-- **Cohen forcing**: a condition is a finite binary string `p = (p₀, …, p_{k-1})`, a finite
approximation to an infinite binary sequence ("a real"). -/
structure Cohen where
  /-- The finite binary string. -/
  bits : List Bool
Axioms used: No axiomsformal/Lumenary/Forcing.leanTry it in the Lean web editor
instPreorderLean 4Formally verified
/-- The extension order: `p ≤ q` iff `p` is an initial segment (prefix) of `q`, i.e. `q` carries
at least as much information as `p`. -/
instance instPreorder : Preorder Cohen where
  le p q := p.bits <+: q.bits
  le_refl p := List.prefix_refl p.bits
  le_trans _ _ _ := List.IsPrefix.trans
Axioms used: propextformal/Lumenary/Forcing.leanTry it in the Lean web editor
bitLean 4Formally verified
/-- The `i`-th bit decided by the condition `p`, if `p` is long enough. -/
def bit (p : Cohen) (i : ℕ) : Option Bool := p.bits[i]?
Axioms used: propextformal/Lumenary/Forcing.leanTry it in the Lean web editor
bit_monoLean 4Proved here from basic factsFormally verified
/-- Stronger conditions keep the decisions of weaker ones: if `p ≤ q` and `p` says bit `i` is
`b`, so does `q`. -/
theorem bit_mono {p q : Cohen} (h : p ≤ q) {i : ℕ} {b : Bool} (hb : bit p i = some b) :
    bit q i = some b := by
  obtain ⟨hi, rfl⟩ := List.getElem?_eq_some_iff.mp hb
  exact List.prefix_iff_getElem?.mp h i hi
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor

The two families of dense sets used in the proof of the Cohen-real theorem:

decides_denseLean 4Proved here from basic factsFormally verified
/-- For each `n`, the set of conditions that decide bit `n` is **dense**: any condition can be
extended (by padding with zeros) to one of length greater than `n`. -/
theorem decides_dense (n : ℕ) : IsCofinal {p : Cohen | (bit p n).isSome} := by
  intro p
  refine ⟨⟨p.bits ++ List.replicate (n + 1) false⟩, ?_, List.prefix_append _ _⟩
  show (p.bits ++ List.replicate (n + 1) false)[n]?.isSome
  rw [Option.isSome_iff_ne_none, Ne, List.getElem?_eq_none_iff, not_le,
    List.length_append, List.length_replicate]
  omega
Axioms used: propext, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor
avoids_denseLean 4Proved here from basic factsFormally verified
/-- For each real `x : ℕ → Bool`, the set of conditions that **disagree with `x` somewhere** is
dense: extend `p` by one bit, the opposite of `x` at position `length p`. Meeting this set is
how a generic real escapes `x` — a diagonal argument, one step at a time. -/
theorem avoids_dense (x : ℕ → Bool) : IsCofinal {p : Cohen | ∃ i, bit p i = some (!x i)} := by
  intro p
  refine ⟨⟨p.bits ++ [!x p.bits.length]⟩, ⟨p.bits.length, ?_⟩, List.prefix_append _ _⟩
  show (p.bits ++ [!x p.bits.length])[p.bits.length]? = _
  simp
Axioms used: propextformal/Lumenary/Forcing.leanTry it in the Lean web editor
decidesLean 4Formally verified
/-- The dense set "bit `n` is decided", bundled as a Mathlib `Order.Cofinal`. -/
def decides (n : ℕ) : Order.Cofinal Cohen := ⟨{p | (bit p n).isSome}, decides_dense n⟩
Axioms used: propext, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor
avoidsLean 4Formally verified
/-- The dense set "disagrees with `x` somewhere", bundled as a Mathlib `Order.Cofinal`. -/
def avoids (x : ℕ → Bool) : Order.Cofinal Cohen :=
  ⟨{p | ∃ i, bit p i = some (!x i)}, avoids_dense x⟩
Axioms used: propextformal/Lumenary/Forcing.leanTry it in the Lean web editor

Mathlib proves the Rasiowa–Sikorski lemma (Order.idealOfCofinals):

rasiowa_sikorskiLean 4Applies a library theoremFormally verified
/-- **The Rasiowa–Sikorski lemma**: for any *countable* family of dense sets in a preorder there
is a filter (here: an `Order.Ideal` of the extension order) meeting all of them. Its proof
builds a sequence `p₀ ≤ p₁ ≤ ⋯` with `p_{n+1}` in the `n`-th dense set. This applies Mathlib's
`Order.idealOfCofinals` and `Order.cofinal_meets_idealOfCofinals`. -/
theorem rasiowa_sikorski {P : Type*} [Preorder P] (p : P) {ι : Type*} [Encodable ι]
    (D : ι → Order.Cofinal P) : ∃ G : Order.Ideal P, p ∈ G ∧ ∀ i, ∃ q ∈ D i, q ∈ G :=
  ⟨Order.idealOfCofinals p D, Order.mem_idealOfCofinals p D,
    Order.cofinal_meets_idealOfCofinals p D⟩
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor

A filter meeting every decides n determines a real, and meeting avoids x makes it different from x. With the countable list standing for the reals of a ctm MM, this is the Cohen-real theorem:

generic_realLean 4Proved here from basic factsFormally verified
/-- **A generic filter determines a real.** If a filter `G` meets every dense set `decides n`,
the conditions in `G` are compatible finite approximations of a single real `g`: every bit
decided by a member of `G` is the corresponding bit of `g`.
Proof: choose `pₙ ∈ G` deciding bit `n` and let `g n` be that bit. If `p ∈ G` decides bit `n`
as `b`, then `p` and `pₙ` have a common extension `r ∈ G` (directedness), which decides bit `n`
both as `b` and as `g n`. -/
theorem generic_real (G : Order.Ideal Cohen) (hG : ∀ n, ∃ p ∈ decides n, p ∈ G) :
    ∃ g : ℕ → Bool, ∀ p ∈ G, ∀ i b, bit p i = some b → g i = b := by
  choose q hqD hqG using hG
  -- `q n ∈ G` decides bit `n`; read that bit off.
  have hsome : ∀ n, ∃ b, bit (q n) n = some b := fun n => Option.isSome_iff_exists.mp (hqD n)
  choose g hg using hsome
  refine ⟨g, fun p hp i b hb => ?_⟩
  obtain ⟨r, -, hpr, hqr⟩ := G.directed p hp (q i) (hqG i)
  have h1 : bit r i = some b := bit_mono hpr hb
  have h2 : bit r i = some (g i) := bit_mono hqr (hg i)
  exact Option.some.inj (h2.symm.trans h1)
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor
cohen_real_not_in_listLean 4Proved here from basic factsFormally verified
/-- **Cohen reals are new.** For every countable list `x₀, x₁, …` of reals there is a real `g`
different from all of them — obtained, as in forcing, from a filter meeting the countably many
dense sets `decides n` and `avoids xₖ`. With the list taken to be the reals of a countable
transitive model `M`, this is the statement that the Cohen real of `M[G]` is not in `M`.
(Cantor's diagonal argument, rebuilt from genericity.) -/
theorem cohen_real_not_in_list (xs : ℕ → ℕ → Bool) : ∃ g : ℕ → Bool, ∀ k, g ≠ xs k := by
  obtain ⟨G, -, hG⟩ := rasiowa_sikorski (⟨[]⟩ : Cohen)
    (fun j : ℕ ⊕ ℕ => Sum.elim decides (fun k => avoids (xs k)) j)
  obtain ⟨g, hg⟩ := generic_real G (fun n => hG (Sum.inl n))
  refine ⟨g, fun k hk => ?_⟩
  obtain ⟨p, ⟨i, hi⟩, hpG⟩ := hG (Sum.inr k)
  have := hg p hpG i _ hi
  rw [hk] at this
  exact Bool.not_ne_self (xs k i) this.symm
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor

And the reason forcing starts from a countable model — no filter meets every dense set:

no_filter_meets_every_denseLean 4Proved here from basic factsFormally verified
/-- **No filter meets every dense set.** For any filter `G`, the complement of `G` is dense, and
`G` does not meet it. Proof: any `p` has the two incompatible extensions `p⌢0` and `p⌢1`; a
filter cannot contain both (they have no common extension), so one lies outside `G`. This is why
forcing begins with a *countable* model `M`: we only ask `G` to meet the dense sets that belong
to `M`, and then `G ∉ M`. -/
theorem no_filter_meets_every_dense (G : Order.Ideal Cohen) :
    ∃ D : Set Cohen, IsCofinal D ∧ ∀ p ∈ D, p ∉ G := by
  refine ⟨(G : Set Cohen)ᶜ, ?_, fun p hp => hp⟩
  intro p
  by_contra h
  push Not at h
  -- Both one-bit extensions of `p` would lie in `G` ...
  have hin : ∀ b : Bool, (⟨p.bits ++ [b]⟩ : Cohen) ∈ (G : Set Cohen) := by
    intro b
    by_contra hb
    exact h _ hb (List.prefix_append _ _)
  -- ... so they would have a common extension `r`, forcing `p⌢1 = p⌢0`.
  obtain ⟨r, -, h1, h2⟩ := G.directed _ (hin true) _ (hin false)
  have hpre := List.prefix_of_prefix_length_le h1 h2 (by simp)
  have heq := hpre.eq_of_length (by simp)
  simp at heq
Axioms used: propext, Classical.choice, Quot.soundformal/Lumenary/Forcing.leanTry it in the Lean web editor

Not formalised here: names, the forcing relation and the forcing theorem, M[G]⊨ZFCM[G] \models \mathsf{ZFC}, the Δ-system lemma, the ccc and preservation of cardinals. The full independence of CH has been formalised elsewhere: in Lean 3 by Jesse Michael Han and Floris van Doorn (the Flypitch project, 2019–2020, with Boolean-valued models) and in Isabelle/ZF by Emmanuel Gunther, Miguel Pagano, Pedro Sánchez Terraf and Matías Steinberg (with countable transitive models).

ComputationC

Building a generic real

The experiment runs the Rasiowa–Sikorski construction against a finite stand-in for a ground model: a list of reals given by rules (primes, squares, the Thue–Morse sequence, the binary digits of 2\sqrt 2, and every eventually periodic sequence with short preperiod and period). It meets the dense sets "decide bit nn" and "disagree with xx" in turn, and checks that the resulting condition disagrees with every listed real. Then it checks the other half: the filter of initial segments of a real gg misses the dense set "disagree with gg".

A Cohen generic real escapes a list of ground-model realsPythonExact computationExhaustive finite checkComputationally tested
"""Building a Cohen generic real against a list of "ground model" reals.

In Cohen forcing a condition is a finite binary string, and a stronger
condition extends it. A dense set is a requirement that every condition can
be extended to meet: "decide bit n", or "disagree with the real x somewhere".
A filter meeting countably many dense sets is built step by step (the
Rasiowa-Sikorski lemma): extend the current condition into the next dense
set, forever.

Here the "ground model" is a finite stand-in: a list of reals given by rules
(some famous sequences, and every eventually periodic sequence with short
preperiod and period). We meet the dense sets "avoid x" for each listed real
and "decide bit n" for n < 32, interleaved, and check that the resulting
condition disagrees with every listed real - the generic real is new. Then
we check the other half of the story: the filter of initial segments of any
real g misses the dense set "disagree with g", so no filter meets every dense
set.

Runs unchanged in the browser (Pyodide) using only the standard library.
"""

from itertools import product
from math import isqrt
import textwrap

def _prime(n):
    """Trial-division primality test."""
    return n >= 2 and all(n % d for d in range(2, isqrt(n) + 1))

def _eventually_periodic(pre, cycle):
    """The real pre + cycle + cycle + ... as a rule."""
    return lambda n: pre[n] if n < len(pre) else cycle[(n - len(pre)) % len(cycle)]

def ground_reals():
    """A list of (name, rule) pairs standing in for the reals of a model M."""
    reals = [
        ("primes", lambda n: int(_prime(n))),
        ("squares", lambda n: int(isqrt(n) ** 2 == n)),
        ("Thue-Morse", lambda n: bin(n).count("1") % 2),
        ("sqrt 2 digits", lambda n: isqrt(2 << (2 * (n + 1))) & 1),
    ]
    for pre_len in range(3):
        for cycle_len in range(1, 4):
            for bits in product((0, 1), repeat=pre_len + cycle_len):
                pre, cycle = bits[:pre_len], bits[pre_len:]
                name = "".join(map(str, pre)) + "(" + "".join(map(str, cycle)) + ")"
                reals.append((name, _eventually_periodic(pre, cycle)))
    return reals

def meet_decide(p, n):
    """Extend p (if needed) so that it decides bit n, padding with zeros."""
    return p + (0,) * max(0, n + 1 - len(p))

def disagreement(p, x):
    """A position where condition p disagrees with the real x, or None."""
    return next((i for i, b in enumerate(p) if b != x(i)), None)

def meet_avoid(p, x):
    """Extend p (if needed) so that it disagrees with x somewhere."""
    if disagreement(p, x) is not None:
        return p
    return p + (1 - x(len(p)),)

def build_generic(reals, bits):
    """Meet 'avoid x_k' and 'decide n' alternately; return the final condition
    and the list of conditions p_0 <= p_1 <= ... that were built."""
    p, chain = (), [()]
    for step in range(max(len(reals), bits)):
        if step < len(reals):
            p = meet_avoid(p, reals[step][1])
            chain.append(p)
        if step < bits:
            p = meet_decide(p, step)
            chain.append(p)
    return p, chain

def is_chain(conditions):
    """Is each condition an initial segment of the next (a descending chain)?"""
    return all(q[:len(p)] == p for p, q in zip(conditions, conditions[1:]))

def main():
    reals = ground_reals()
    g, chain = build_generic(reals, 32)
    print(f"Ground reals listed: {len(reals)} rules (some repeat a real)")
    print(f"Dense sets met: {len(reals)} of the form 'avoid x', 32 'decide bit n'")
    print(f"Conditions built: {len(chain)}, each extending the last: {is_chain(chain)}")
    print(f"Generic condition, {len(g)} bits:")
    text = "".join(map(str, g))
    for start in range(0, len(text), 64):
        print("   " + text[start:start + 64])
    positions = [disagreement(g, x) for _, x in reals]
    print(f"Disagrees with every listed real: {all(i is not None for i in positions)}")
    for name, x in reals[:6]:
        print(f"   {name:<14} first disagreement at bit {disagreement(g, x)}")
    print(f"   ... and {len(reals) - 6} eventually periodic reals")
    print()
    real_g = _eventually_periodic(g, (0,))
    misses = all(disagreement(g[:k], real_g) is None for k in range(len(g) + 1))
    print("The filter of initial segments of g (padded with zeros) contains no")
    print(f"condition disagreeing with g: {misses} - it misses that dense set.")
    print()
    print(textwrap.fill(
        "Epistemic status: exact computation for a finite list of reals and "
        "finitely many dense sets. It illustrates the Rasiowa-Sikorski "
        "construction and why a generic real is new; the real theorem - that "
        "for a countable transitive model M a generic G exists, G is not in M, "
        "and M[G] satisfies ZFC - is proved in the lesson, not here.",
        width=78,
    ))

if __name__ == "__main__":
    main()
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

This is exact evidence about one finite construction; the theorems — existence of generics over a ctm, G∉MG \notin M, M[G]⊨ZFCM[G] \models \mathsf{ZFC} — are proved above.

Explore

Explore: genericity is diagonalisation

Meeting the dense set "disagree with xkx_k" is one step of a diagonal argument. In the widget, the flipped diagonal escapes every listed sequence; a Cohen generic does the same against all the reals of MM, one dense set at a time, and also meets every other requirement that MM can formulate.

The diagonal machine

Here is a list of infinite 0–1 sequences (we can only show the start). The gold sequence d flips the diagonal.

s1…
s2…
s3…
s4…
s5…
s6…
d101001????…

Point at (or tab to) a row to see where d differs from it. Click any digit to change the list.

Add d to the list and a new d appears that is different again. No list — however long — can contain every sequence.

Notice the difference from Cantor's argument: Cantor builds one particular sequence from the list, whereas a generic real is not built from anything in MM; any real that meets the countably many dense sets of MM will do.

Exercises

Exercises

1. Forcing and independence

Warm-upHuman

In Cohen forcing Fn(ω,2)\mathrm{Fn}(\omega, 2) (finite partial functions, stronger = larger), which of these sets are dense? Choose all that apply.

Choose all that apply

2. Forcing and independence

Warm-upHuman

How many conditions does Fn(3,2)\mathrm{Fn}(3, 2) have, i.e. how many partial functions from {0,1,2}\{0, 1, 2\} to {0,1}\{0, 1\} are there (including the empty function 1\mathbb 1)?

3. Forcing and independence

CoreHuman

Why does the classical presentation of forcing start from a countable transitive model MM?

Choose one

4. Forcing and independence

CoreHuman

In the proof that an MM-generic filter GG (for a forcing in which every condition has two incompatible extensions) is not in MM, which dense set does GG fail to meet if G∈MG \in M?

Choose one

5. Forcing and independence

CoreHuman

The proof that Fn(I,2)\mathrm{Fn}(I, 2) has the countable chain condition takes uncountably many conditions pξp_\xi. What is the key step?

Choose one

6. Forcing and independence

StretchHuman

Assuming ZFC is consistent, which of these statements are independent of ZFC? Choose all that apply.

Choose all that apply

7. Forcing and independence

CoreFormal

The Lean file orders Cohen conditions by extension: p ≤ q means q extends p. In this order, what does Mathlib's Order.Ideal Cohen correspond to in forcing?

Choose one

8. Forcing and independence

CoreFormal

The theorem no_filter_meets_every_dense (G : Order.Ideal Cohen) : ∃ D : Set Cohen, IsCofinal D ∧ ∀ p ∈ D, p ∉ G is proved with which witness D?

Choose one

9. Forcing and independence

StretchComputational

Write escape(reals, n): given a list of reals (functions from naturals to {0,1}\{0, 1\}) and nn, return a tuple of bits pp of length at least nn that disagrees with every listed real at some position. This is the Rasiowa–Sikorski construction for the dense sets 'decide bit kk' (k<nk \lt n) and 'disagree with xx'.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.
Common misconceptionsH

Common misconceptions

Misconception

"If CH is independent, the question is meaningless." Independence means that ZFC does not settle it. Some set theorists regard CH as having a definite truth value to be found by new, justified axioms (Gödel's view; Woodin's programme), others as having no single answer (Hamkins's multiverse view). Mathematically, independence is a precise theorem about provability.

Misconception

"Forcing needs a countable transitive model of ZFC to exist." Formal relative consistency proofs use ctms of finite fragments, which ZFC proves to exist, or Boolean-valued models, which need no countable model at all. The ctm presentation is a convenient fiction that can always be eliminated.

Misconception

"M[G]M[G] is MM with one new element." M[G]M[G] contains GG and everything definable from it and parameters in MM — the interpretations of all names — for instance ℵ2\aleph_2 many new reals in Cohen's model. It is the least transitive model of ZF containing M∪{G}M \cup \{G\}.

Misconception

"Forcing shows that CH is false." Forcing produces models of ¬\negCH; LL is a model of CH. Neither shows what is true "in VV"; together they show that ZFC proves neither.

ViewpointsH

Many ways of seeing

Topology— Generic means comeagre

Give 2ω2^\omega the product topology. A dense set DD of Cohen conditions determines the open set UD=⋃p∈D[p]U_D = \bigcup_{p \in D} [p], where [p][p] is the basic clopen set of reals extending pp, and UDU_D is dense in 2ω2^\omega. Meeting DD means g∈UDg \in U_D. So a Cohen real over MM lies in the intersection of countably many dense open sets, and the Rasiowa–Sikorski lemma is the Baire category theorem in disguise. Precisely, gg is Cohen-generic over MM if and only if gg belongs to no meagre Borel set coded in MM (Solovay). In general a forcing notion PP carries a topology whose regular open sets form the complete Boolean algebra RO(P)\mathrm{RO}(P), and forcing with PP is forcing with RO(P)\mathrm{RO}(P).

Probability— Random reals

Replace "meagre" by "measure zero": random forcing (Solovay, 1970) has as conditions the Borel subsets of [0,1][0, 1] of positive Lebesgue measure, ordered by inclusion. A random real over MM lies in no null Borel set coded in MM — it is "typical" in the sense of probability, passing every statistical test that MM can describe. Adding ℵ2\aleph_2 random reals also makes CH fail, but the resulting model differs from Cohen's: for instance, random forcing adds no Cohen real. The duality between category and measure (Oxtoby) becomes a duality between forcings.

Analysis— Independence in analysis

Is every algebra homomorphism from C(X)C(X) (continuous functions on a compact Hausdorff space) into a Banach algebra continuous? Kaplansky asked this. Dales and Esterle (independently, around 1976–78) showed that under CH there is a discontinuous one; Solovay and Woodin showed that it is consistent with ZFC that every such homomorphism is continuous. Forcing thus settled a question of functional analysis by showing it undecidable. Solovay's model, in which every set of reals is Lebesgue measurable (in ZF+DC\mathsf{ZF} + \mathsf{DC}), shows that the use of choice in constructing non-measurable sets is unavoidable (see measure theory).

Category theory— Sheaves on the poset of conditions

Lawvere and Tierney recast Cohen's proof in topos theory (Tierney, 1972): take the category of sheaves on the poset Fn(ℵ2×ω,2)\mathrm{Fn}(\aleph_2 \times \omega, 2) for the double-negation (dense) topology. This is a Boolean topos with a natural number object NN and a monomorphism from the constant object on ℵ2\aleph_2 into the power object of NN, in which the internal continuum hypothesis fails. Mac Lane and Moerdijk (1992, chapter VI) present the independence of CH in this way. The topos has no points, the categorical form of "no filter meets every dense set": a generic filter is a point that exists only from the outside. See elementary topoi.

Logic— Boolean-valued models

Scott, Solovay and Vopěnka (1965–67) replaced the generic filter by truth values: for a complete Boolean algebra BB, the universe VBV^B of BB-valued sets assigns to each sentence φ\varphi a value [ ⁣[φ] ⁣]∈B[\![\varphi]\!] \in B, with every axiom of ZFC receiving value 11. For B=RO(Fn(ℵ2×ω,2))B = \mathrm{RO}(\mathrm{Fn}(\aleph_2 \times \omega, 2)), [ ⁣[¬CH] ⁣]=1[\![\neg\mathsf{CH}]\!] = 1. Forcing becomes order: p⊩φp \Vdash \varphi corresponds to p≤[ ⁣[φ] ⁣]p \le [\![\varphi]\!]. Quotienting VBV^B by any ultrafilter gives a two-valued (possibly ill-founded) model; over a ctm with a generic ultrafilter one recovers M[G]M[G].

Wonder Trails

Wonder Trail

History & global context

History and context

  • Paul Cohen announced the independence of CH and AC in 1963 (published in the Proceedings of the National Academy of Sciences, 1963–64) and received the Fields Medal in 1966; his book Set Theory and the Continuum Hypothesis appeared in 1966.
  • Robert Solovay, Dana Scott and, independently in Prague, Petr Vopěnka developed Boolean-valued models (1965–67). Solovay's random reals and his measurable model followed in 1970.
  • William Easton (1970) determined the possible values of 2κ2^\kappa at regular cardinals. Donald A. Martin and Solovay (1970) introduced Martin's axiom, and Solovay and Stanley Tennenbaum (1971) proved the consistency of Suslin's hypothesis; Thomas Jech and Tennenbaum had forced Suslin lines in 1967–68.
  • Saharon Shelah developed proper forcing and solved Whitehead's problem (1974); Myles Tierney and F. William Lawvere reformulated the independence of CH in topos theory (1972); Stevo Todorčević, Boban Veličković and others analysed forcing axioms.
Further reading

Further reading

  • Kenneth Kunen, Set Theory: An Introduction to Independence Proofs (1980; revised edition Set Theory, 2011) — chapters VII–VIII, the standard first course.
  • Thomas Jech, Set Theory (Third Millennium Edition, 2003) — chapters 14–15 and the later chapters on iterated forcing.
  • Paul J. Cohen, Set Theory and the Continuum Hypothesis (1966).
  • Nik Weaver, Forcing for Mathematicians (2014) — a short route for non-specialists.
  • Timothy Y. Chow, "A beginner's guide to forcing" (2009) — the ideas without the technicalities.
  • John L. Bell, Set Theory: Boolean-Valued Models and Independence Proofs (3rd edition, 2005).
  • Saunders Mac Lane and Ieke Moerdijk, Sheaves in Geometry and Logic (1992), chapter VI.