Alphabeta Math
DefinitionDefinition: Literature-sourcedProof: Not applicableSession-authored (Fable 5 assisted)judge pass (z-ai/glm-5.2)audited 2026-07-28
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced — the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted — a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated — a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

The Dirichlet function 1Q1_{\mathbb{Q}}, and Thomae's function tt with t(x)=1/qt(x) = 1/q at a rational x=p/qx = p/q in lowest terms with q1q \ge 1 and t(x)=0t(x) = 0 at every irrational xx

Definition

Throughout, NZQR\mathbb{N} \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R} denotes the chain of canonical embeddings (The naturals embed in the integers, The integers embed in the rationals, The rationals embed densely in the reals), and each set is identified with its image in R\mathbb{R}, as elsewhere in this library; for a natural qq the real ι(q)=q1R\iota(q) = q \cdot 1_{\mathbb{R}} is the canonical natural (The canonical natural ι(n)=n1F\iota(n) = n \cdot 1_F of a field), and ι(q)>0\iota(q) > 0 for q1q \ge 1 (Canonical naturals are positive and strictly increasing). A real is rational when it lies in Q\mathbb{Q} and irrational otherwise; both sets are dense in R\mathbb{R} (Both Q\mathbb{Q} and RQ\mathbb{R} \setminus \mathbb{Q} are dense in R\mathbb{R}, and every nonempty open subset of R\mathbb{R} is uncountable).

The Dirichlet function

