Examples of proofs using functions: 3 practical examples that actually teach you something
1. Starting with concrete function proofs, not definitions
Most textbooks begin with definitions of function, domain, codomain, and so on. That’s fine, but it’s not how people actually learn to prove things. You learn faster by seeing examples of proofs using functions and then reverse‑engineering the pattern.
In this article, we’ll center on three practical anchor cases:
- Using a function to prove divisibility and parity facts in number theory.
- Using a function to prove inequalities and growth rates in calculus and analysis.
- Using a function to prove structural properties like injectivity, surjectivity, and bijections.
Around those three, we’ll add several more real examples, including limits, monotonicity, and a classic “no perfect voting rule” style argument framed with functions.
If you’re preparing for proof‑heavy courses (discrete math, real analysis, abstract algebra), these are some of the best examples to practice with.
2. Example of a function proof in number theory: even + even = even
Let’s start simple and do it properly. A lot of students “hand‑wave” this one. Instead, we’ll structure it like a real proof.
Claim. The sum of any two even integers is even.
You can absolutely prove this with basic algebra, but treating it as one of our examples of proofs using functions: 3 practical examples makes the structure clearer.
Define a function \(f: \mathbb{Z} \times \mathbb{Z} \to \mathbb{Z}\) by
[
f(m,n) = 2m + 2n.
]
We want to show that for all integers \((m,n)\), the output \(f(m,n)\) is even.
Proof. Take any integers \(m, n \in \mathbb{Z}\). Then
[
f(m,n) = 2m + 2n = 2(m + n).
]
Since \(m+n\) is an integer, write \(k = m+n\). Then \(f(m,n) = 2k\), which is of the form “twice an integer,” so it is even. Because \((m,n)\) was arbitrary, every value of the function \(f\) is even. ∎
Why bother wrapping this in a function? Because many later arguments have this exact flavor: define a function that encodes the situation, then prove a property holds for all inputs.
Variation 1: even × even is even.
Define \(g(m,n) = (2m)(2n) = 4mn = 2(2mn)\). You’ve just reused the same proof pattern with a different function. Collecting these similar patterns is how you build intuition for more advanced examples of proofs using functions later.
3. Using functions to prove inequalities: exponential beats polynomial
Inequalities are where functions really shine. One of the most useful real examples in analysis and algorithms is the fact that exponential functions eventually dominate polynomials.
Claim. For every natural number \(k\), there exists an \(N\) such that for all integers \(n \ge N\), \(2^n > n^k\).
This shows up in algorithm analysis when you compare running times like \(O(2^n)\) versus \(O(n^k)\). It’s also a classic example of using functions in a proof.
Define two functions on the natural numbers:
[
f(n) = 2^n, \quad g(n) = n^k.
]
We want to prove that eventually \(f(n) > g(n)\).
There are several ways to prove this; here’s a clean approach using ratios.
Consider the function
[
h(n) = \frac{f(n)}{g(n)} = \frac{2^n}{n^k}.
]
We want to show that \(h(n)\) eventually exceeds 1 and stays above 1.
One standard method, often taught in early analysis courses, is to use induction and a growth comparison. For a fixed \(k\), you can show that once \(n\) is large enough (for example, \(n \ge 2k\)), the ratio
[
\frac{h(n+1)}{h(n)} = \frac{2^{n+1}/(n+1)^k}{2^n/n^k} = 2 \cdot \left(\frac{n}{n+1}\right)^k
]
becomes greater than 1 and stays that way. That means \(h(n)\) is strictly increasing past some point.
Once you know \(h(n)\) is increasing, you only need to find a single \(N\) with \(h(N) > 1\); then \(h(n) > 1\) for all \(n \ge N\). That’s your proof that \(2^n > n^k\) eventually.
This style—define functions, analyze a ratio or difference, and then use monotonicity—is one of the best examples of how functional thinking turns a vague idea (“exponential grows faster”) into a clean argument.
If you want to see this kind of reasoning in a more formal setting, many real analysis courses (for example, those using materials like MIT OpenCourseWare’s analysis notes at mit.edu) treat this comparison in detail.
4. Proving injectivity and surjectivity: functions as structure
Now for a more structural example of a function proof. Instead of just computing values, we’ll prove something about the shape of a function.
Claim. The function \(f: \mathbb{R} \to \mathbb{R}\) given by \(f(x) = 3x - 5\) is a bijection.
To show \(f\) is a bijection, we need to prove two things:
- It is injective (one‑to‑one): different inputs give different outputs.
- It is surjective (onto): every real number is hit by some input.
Injective part. Suppose \(f(a) = f(b)\). Then
[
3a - 5 = 3b - 5 \implies 3a = 3b \implies a = b.
]
So equal outputs imply equal inputs, which means \(f\) is injective.
Surjective part. Take any real number \(y\). We want an \(x\) such that \(f(x) = y\). Solve:
[
3x - 5 = y \implies 3x = y + 5 \implies x = \frac{y+5}{3}.
]
That \(x\) is a real number, so for every \(y \in \mathbb{R}\), there exists an \(x \in \mathbb{R}\) with \(f(x) = y\). That’s surjectivity.
Since \(f\) is both injective and surjective, it is a bijection. ∎
This is one of the cleanest examples of proofs using functions: 3 practical examples style arguments: assume equal outputs, prove equal inputs; then, for surjectivity, start with an arbitrary output and solve for the input.
Variation 2: a non‑injective function.
Consider \(g: \mathbb{R} \to \mathbb{R}\) given by \(g(x) = x^2\). Then \(g(1) = 1\) and \(g(-1) = 1\), so equal outputs come from different inputs. This is a quick counterexample proof that \(g\) is not injective.
Variation 3: making it injective by restricting the domain.
If we restrict \(g\) to \(g: [0, \infty) \to [0, \infty)\), then the same squaring function is injective: if \(x, y \ge 0\) and \(x^2 = y^2\), then \(x = y\). This kind of domain restriction is a frequent move in more advanced examples of proofs using functions.
5. Real‑analysis flavored examples: continuity and limits
When you move into calculus and real analysis, functions become the main actors. Here are a few real examples that show how proofs using functions are structured in that world.
5.1 Example: continuity of a linear function
Claim. The function \(f(x) = 3x - 5\) is continuous on \(\mathbb{R}\).
Using the \(\varepsilon\)–\(\delta\) definition, we say \(f\) is continuous at a point \(a\) if, for every \(\varepsilon > 0\), there exists a \(\delta > 0\) such that
[
|x - a| < \delta \implies |f(x) - f(a)| < \varepsilon.
]
Compute the difference:
[
|f(x) - f(a)| = |(3x - 5) - (3a - 5)| = |3(x - a)| = 3|x - a|.
]
If we choose \(\delta = \varepsilon/3\), then whenever \(|x - a| < \delta\), we get
[
|f(x) - f(a)| = 3|x - a| < 3\delta = 3(\varepsilon/3) = \varepsilon.
]
So \(f\) is continuous at every \(a \in \mathbb{R}\). ∎
This is a classic example of a function proof where you explicitly use the function’s algebraic form to manufacture a good \(\delta\).
5.2 Example: a limit using functional comparison
Claim. \(\displaystyle \lim_{x \to 0} \frac{\sin x}{x} = 1.\)
Every calculus student sees this, but the proof is often skipped. A standard approach uses the squeeze theorem, which is itself expressed in terms of functions.
The idea is to show that for \(x\) near 0 (but not 0),
[
\cos x \le \frac{\sin x}{x} \le 1.
]
Then you take limits of the outer functions as \(x \to 0\): both \(\cos x\) and the constant function 1 tend to 1, so by the squeeze theorem, \(\sin x / x\) must also tend to 1.
This is another of the best examples of using functions to prove a statement that initially feels more geometric than algebraic.
For a more formal treatment of limits and continuity, resources like the open materials at berkeley.edu or harvard.edu often include detailed notes on these function‑based proofs.
6. Discrete math example: counting with functions (injections and surjections)
Functions are also a powerful way to prove counting statements in discrete math and theoretical computer science.
Claim. There is no bijection between a finite set with \(n\) elements and a set with \(n+1\) elements.
This is one of those quiet but important examples of proofs using functions that underpins the idea of cardinality.
Suppose, for contradiction, that there is a bijection
[
f: A \to B,
]
where \(|A| = n\) and \(|B| = n+1\).
Because \(f\) is injective, no two elements of \(A\) map to the same element of \(B\). So the image \(f(A)\) has exactly \(n\) elements. But \(B\) has \(n+1\) elements, so there must be at least one element in \(B\) that is not in \(f(A)\). That contradicts surjectivity.
Therefore, no bijection can exist. ∎
This argument generalizes: many counting proofs can be reframed as “show there is (or is not) an injection/surjection/bijection between two sets,” which is why they’re often presented as examples of proofs using functions: 3 practical examples in discrete math courses.
7. Modern applications: functions in algorithms, modeling, and data
In 2024–2025, most of the interesting math you see in the wild—machine learning, optimization, epidemiological modeling—is fundamentally about functions.
- In algorithms, runtime bounds are expressed as functions \(T(n)\). Proving that one algorithm is asymptotically faster than another is a direct application of the “exponential beats polynomial” style argument above.
- In machine learning, loss functions (like mean squared error) are functions from parameter space to real numbers. Proving that a gradient‑based method converges often involves showing that a loss function decreases along an update rule.
- In epidemiology, compartment models like SIR use functions \(S(t), I(t), R(t)\) to represent populations over time. Proving that an epidemic will eventually die out under certain conditions can be framed as showing that the function \(I(t)\) eventually decreases to 0.
For instance, the classic SIR model used by public health agencies like the CDC (cdc.gov) defines a system of differential equations for these functions. Proving properties of the solutions—such as bounds on peak infection—is another modern example of proofs using functions in action.
These are not just classroom exercises. They are real examples of how function‑based reasoning supports public policy, medical research (see modeling work referenced at nih.gov), and data‑driven decision‑making.
8. Pulling it together: patterns you should notice
We’ve walked through multiple examples of proofs using functions: 3 practical examples as anchors (number theory, inequalities, bijections) and added several more:
- Parity and divisibility proofs via explicit function definitions.
- Growth comparisons using ratios of functions.
- Structural proofs about injectivity, surjectivity, and bijections.
- Continuity and limits in real analysis.
- Counting arguments reframed as function existence/non‑existence.
- Real‑world modeling examples in algorithms and epidemiology.
The patterns that keep repeating:
- Define a function that encodes the problem. Don’t argue in the abstract if you can write down a concrete function.
- Compare functions using differences or ratios. This is how you prove inequalities and growth rates.
- Use the structure of the function. Linear functions are globally invertible; squaring needs domain restrictions; continuous functions behave well under limits.
- Translate “size” questions into injections/surjections. If you can or cannot build a function with certain properties, you’ve proved a counting statement.
If you practice with these kinds of examples of proofs using functions, you’ll start to see that many different topics—calculus, discrete math, modeling—are variations on the same small set of ideas.
FAQ: short answers about examples of function‑based proofs
Q1. What are some of the best examples of proofs using functions for beginners?
Good starter problems include: proving that the sum or product of even numbers is even using functions; showing a simple linear function is bijective; proving continuity of \(f(x) = mx + b\); and using the squeeze theorem on functions like \(\sin x / x\). These are classic examples of proofs using functions that appear in early proof‑writing courses.
Q2. Can you give an example of a proof using functions in computer science?
Yes. When you prove that an algorithm with running time \(T_1(n) = n^2\) is asymptotically faster than one with \(T_2(n) = 2^n\), you are comparing two functions. Showing that \(2^n > n^2\) for all large \(n\) is exactly the kind of inequality proof we discussed earlier.
Q3. How do functions help with counting problems?
You often prove that two sets have the same size by constructing a bijection between them, or that one set is at most as large as another by constructing an injection. The non‑existence of such functions is itself a proof, as in the example where no bijection can exist between sets of size \(n\) and \(n+1\).
Q4. Where can I study more real examples of proofs using functions?
Look at open course notes from universities. Many US institutions, such as MIT and UC Berkeley, host free lecture notes and problem sets in real analysis and discrete math. For applied function‑based reasoning in health and biology, agencies like the NIH (nih.gov) and Mayo Clinic (mayoclinic.org) often reference mathematical models that rely heavily on functions.
Related Topics
The best examples of 3 practical examples of direct proof (and more)
The best examples of constructive proofs for math problem solving
Examples of proofs using functions: 3 practical examples that actually teach you something
Diverse examples of existential proofs in modern mathematics
Real examples of proofs involving sets: step‑by‑step guide
The best examples of examples of proof by contrapositive (explained like you’re in class with a great teacher)
Explore More Mathematical Proof Strategies
Discover more examples and insights in this category.
View All Mathematical Proof Strategies