The Use of a Dense Set

Ching-Kuang Shene (冼鏡光), Professor Emeritus
Department of Computer Science
Michigan Technological University
Houghton, MI 49931
USA

Created October 15, 2025

The following Theorem can be found in nearly every general topology textbook (e.g., Stephen Willard, General Topology, Dover, p. 89)

If \( f, g: X \rightarrow Y \) are continuous, \( Y \) is Hausdorff, and \( f \) and \( g \) agree on a dense set \( D \) in \( X \), then \( f = g \).

We don't have to go that far to learn general topology to get this result.

First, we know that \( \sin() \) and \( \cos() \) are continuous functions from A Few Useful Results. Proving \( \sin() \) and \( \cos() \) being continuous does not need the Pythagorean Theorem and the Pythagorean Identity.

We shall only consider the open interval \( (0,\frac{1}{2}\pi ) \) because the Pythagorean Identity holds for \( x = 0 \) and \( x = \frac{1}{2}\pi \). A subset \( D \) in \( (0,\frac{1}{2}\pi ) \) is dense if and only if for every \( x \in (0,\frac{1}{2}\pi ) \) every open interval that contains \( x \) also contains a point in \( D \). Let \( f(x) =\sin^2(x) + \cos^2(x) \) and \( g(x) = 1 \) be functions defined on \( (0,\frac{1}{2}\pi ) \), where \( g(x) \) is a constant function. Our goal is: Constructing a dense set \( D \) in \( (0,\frac{1}{2}\pi ) \) such that for every \( d \in D \) we have \( f(d) = \ g(d) = 1 \). Then, we have \( f = g \) on \( (0,\frac{1}{2}\pi ) \). A simple proof of this fact will be presented at the end of this page.

Recall from the Double Angle Identities

On the page of Other Trigonometric Fundamental Formulae we proved the following result: $$ \begin{eqnarray*} \sin^2(x) + \cos^2(x) &=& \left( \sin^2\left(\frac{x}{2}\right) + \cos^2\left(\frac{x}{2}\right) \right)^2 \\ &=& \left( \sin^2\left(\frac{x}{4}\right) + \cos^2\left(\frac{x}{4}\right) \right)^4 \\ &\vdots& \\ &=& \left( \sin^2\left(\frac{x}{2^n}\right) + \cos^2\left(\frac{x}{2^n}\right) \right)^{2^n} \end{eqnarray*} $$ Let \( x = \frac{1}{2}\pi \). For every \( n \geq 1 \) We have \[ 1 = \sin^2\left(\frac{\pi}{2}\right) + \cos^2\left(\frac{\pi}{2}\right) = \sin^2\left(\frac{\pi}{2^2}\right) + \cos^2\left(\frac{\pi}{2^2}\right) = \cdots = \sin^2\left(\frac{\pi}{2^n}\right) + \cos^2\left(\frac{\pi}{2^n}\right) \] This means that the Pythagorean Identity holds for \( \frac{\pi}{2}, \frac{\pi}{2^2}, \frac{\pi}{2^3},\dots, \frac{\pi}{2^n}, \dots \).

The angle sum and angle differences of \( \sin() \) and \( \cos() \) give the following: $$ \begin{eqnarray*} \sin(x\pm y) &=& \sin(x)\cos(y) \pm \cos(x)\sin(y) \\ \cos(x\pm y) &=& \cos(x)\cos(y) \mp \sin(x)\sin(y) \end{eqnarray*} $$ Squaring them and adding the results together gives \[ \sin^2(x\pm y) + \cos^2(x\pm y) = \left( \sin^2(x)+\cos^2(x) \right) \left( \sin^2(y)+\cos^2(y) \right) \] Using induction yields \[ \sin^2\left( \sum_{i=1}^k \alpha_i \right)+ \cos^2\left( \sum_{i=1}^k \alpha_i \right) = \prod_{i=1}^k \left( \sin^2(\alpha_i)+ \cos^2( \alpha_i) \right), \] where \( \alpha_1, \alpha_2, \dots, \alpha_k \) are given angles. Therefore, the following holds: \[ \sin^2(k\alpha)+\cos^2(k\alpha) = \left( \sin^2(\alpha)+\cos^2(\alpha) \right)^k \] for any non-negative integers. If we know an angle \( \alpha \) such that \( \sin^2(\alpha) + \cos^2(\alpha) = 1 \) holds, \( \sin^2(k\alpha) + \cos^2(k\alpha) = 1 \) also holds.