1Q:RR,1Q(x):={1if xQ,0if xQ.\mathbf{1}_{\mathbb{Q}} : \mathbb{R} \to \mathbb{R}, \qquad \mathbf{1}_{\mathbb{Q}}(x) := \begin{cases} 1 & \text{if } x \in \mathbb{Q},\\ 0 & \text{if } x \notin \mathbb{Q}.\end{cases}

This is the indicator of the rationals. It is a function because every real either lies in Q\mathbb{Q} or does not, and the two clauses are exclusive.

The least denominator of a rational

Let xQx \in \mathbb{Q} and put

Q(x)  :=  {qN  :  q1  and  ι(q)xZ}.Q(x) \;:=\; \{\, q \in \mathbb{N} \;:\; q \ge 1 \ \text{ and } \ \iota(q)\,x \in \mathbb{Z} \,\}.

Q(x)Q(x) is nonempty. Every rational is a/ba/b with aZa \in \mathbb{Z} and bb a positive integer (The integers embed in the rationals), and a positive integer is ι(q)\iota(q) for a unique natural q1q \ge 1 (The naturals embed in the integers); then ι(q)x=aZ\iota(q)\,x = a \in \mathbb{Z}, so qQ(x)q \in Q(x).

By the well-ordering principle (The well-ordering principle) the nonempty subset Q(x)NQ(x) \subseteq \mathbb{N} has a least element. Write

q(x)  :=  minQ(x)    1,q(x) \;:=\; \min Q(x) \;\ge\; 1,

the least denominator of xx, and p(x):=ι(q(x))xZp(x) := \iota(q(x))\,x \in \mathbb{Z}, so that

x  =  p(x)ι(q(x)).x \;=\; \frac{p(x)}{\iota(q(x))} .

Nothing is selected here: q(x)q(x) is the least element of a set determined by xx, so it is a function of xx alone.

The least denominator is the denominator in lowest terms. The integers p(x)p(x) and q(x)q(x) are coprime (Coprime integers: gcd(a,b)=1\gcd(a,b) = 1). Indeed put d:=gcd(p(x),q(x))d := \gcd(p(x), q(x)), which satisfies d1d \ge 1 because q(x)1q(x) \ge 1 makes the pair different from (0,0)(0,0) (gcd\gcd is symmetric and unchanged by signs: gcd(a,b)=gcd(b,a)=gcd(a,b)\gcd(a,b) = \gcd(b,a) = \gcd(|a|,|b|); moreover gcd(a,0)=a\gcd(a,0) = |a|, gcd(a,1)=1\gcd(a,1) = 1, gcd(a,a)=a\gcd(a,a) = |a|, and gcd(a,b)1\gcd(a,b) \ge 1 unless a=b=0a = b = 0, Common divisor, and the greatest common divisor gcd(a,b)\gcd(a,b), with the convention gcd(0,0):=0\gcd(0,0) := 0). Then dd divides q(x)q(x), so q(x)/dq(x)/d is a natural number 1\ge 1, and ι(q(x)/d)=ι(q(x))/d\iota(q(x)/d) = \iota(q(x))/d because ι\iota carries products of naturals to products (Canonical naturals are positive and strictly increasing); hence

ι(q(x)/d)x  =  ι(q(x))xd  =  p(x)d    Z,\iota(q(x)/d)\,x \;=\; \frac{\iota(q(x))\,x}{d} \;=\; \frac{p(x)}{d} \;\in\; \mathbb{Z},

so q(x)/dQ(x)q(x)/d \in Q(x) and therefore q(x)/dq(x)q(x)/d \ge q(x), which forces d=1d = 1. Conversely, a lowest-terms denominator is the least one, so the description is unambiguous. Suppose x=p/ι(q)x = p/\iota(q) with q1q \ge 1 a natural, pZp \in \mathbb{Z} and gcd(p,q)=1\gcd(p,q) = 1. Then qQ(x)q \in Q(x), so q0:=q(x)qq_{0} := q(x) \le q; and from p/ι(q)=p(x)/ι(q0)p/\iota(q) = p(x)/\iota(q_{0}) we get q0p=qp(x)q_{0}p = q\,p(x) in Z\mathbb{Z}, so qq0pq \mid q_{0}p, and gcd(p,q)=1\gcd(p,q) = 1 gives qq0q \mid q_{0} (If gcd(a,b)=1\gcd(a,b) = 1 and abca \mid bc then aca \mid c; and if aca \mid c, bcb \mid c and gcd(a,b)=1\gcd(a,b) = 1 then abcab \mid c, claim 1), hence qq0q \le q_{0}. So q=q(x)q = q(x): writing x=p/qx = p/q "in lowest terms with q1q \ge 1" and taking q=q(x)q = q(x) describe the same integer, and If d=gcd(a,b)d = \gcd(a,b) is nonzero then a/da/d and b/db/d are coprime is what produces such a representation from an arbitrary one.

Thomae's function

t:RR,t(x):={1/ι(q(x))if xQ,0if xQ.t : \mathbb{R} \to \mathbb{R}, \qquad t(x) := \begin{cases} 1/\iota(q(x)) & \text{if } x \in \mathbb{Q},\\ 0 & \text{if } x \notin \mathbb{Q}.\end{cases}

It is also called the popcorn function or the ruler function. The value is well defined because q(x)q(x) is, and ι(q(x))1>0\iota(q(x)) \ge 1 > 0 is invertible.

Boundary values, stated rather than left to the reader.

  • t(0)=1t(0) = 1. Indeed ι(1)0=0Z\iota(1)\cdot 0 = 0 \in \mathbb{Z}, so 1Q(0)1 \in Q(0) and q(0)=1q(0) = 1; the representation is 0=0/10 = 0/1.
  • t(m)=1t(m) = 1 for every integer mm, by the same computation with 1Q(m)1 \in Q(m).
  • 0<t(x)10 < t(x) \le 1 for every rational xx, since ι(q(x))1\iota(q(x)) \ge 1; and t(x)=0t(x) = 0 exactly at the irrationals.

On the range. The values of tt are 00 and the reciprocals 1/ι(q)1/\iota(q) of the canonical naturals q1q \ge 1; every such value is attained, 1/ι(q)1/\iota(q) being the value at the rational 1/ι(q)1/\iota(q) itself, whose least denominator is qq because ι(k)/ι(q)Z\iota(k)/\iota(q) \in \mathbb{Z} with 1k<q1 \le k < q would give a positive integer smaller than 11.

Depends on

Used by

Dependency tree · next 3 levels

Direct dependencies and their dependencies through the next three levels: 123 results over 32 levels. An arrow runs from a result to what uses it, and this result sits at the bottom with a heavier outline. Click the chart to enlarge it.

Sources