Pointwise limits of continuous functions — Baire class 1. Thomae's function T(p/q)=1/q (reduced), T(x)=0 (irrational) is the pointwise limit of sums fn of disjoint tents. T is continuous at irrationals, discontinuous at rationals — a living example of Baire's theorem that the continuity points contain a dense Gδ.
For n≥2 let fn(x)=∑q1tri(n3(x−p/q)), summed over reduced fractions with 1≤q≤n, 0≤p≤q, gcd(p,q)=1, where tri(t)=max(0,1−∣t∣). Prove each fn is continuous on [0,1] and converges pointwise to Thomae's function T (1/q at reduced p/q, 0 at irrationals, T(0)=T(1)=1): fn(x)→T(x) for every x.
fn(x)=1≤q≤n0≤p≤qgcd(p,q)=1∑q1tri(n3(x−qp))
tent width n32<n(n−1)1≤ spacing of reduced fractions⟹disjoint tents
N=12: 47 pairwise disjoint tents. f12(1/2)=0.5, f12(2/2)=0, f12(1/3)=1/3 — the probes already match Thomae exactly. The proof below is the machine behind this pointwise convergence.Show proof
First, why the sum is over reduced fractions only. Summing over all pairs (p,q) counts each rational many times (1/2=2/4=3/6=⋯): at x=1/2 the stacked heights 1/2+1/4+1/6+⋯ would diverge, so the sum could never converge to Thomae. With reduced fractions each rational appears exactly once.
Each tent x↦tri(n3(x−p/q)) is continuous (a composition of continuous maps), and the sum is finite (at most ∑q≤n(q+1) terms), so fn is continuous. Also fn≥0.
The tents are pairwise disjoint. For distinct reduced fractions p/q=r/s with denominators ≤n, qp−sr=qs∣ps−qr∣≥qs1. If qs≤n(n−1) this is ≥1/(n(n−1)); if qs=n2 then q=s=n, so ∣ps−qr∣=n∣p−r∣≥n and the quotient is ≥1/n≥1/(n(n−1)). Hence the spacing is always ≥1/(n(n−1)).
Each tent's support has width 2/n3, and 2/n3<1/(n(n−1)) (since 2(n−1)<n2, i.e. (n−1)2+1>0). So no two tent supports overlap: at each x at most one tent is nonzero.
For rational x=a/b in lowest terms (0≤a≤b): if n≥b, the tent at (a,b) contributes b1tri(0)=1/b. Every other reduced p/q (q≤n) is at distance ≥1/(n(n−1))>1/n3 from x, so its tent vanishes at x. Hence fn(a/b)=1/b=T(a/b) — exact from n≥b onward.
For irrational x: given ε>0, pick an integer Q0≥1 with 1/Q0<ε. The reduced rationals in [0,1] with denominator ≤Q0 are finitely many, all different from x, so c:=min∣x−p/q∣>0. For n with n3c>1, the tents with denominator ≤Q0 miss x; every other tent has height ≤1/(Q0+1)<ε; and at most one tent is nonzero at x. Hence 0≤fn(x)<ε — i.e. fn(x)→0=T(x).
Prove Thomae's function T is discontinuous at every rational and continuous at every irrational. That is, the continuity set of T is exactly the irrationals — a dense Gδ.
T(x)={1/q0x=p/q in lowest termsx irrational
{x:T continuous at x}=R∖Q=q=1⋂∞p∈Z⋃(R∖{qp})
N=5: f5 is continuous, built from 11 tents. The limit T spikes (0.5,1/3) at the rationals 1/2,1/3 but sinks to 0 at irrationals — the proof below is why the split happens.Show proof
At a rational r=a/b in lowest terms, T(r)=1/b>0. The irrationals are dense, so there is a sequence of irrationals xk→r with T(xk)=0→1/b=T(r). Hence T is discontinuous at r.
At an irrational x0, T(x0)=0. Given ε>0, pick an integer M>1/ε. The rationals with 1/b≥ε, i.e. denominator b≤M, are finitely many in [x0−1,x0+1]. Let δ be the minimum distance from x0 to this finite set (δ>0 since x0 is irrational). Then for ∣x−x0∣<δ: if x is rational its denominator exceeds M, so T(x)<ε; if irrational, T(x)=0. Thus ∣T(x)−T(x0)∣<ε — T is continuous at x0.
Hence the continuity set is exactly the irrationals R∖Q. Each singleton {p/q} is closed, so its complement is open, and R∖Q=⋂q≥1⋃p(R∖{p/q}) is a countable intersection of open sets — a Gδ. The irrationals are dense, so it is a dense Gδ.
Let f:R→R be Baire class 1 (a pointwise limit of continuous functions). For the oscillation ωf(x)=inf{diamf(U):U a neighborhood of x}, prove each set {x:ωf(x)<1/k} is open and dense, and conclude via the Baire category theorem that the continuity set of f contains a dense Gδ.
ωf(x)=U∋xinfdiamf(U),ωf(x)=0⟺f continuous at x
{x:f continuous at x}⊇k=1⋂∞{x:ωf(x)<k1}, a dense Gδ
N=5: Thomae's function is Baire-1 yet discontinuous — but its continuity points (the irrationals) still form a dense Gδ. The proof below shows this holds for every Baire-1 function.Show proof
First, ωf(x)=0 iff f is continuous at x. (⇒) If ωf(x)=0, every ε>0 admits a neighborhood U with diamf(U)<ε, so ∣f(y)−f(x)∣≤diamf(U)<ε for y∈U. (⇐) If f is continuous at x, every ε>0 admits a neighborhood U with f(U)⊆(f(x)−ε,f(x)+ε), so diamf(U)≤2ε and ωf(x)≤2ε; ε arbitrary gives ωf(x)=0.
{x:ωf(x)<1/k} is open: if ωf(x0)<c<1/k, some neighborhood U has diamf(U)<c; for every x∈U, U is itself a neighborhood of x, so ωf(x)≤diamf(U)<c<1/k. Thus U⊆{ωf<1/k}.
Now density. Let fn→f pointwise with fn continuous. Cover R by closed intervals Vj (j∈Z) of length <1/(2k) whose interiors also cover R (e.g. Vj=[8kj−8k1,8kj+8k1]). Fix a nonempty open U0. For each x∈U0, f(x) lies in some int(Vj), and since fm(x)→f(x) there is n with fm(x)∈Vj for all m≥n. Hence U0=⋃n,jHn,j, where Hn,j={x∈U0:fm(x)∈Vj∀m≥n} is relatively closed in U0 (fm continuous, Vj closed).
U0, open in the complete space R, is itself a Baire space (the usual nested-closed-ball proof of Baire's theorem works verbatim inside U0, using completeness of R). Hence some Hn0,j0 has nonempty interior in U0: there is a nonempty open W⊆U0 with W⊆Hn0,j0. For y∈W, fm(y)∈Vj0 for all m≥n0, and Vj0 closed gives f(y)∈Vj0. So f(W)⊆Vj0 and diamf(W)<1/(2k). Since W is a neighborhood of each of its points x, ωf(x)≤diamf(W)<1/k. Thus W⊆U0∩{ωf<1/k}=∅ — {ωf<1/k} is dense.
Each {ωf<1/k} is open and dense, so by the Baire category theorem G:=⋂k=1∞{ωf<1/k} is a dense Gδ. By the first step, G⊆{ωf=0}= the continuity set of f, so the continuity set of f contains a dense Gδ. ∎