Construction of a Dense Set

Define the following sets: $$ \begin{eqnarray*} D_1 &=& \left\{ \frac{\pi}{2} \right\} \\ D_2 &=& \left\{1\cdot \frac{\pi}{2^2}, 2\cdot\frac{\pi}{2^2}, 3\cdot\frac{\pi}{2^2} \right\} \\ D_3 &=& \left\{1\cdot \frac{\pi}{2^3}, 2\cdot\frac{\pi}{2^3}, 3\cdot\frac{\pi}{2^3}, \cdots, (2^3-1)\frac{\pi}{2^3} \right\} \\ &\vdots& \\ D_k &=& \left\{1\cdot \frac{\pi}{2^k}, 2\cdot\frac{\pi}{2^k}, 3\cdot\frac{\pi}{2^k}, \cdots, (2^k-1)\frac{\pi}{2^k} \right\} \\ &\vdots& \end{eqnarray*} $$ Because the Pythagorean Identity holds for \( \frac{\pi}{2}, \frac{\pi}{2^2}, \frac{\pi}{2^3},\dots, \frac{\pi}{2^n}, \dots \), it also holds for any set \( D_k \).

Obviously, the set \( D = \cup_{i=1}^{\infty} D_i \) is dense in \( \left(0,\frac{1}{2}\pi \right) \). As a result, the Pythagorean Identity holds for any \( x \) in \( \left[0,\frac{1}{2}\pi \right] \) from the theorem cited at the beginning of this page.

Proof of the Cited Theorem: A Special Case

First note that given two distinct real numbers \( x \) and \( y \), there is a sufficiently small number \( \epsilon \) such that the intervals \( (x-\epsilon,x+\epsilon) \) and \( (y-\epsilon,y+\epsilon) \) are disjoint. This is the "Hausdorff" condition stated in the mentioned theorem.

Suppose that \( f, g : I \rightarrow J \) are two continuous functions from an open interval \( I \) to another \( J \) and that \( D \) is a dense set in \( I \) so that \( f(x) = g(x) \) holds for every \( x \in D \). Suppose \( y \in I-D \) and \(f(y) \neq g(y) \). There is a small enough \( \epsilon > 0 \) such that \( ( f(y)-\epsilon, f(y)+\epsilon ) \) and \( ( g(y)-\epsilon, g(y)+\epsilon ) \) are disjoint. Because \( f \) is continuous, there is a \( \delta_f \) so that for every \( v \in (y-\delta_f,y+\delta_f ) \) we have \( f(v) \in ( f(y)-\epsilon, f(y)+\epsilon ) \). By the same reason, there is a \( \delta_g \) such that for every \( v \in (y-\delta_g,y+\delta_g ) \) we have \( g(v) \in ( g(y)-\epsilon, g(y)+\epsilon ) \).

Let \( \delta = \min(\delta_f,\delta_g ) \). In this way, for every \( w\in (y-\delta,y+\delta) \) we have \( f(w) \in ( f(y)-\epsilon, f(y)+\epsilon ) \) and \( g(w) \in ( g(y)-\epsilon, g(y)+\epsilon ) \). Because \( D \) is a dense set in \( I \), \( (y-\delta,y+\delta) \) contains a \( u \in D \). Because we know \( f(u) = g(u) \), it is impossible as \( f(u) \) and \( g(u) \) are in two disjoint intervals. Thus, the cited theorem holds. The general case will not be treated here.

Remarks

I learned the dense set concept from either a general topology or a real analysis course as mentioned on the Characterizations of the \( \sin⁡() \) and \( \cos⁡() \) Functions page. This technique was used to prove a lengthy, clumsy and ungainy characterization of the \( \sin() \) and \( \cos() \) functions, but it workded fine. This technique is used here to prove the Pythagorean Identiy using only the continuous property of the \( \sin() \) and \( \cos() \) functions.

Is this proof an overkill? Perhaps, it is. On the other hand, in doing so it does provide you with a calculus-based proof of the Pythagorean Identity without using the the Pythagorean Theorem and the Pythagorean Identity. Consequently, it clearly shows that the new techniques introduced to calculus open a door for proving the Pythagorean Theorem and the Pythagorean Identity with techniques not available in classical Euclidean geopmetry and trigonometry.

Go back to Home Page.