5.1 Scalar and vector fields, limits and continuity
A field attaches a number or a vector to every point of space. Limits and continuity of fields are the limits of Unit 1 with the distance between points of the line replaced by the length of a vector, and the one new difficulty is that a point of the plane can be approached along infinitely many paths, all of which must agree.
Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 8.1 to 8.5Spagnolie, Lecture 19 (second version) and Piazza note @105Genocchi and Peano, Calcolo differenziale e principii di calcolo integrale (1884)
Until now a function took one number in and gave one number out (Unit 1), or it was linear (Unit 2). Most quantities in the world depend on position: the temperature of a room, the pressure of the air, the wind. This chapter names such functions, shows how to draw them, and carries limit and continuity from 1.3 into Rn. There is one new difficulty, and it is the theme of the chapter. On a line you reach a point from two sides. In the plane there are infinitely many ways to reach it, and a limit exists only if all of them agree.
Before you start
1.3: limits and continuity with ε and δ. 2.9: the length ∥x∥ and the Cauchy–Schwarz inequality. 4.1: open balls and open sets. Chapter 4.5 proves the same limit and continuity statements for any metric space; here we use them in Rn with the usual length.
Quick checkFor x=(3,4), which statement is true for each coordinate?
Here ∥x∥=5, and 3,4≤5. One coordinate is never longer than the whole vector: ∣x1∣=x12≤x12+x22. We use this to pass between a vector and its components.Review: the max-norm, 2-norm and 1-norm compared
Quick checkWhich inequality is the Cauchy–Schwarz inequality for vectors u,v in Rn?
The dot product is bounded by the product of the lengths, with an absolute value on the left. The inequality ∥u+v∥2≤∥u∥2+∥v∥2 is false (it fails for u=v). Forgetting the absolute value, or squaring the triangle inequality, were the common slips on the 375 final.Review: Cauchy–Schwarz
Quick checkWhat is the open ball B(a,r) in R2?
Strictly less than r. The ball is open because every point of it has a smaller ball around it still inside (4.1). Lecture 19 underlined the word 'strictly'.Review: open balls
The picture: a field is a function of position
On the left is the graph of f(x,y): over each point (x,y) of the floor, a point at height f(x,y). On the right are its level curves: for each height c, the set of floor points where f=c, like the contour lines of a hiking map. Things to do:
Start with x2+y2. The bowl’s level curves are circles. Drag the dot outward: the circles crowd together, because the bowl gets steeper.
Switch to cos(x+y). Its level curves are parallel lines of slope −1, because f depends on x+y only. This is the homework example worked below.
Switch to x2−y2. The level curve at height 0 is two lines crossing at the origin. The surface is a saddle there.
A vector field has an arrow at every point instead of a height:
Pick the spin field (−y,x): the arrows go round the origin like water in a drain. Pick the stretch field (2x+y,x+2y): this is the fluid flow of Lecture 19 (first version), and we meet it again in 5.3.
The idea, in words
A function of one variable assigns a number to each point of a line. A field assigns something to each point of the plane or of space. If that something is a number (a temperature, a pressure, a density, an electric potential, the loss of a neural network), the field is a scalar field. If it is a vector (the wind, a force, an electric field), it is a vector field. Physicists said “field” first, long before mathematicians had a definition; the history box below says how.
There are three ways to look at a scalar field, and you should be able to switch between them:
the formula, f(x,y)=x2+3y;
the graph, a surface in one dimension more than the domain;
the level sets, the pieces of the domain on which f is constant.
The graph needs n+1 dimensions, so for n≥3 you cannot draw it. Level sets need only n dimensions (and level surfaces of fields on R3 can be drawn), which is why they are the main tool.
Where this came from· From Faraday's lines of force to vector fields
Michael Faraday pictured electric and magnetic influence as “lines of force” filling space. James Clerk Maxwell took the picture seriously: in “On Faraday’s Lines of Force” (read 1855 and 1856) he treated the lines as the streamlines of an imagined incompressible fluid, which turned a picture into a vector at every point and gave the mathematics a place to start. The words “scalar” and “vector” themselves come from William Rowan Hamilton’s quaternions (from 1843): a scalar is a quantity on one scale of numbers, from negative to positive, and a vector is a quantity that carries a direction. The problem they were solving was how to describe a quantity that varies from point to point in space. That is exactly what Definitions 1 and 2 below say.
Definitions
Definition T
Scalar field
A scalar field is a function f:S→R where S is a subset of Rn. The input is a vector (a point of space), the output is one real number. Apostol calls it a “real-valued function of a vector variable”. For points of R2 we write (x,y) and for points of R3 we write (x,y,z). Examples: f(x,y)=x2+y2 (distance squared from the origin) and T(x,y,z)= the temperature at that point of a room.
In one lineA function f that gives a real number f(x)=f(x1,…,xn) at each point x of a set S⊆Rn.
Why it existsIt is the right object for a quantity with a size and no direction, such as temperature or the loss of a network, that varies from place to place.
Definition T
Vector field
A vector field is a function F:S→Rm with S⊆Rn. Writing F(x)=(F1(x),…,Fm(x)), each componentFk(x)=ek⋅F(x) is a scalar field, where ek is the k-th unit vector. Examples: the identity F(x)=x (an arrow pointing away from the origin, of length equal to the distance from it), the spin field F(x,y)=(−y,x), and every linear map x↦Ax of Unit 2. The air velocity in a room is a vector field R3→R3.
In one lineA function F that gives a vector F(x)∈Rm at each point x of a set S⊆Rn; its m components F1,…,Fm are scalar fields.
Why it existsIt is the right object for a quantity with a size and a direction, such as the wind or a force, that varies from place to place.
Definition T
Level set
For a scalar field f:S→R and a real number c, the level set is L(c)={x∈S:f(x)=c}. In R2 it is usually a curve (a level curve, or contour line, or isotherm for temperature, isobar for pressure). In R3 it is usually a surface (a level surface). It is the slice of the graph at height c, projected down to the floor.
In one lineFor a scalar field f and a number c, the level set L(c)={x:f(x)=c}: all points where f takes the value c.
Why it existsLevel sets turn a function of n variables into a family of (n−1)-dimensional shapes you can draw, and they record where the function is flat.
Worked example MATH 375 HW 11 (Apostol 8.3 #1c)
Sketch the level sets of f(x,y)=cos(x+y) for c=−1,0,21,22,1.
Solution.
Notice what f depends on.f(x,y)=cosu with u=x+y. If the formula uses x and y only through one combination, the level sets are lines on which that combination is constant.
Solve cosu=c for u. For c=1: u=2mπ. For c=22: u=±4π+2mπ. For c=21: u=±3π+2mπ. For c=0: u=2π+mπ. For c=−1: u=π+2mπ. Here m is any whole number. Cosine is periodic, so each value of c is taken at infinitely many u.
Each solution u=u0 is a line.x+y=u0, that is y=u0−x, a line of slope −1. That is the set of points with x+y equal to the constant.
Draw them. Every level set is a family of parallel lines of slope −1. Moving along such a line, x+y does not change, so f does not change: this is the direction in which f is flat. Moving across the lines (direction (1,1)) is the direction in which f changes fastest. This is the idea of 5.2.
Answer. All level sets are unions of parallel lines x+y=u0 of slope −1, for the values of u0 listed in step 2.
Worked example Apostol 8.3 #1e
Describe the level sets of f(x,y,z)=x2+2y2+3z2 for c=0 and c=6.
Solution.
Level c=0.x2+2y2+3z2=0. Each term is at least 0, so all three must be 0. The level set is the single point (0,0,0). A sum of non-negative terms is zero only when each term is.
Level c=6. Divide by 6: 6x2+3y2+2z2=1. This is the standard form of an ellipsoid p2x2+q2y2+r2z2=1.
Read the semi-axes.p=6, q=3, r=2. The ellipsoid crosses the x-axis at ±6≈±2.45, the y-axis at ±3≈±1.73 and the z-axis at ±2≈±1.41.
General c>0. The same steps give ellipsoids with semi-axes c, c/2, c/3, nested like onion layers. Doubling c multiplies every semi-axis by 2.
Answer. A point for c=0; an ellipsoid with semi-axes 6,3,2 for c=6. Level sets for c<0 are empty.
Quick checkThe level sets of f(x,y)=x2+y2 are circles about the origin. What are the level sets of g(x,y)=exy for c>0?
exy=c is equivalent to xy=lnc, because et is one-to-one. For c=1 this is xy=0, the two coordinate axes. For c=e it is xy=1, a hyperbola in the first and third quadrants.
Limits
A limit of a field is the limit of Unit 1 with the distance ∣x−a∣ replaced by the length ∥x−a∥.
Same idea elsewhere· This is the limit of chapter 4.5, for the usual length
For a field F:S→Rm, a point a∈Rn and b∈Rm, Apostol writes
x→alimF(x)=bto mean∥x−a∥→0lim∥F(x)−b∥=0.
In ε and δ words: for every ε>0 there is a δ>0 such that 0<∥x−a∥<δ implies ∥F(x)−b∥<ε. This is the limit of a map between metric spaces for the metric spaces Rn and Rm with the Euclidean distance, and ”F is continuous at a” means F(a) is defined and limx→aF(x)=F(a), the continuous map between metric spaces at one point. As in 1.3, the condition 0<∥x−a∥ keeps the value F(a) (if there is one) out of the limit.
Everything from 1.3 and 1.2 that did not use the order of the real numbers carries over word for word, with the same proofs.
Theorem TApostol Thm 8.1
Limit laws for fields
Let F,G be fields into Rm with limx→aF(x)=b and limx→aG(x)=c. Then, as x→a:
(a) F(x)+G(x)→b+c. (b) λF(x)→λb for every real λ. (c) F(x)⋅G(x)→b⋅c. (d) ∥F(x)∥→∥b∥.
For scalar fields (the case m=1) there is also (e): if c=0 then F(x)/G(x)→b/c.
In one lineIf F→b and G→c as x→a, then F+G→b+c, λF→λb, F⋅G→b⋅c and ∥F∥→∥b∥.
Why it is trueLimits behave well under the operations that vectors have: adding, scaling, taking dot products and lengths. Dividing by a vector is not an operation, so there is no quotient law for vector fields.
ProofApostol 8.1; Spagnolie Lecture 19
The idea: (a), (b) and (d) follow from the triangle inequality in one line. For (c), write the difference of the dot products as a sum of three terms, each containing a small factor, and bound each with Cauchy–Schwarz.
(a) ∥(F+G)−(b+c)∥≤∥F−b∥+∥G−c∥, and the right side tends to 0.
Triangle inequality of 2.9.
(b) ∥λF−λb∥=∣λ∣∥F−b∥→0.
∥λv∥=∣λ∣∥v∥.
(c) F⋅G−b⋅c=(F−b)⋅(G−c)+b⋅(G−c)+c⋅(F−b).
Expand the three dot products on the right: F⋅G−F⋅c−b⋅G+b⋅c, then +b⋅G−b⋅c, then +c⋅F−c⋅b. The cross terms cancel.This is the add-and-subtract trick from the product law of 1.2: change one factor at a time.
So ∣F⋅G−b⋅c∣≤∥F−b∥∥G−c∥+∥b∥∥G−c∥+∥c∥∥F−b∥.
Triangle inequality for the three terms, then Cauchy–Schwarz ∣u⋅v∣≤∥u∥∥v∥ on each.
The right side tends to 0, so F⋅G→b⋅c.
Each of ∥F−b∥ and ∥G−c∥ tends to 0, and ∥b∥, ∥c∥ are fixed numbers.
(d) ∥F∥−∥b∥≤∥F−b∥→0.
The reverse triangle inequality ∥u∥−∥v∥≤∥u−v∥, which is the triangle inequality applied to u=(u−v)+v and to v=(v−u)+u.
(e) G1→c1, hence GF=F⋅G1→cb. ■
For ∣G−c∣<∣c∣/2 we have ∣G∣>∣c∣/2, so G1−c1=∣G∣∣c∣∣c−G∣≤c22∣G−c∣→0. Then use (c) for F⋅G1.
Proof workshopRebuild the proof of part (c), the dot-product lawApostol 8.1 (c)
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
Expand the right side; the cross terms cancel. Each term now contains a factor that is small.
Triangle inequality for absolute values of three terms.
You need the three-term identity first, so there are pieces to bound.
Cauchy–Schwarz on each dot product.
The absolute values of the dot products must be written down before bounding them.
These are the hypotheses F→b and G→c.
A non-negative quantity bounded by something that tends to 0 tends to 0.
This is the conclusion; it needs the bound and the limits of its factors.
Theorem TApostol 8.4 Example 1
A field has a limit exactly when its components do
Let F=(F1,…,Fm) and b=(b1,…,bm). Then limx→aF(x)=b if and only if limx→aFk(x)=bk for k=1,…,m. In particular, F is continuous at a exactly when each component Fk is.
In one lineF(x)→b as x→a if and only if Fk(x)→bk for every component k.
Why it is trueIt reduces a limit of vectors to m limits of numbers, so you can compute componentwise.
ProofApostol 8.4 Example 1
The idea: A vector is small exactly when all its components are small: the comparison of norms from 4.1 gives |F_k − b_k| ≤ ‖F − b‖ ≤ sum of |F_k − b_k|.
For every k: ∣Fk(x)−bk∣≤∥F(x)−b∥.
One coordinate of a vector is no longer than the vector (4.1, max-norm at most 2-norm).
Also ∥F(x)−b∥≤∑k=1m∣Fk(x)−bk∣.
The 2-norm is at most the 1-norm (4.1): s12+⋯+sm2≤∣s1∣+⋯+∣sm∣ because squaring the right side only adds non-negative cross terms.
So F→b implies every Fk→bk.
If F→b, the left inequality squeezes each ∣Fk−bk∣ to 0.
Conversely, F→b. ■
If every Fk→bk, the right side is a finite sum of quantities tending to 0, so it tends to 0.
The new danger: many paths
Try these four things in the picture above.
(x−y)/(x+y) along straight lines. Turn the line angle. The value the function settles to changes with the angle. The limit at the origin would have to be all those numbers at once.
x2y/(x4+y2) along straight lines. Every line gives 0. Now switch the path to the parabola y=x2. The value is 21 all the way in.
x2y/(x2+y2). Every path, line or curve, gives 0. This one really has limit 0, and the section on the squeeze below proves it.
Look at the colour map for x2y/(x4+y2). The strongest colours hug the two parabolas y=±x2, which squeeze into the origin. A straight line meets that thin strip only near its tip, which is why lines never see the value 21 that the parabola sees.
Theorem TApostol 8.4; the sequential criterion of 1.3
A limit forces the same value along every path
Suppose limx→aF(x)=b. Let r(t) be points with r(t)=a and r(t)→a as t→0+ (a straight line r(t)=a+tu or a curve such as r(t)=(t,t2)). Then limt→0+F(r(t))=b. Consequently: if two such paths give two different limits, or one path gives no limit, then limx→aF(x) does not exist.
In one lineIf F(x)→b as x→a and a path r(t)→a with r(t)=a, then F(r(t))→b along the path.
Why it is trueIt turns 'no limit' into something you can show with two paths: if two paths give different limits, no limit exists.
ProofApostol 8.4
The idea: Given ε, take the δ from the definition of the limit. Once the path is within δ of a, the function is within ε of b.
Let ε>0. Choose δ>0 with ∥F(x)−b∥<ε whenever 0<∥x−a∥<δ.
Definition of limx→aF(x)=b.
Choose τ>0 so that 0<∥r(t)−a∥<δ for 0<t<τ.
r(t)→a, and r(t)=a so the norm is strictly positive.
For 0<t<τ: ∥F(r(t))−b∥<ε. So F(r(t))→b. ■
Take x=r(t) in the first step.
Worked example Lecture 19 (second version); Apostol 8.5 #3
Show that f(x,y)=x+yx−y has no limit at (0,0).
Solution.
Choose a family of paths. The line y=mx with m=−1 and x=0. Lines through the origin are the simplest paths. We avoid m=−1 because f is not defined where x+y=0.
Compute f on the line.f(x,mx)=x+mxx−mx=x(1+m)x(1−m)=1+m1−m. We may cancel x because x=0 inside a limit.
Read the limit along each line. The value is the constant 1+m1−m, so that is the limit along the line. For m=0 it is 1; for m=1 it is 0; for m=3 it is −21. A constant function has that constant as its limit.
Compare. Two paths give two different numbers, 1 and 0. By the theorem above a limit would have to equal both.
Answer.lim(x,y)→(0,0)x+yx−y does not exist. Apostol’s other check uses iterated limits: take the limit in one variable first (the other held fixed), then take the limit of the result in the other variable. Here the two orders differ. For fixed x=0, letting y→0 first gives xx=1; for fixed y=0, letting x→0 first gives y−y=−1. So limx→0limy→0f=1 but limy→0limx→0f=−1.
Your answerAlong the line y=3x (x=0), what constant value does x+yx−y take?
Substitute y=3x and cancel x.
x+3xx−3x=4x−2x=−21. In general the value on y=mx is 1+m1−m.
Worked example Apostol 8.4 Example 7; Final Review, 'continuous in x and in y'
Let f(x,y)=x2+y2xy for (x,y)=(0,0) and f(0,0)=0. Show f is continuous in x alone and in y alone at the origin, but not continuous at the origin.
Solution.
Slice along the x-axis. For y=0: f(x,0)=0 for every x, including x=0. The numerator xy is 0 on the axis.
Slice along the y-axis. Likewise f(0,y)=0 for every y. Same reason, with x=0.
Conclude “separately continuous”. As a function of x alone (with y=0) and as a function of y alone (with x=0), f is the constant 0, hence continuous at 0. This is what continuity “in each variable separately” means.
Now the diagonal. For x=0: f(x,x)=2x2x2=21. The diagonal y=x is a path to the origin.
Compare with the value. Points with f=21 exist arbitrarily close to the origin, but f(0,0)=0. So lim(x,y)→(0,0)f(x,y)=f(0,0) (the limit along the diagonal is 21). By the path theorem, if the limit existed it would be 21 and also, along the axes, 0.
Answer.f is continuous in each variable separately but not continuous as a function of both variables together. Continuity in each variable alone does not imply continuity.
Quick checkA function f(x,y) is continuous in x for every fixed y, and continuous in y for every fixed x. Is f continuous as a function of (x,y)?
Continuity in each variable separately only controls f along the horizontal and vertical lines. Joint continuity controls f along every path, including the diagonal, where this function equals 21. This is exactly the question on the 375 final review.
Where this came from· Peano's separately continuous function
In his 1821 textbook Cours d’analyse, Cauchy had stated that a function that is continuous in each variable separately is continuous. In the treatise on calculus published under Angelo Genocchi’s name in 1884, with additions by his assistant Giuseppe Peano, the function x2+y2xy (with value 0 at the origin) appears as a counterexample: continuous in each variable alone, discontinuous on the diagonal. Peano was one of the people who pushed analysis towards checking every claim with an explicit example; the next function below, which gives limit 0 along every straight line and still has no limit, is of the same kind. This is the reason a definition with ε and δ over a whole ball is needed in Rn rather than a test along lines.
Worked example Spagnolie Piazza @105 (the same shape as the Lecture 20 function); new
Show that f(x,y)=x4+y2x2y has limit 0 along every straight line through the origin, but no limit at the origin.
Solution.
Lines y=mx with m=0.f(x,mx)=x4+m2x2x2⋅mx=x2+m2mx for x=0. Cancel the common factor x2.
Let x→0. The denominator tends to m2=0 and the numerator to 0, so the limit is 0. Quotient law (e) of the limit laws, allowed because the denominator’s limit is not 0.
The remaining lines. On the x-axis (m=0) and on the y-axis (x=0) f=0 identically. The numerator is 0 on both.
So every straight line gives 0.This is the evidence that tempts you to say the limit is 0.
Now the parabola y=x2.f(x,x2)=x4+x4x2⋅x2=2x4x4=21 for x=0. The parabola y=x2 touches the x-axis at the origin, so it is a path to the origin like any other. It bends upward exactly as fast as x2 grows, which keeps it where f is largest. No straight line does that.
Compare. The path y=x2 gives 21, the lines give 0. By the path theorem, no limit.
Answer. The limit does not exist. Checking all straight lines is not enough to prove a limit, however many you check. (By x4+y2≥2x2∣y∣, ∣f∣≤21 everywhere: the function is bounded, and 21 is its largest size, reached exactly on the two parabolas y=±x2.)
Your answerWhat value does x4+y2x2y take at the point (0.1,0.01) on the parabola y=x2?
0.0001+0.00010.01⋅0.01=0.00020.0001=21. On the parabola y=x2 the value is 21 at every point, however close to the origin.
Python labSample many paths, then try to catch the bad one
import numpy as nprng = np.random.default_rng(0)def f(x, y): return x**2 * y / (x**4 + y**2)print("along lines y = m x, then the parabola y = x^2")for t in (1e-1, 1e-2, 1e-3): row = [f(t, m * t) for m in (0.5, 1, 2, 10)] + [f(t, t**2)] print(f"x = {t:g}: " + " ".join(f"{v:9.5f}" for v in row))r = 1e-3pts = rng.uniform(-r, r, size=(200000, 2))pts = pts[pts[:, 0]**2 + pts[:, 1]**2 < r**2]print("random points in the disk of radius", r, ": largest |f| =", abs(f(pts[:, 0], pts[:, 1])).max().round(4))# aim at the thin curved strip near y = x^2x = rng.uniform(r / 100, r, 200000)y = x**2 * rng.uniform(0.5, 2, 200000)print("points near the parabola: largest f =", f(x, y).max().round(4))
Try this.Run it once. Then change r to 1e-6 and run again: the largest |f| found does not shrink, even though every straight line gave values going to 0. Now delete the last block (the points near the parabola) and run the random disk alone with r = 1e-6: how often does a random point land in the thin strip where f is large? Replace f by x**2*y/(x2+y2) and see the largest |f| shrink with r, as the squeeze below proves.
Proving that a limit exists: the squeeze
To show a limit exists you cannot test paths, because there are too many. You bound the whole difference by something that depends only on the distance to the point.
Proposition TApostol 8.4
Squeeze for fields
Let F:S→Rm. Suppose there is a function φ(r) with φ(r)→0 as r→0+ and a δ0>0 such that ∥F(x)−b∥≤φ(∥x−a∥) whenever 0<∥x−a∥<δ0. Then limx→aF(x)=b.
In one lineIf ∥F(x)−b∥≤φ(∥x−a∥) near a and φ(r)→0 as r→0+, then F(x)→b.
Why it is trueIt reduces a problem about all approach directions at once to a one-variable limit in the distance r.
ProofApostol 8.4
The idea: Choose δ so small that φ(r) is below ε for every r below δ; the bound does the rest.
Given ε>0, choose δ≤δ0 with φ(r)<ε for 0<r<δ.
φ(r)→0 as r→0+.
If 0<∥x−a∥<δ then ∥F(x)−b∥≤φ(∥x−a∥)<ε. ■
Apply the hypothesis with r=∥x−a∥.
In the plane at the origin, polar coordinatesx=rcosθ, y=rsinθ make this convenient: r=∥(x,y)∥ is the distance to the origin, and θ names the direction of approach. If you can bound ∣f(rcosθ,rsinθ)−b∣ by some φ(r) that does not depend on θ, the squeeze applies. The words “does not depend on θ” are the entire point.
Worked example
Prove (x,y)→(0,0)limx2+y2x2y=0, first with ε and δ and then with polar coordinates.
Solution.
Bound by the distance. Since x2≤x2+y2, we have x2+y2x2∣y∣≤∣y∣≤x2+y2. Write f=x2+y2x2⋅y. The first factor is between 0 and 1, so ∣f∣≤∣y∣. And ∣y∣=y2≤x2+y2.
Choose δ. Given ε>0 take δ=ε. If 0<∥(x,y)∥<δ then ∣f(x,y)−0∣≤∥(x,y)∥<ε. This is the definition of the limit, with the work done in step 1.
The same in polar form.f(rcosθ,rsinθ)=r2r3cos2θsinθ=rcos2θsinθ. x2+y2=r2 and the numerator has r3.
Bound without θ.∣rcos2θsinθ∣≤r for every θ. ∣cosθ∣≤1 and ∣sinθ∣≤1. The bound φ(r)=r does not mention θ, so the squeeze applies.
Answer. The limit is 0. Both versions are the same inequality: ∣f∣≤r.
Worked example Apostol 8.5 #8
Find the value f(0,0) that makes f(x,y)=x2+y2sin(x2+y2) continuous at the origin.
Solution.
Rename the combination. Put u=x2+y2=r2. Then f=h(u) with h(u)=usinu. The formula uses (x,y) only through u, so the problem becomes one-variable.
Recall the one-variable limit.limu→0usinu=1. It is the derivative of sin at 0 (1.4): u−0sinu−sin0→cos0=1.
Transfer it.∣f(x,y)−1∣=∣h(r2)−1∣ depends only on r and tends to 0 as r→0+ (because u=r2→0). This is the squeeze with φ(r)=∣h(r2)−1∣, free of θ.
Choose the value. Continuity at 0 needs f(0,0)=lim(x,y)→(0,0)f=1.
Answer. Define f(0,0)=1. Then f is continuous at the origin (and everywhere else, as a composition of continuous fields).
Watch out· Polar coordinates prove a limit only if the bound is free of θ
For x4+y2x2y in polar form, f=r2cos4θ+sin2θrcos2θsinθ. For a fixed θ with sinθ=0 this tends to 0 as r→0, which is why lines look harmless. But the speed at which it tends to 0 depends on θ, and near θ=0 the denominator is small too. For every r>0 there is a direction θ (the one pointing at the parabola) with f=21. So no φ(r) free of θ exists. Checking a few fixed θ is the same mistake as checking a few lines.
Worked example MATH 375 HW 11 (Apostol 8.5 #5)
Let f(x,y)=xsiny1 for y=0 and f(x,0)=0. Show that f→0 at the origin, but that one iterated limit does not exist.
Solution.
Squeeze. For y=0: ∣f(x,y)∣=∣x∣∣siny1∣≤∣x∣, and for y=0: ∣f∣=0≤∣x∣. ∣sint∣≤1 for every t, even though siny1 oscillates wildly as y→0. The bound uses only the factor x.
Conclude.∣x∣≤∥(x,y)∥, so ∣f∣≤r→0. Hence lim(x,y)→(0,0)f=0. Squeeze with φ(r)=r.
First iterated limit. For a fixed y=0: limx→0xsiny1=0 (a constant times x). Then limy→00=0. The inner limit is taken first, with y held fixed.
Second iterated limit. For a fixed x=0: limy→0xsiny1 does not exist, because siny1 oscillates between −1 and 1. So limx→0[limy→0f(x,y)] makes no sense. The inner limit fails, so there is nothing to feed to the outer limit.
No contradiction with Apostol 8.5 #2. That exercise says: if the two-variable limit exists and the two one-variable limits exist, then the iterated limits equal it. Here one of the one-variable limits (in y for fixed x=0) does not exist, so the hypothesis fails.
Answer.f→0 at the origin. The iterated limit in the order ”y first” does not exist, and in the order ”x first” it equals 0. Existence of the two-variable limit does not make both iterated limits exist.
Quick checkTo prove lim(x,y)→(0,0)f=0 a student checks that f→0 along y=mx for every m, and along both axes. What has the student proved?
There are paths that are not straight lines. The function x4+y2x2y passes this check and has no limit. A proof needs a bound free of the direction of approach, or an ε and δ argument.
Continuity
A field F is continuous at a if F(a) is defined and limx→aF(x)=F(a); it is continuous on S if it is continuous at each point of S. The limit laws immediately give an algebra of continuous fields, and the same one-line proof gives continuity of a composition.
Theorem TApostol Thm 8.1, Examples 2 to 5, Thm 8.2
Building continuous fields
(a) If F,G are continuous at a, so are F+G, λF, F⋅G and ∥F∥; for scalar fields f/g is continuous at a if g(a)=0.
(b) The coordinate functions x↦xk are continuous on Rn. Hence every polynomial in x1,…,xn is continuous on Rn, and every rational functionP/Q is continuous where Q=0.
(c) Every linear map T:Rn→Rm is continuous.
(d) Composition. If G is continuous at a and F is continuous at G(a), then F∘G is continuous at a.
In one lineSums, scalar multiples, dot products, norms and compositions of continuous fields are continuous; so are the coordinate functions, linear maps, polynomials, and quotients where the denominator is not zero.
Why it is trueYou can recognise most fields as continuous without any ε or δ, by seeing how they are built from continuous pieces.
ProofApostol 8.1 to 8.2
The idea: Parts (a) and (b) are the limit laws. For (c), write T(h) as a combination of the images of the unit vectors. For (d), work backwards from ε: first the η that F needs at G(a), then the δ that G needs to stay within η.
(a) follows from the limit laws.
Limit laws applied with b=F(a) and c=G(a).
(b) The coordinate function x↦xk is continuous. Products and sums of continuous fields are continuous by (a), so polynomials are, and P/Q is by the quotient law where Q=0.
∣xk−ak∣≤∥x−a∥ (the first quiz of this chapter): take δ=ε.
(c) T(a+h)−T(a)=T(h)=∑k=1nhkT(ek).
h=∑hkek and T is linear (2.3).
So ∥T(h)∥≤∥h∥∑k∥T(ek)∥, which tends to 0 as ∥h∥→0. Hence T is continuous at every a.
Triangle inequality, then ∣hk∣≤∥h∥.
(d) Let ε>0. Choose η>0 so that ∥y−b∥<η implies ∥F(y)−F(b)∥<ε.
Continuity of F at b=G(a).
Choose δ>0 so that ∥x−a∥<δ implies ∥G(x)−b∥<η.
Continuity of G at a, using η as the target accuracy.
Then ∥x−a∥<δ implies ∥F(G(x))−F(G(a))∥<ε. ■
Take y=G(x) in the first choice.
Worked example Lecture 19 (second version)
Find all points where h(x,y)=log(sin2(x2+y2)) is continuous.
Solution.
The inside.u(x,y)=x2+y2 is a polynomial, hence continuous on all of R2. Building continuous fields (b).
The middle.sin is continuous on R, and so is its square, so v(x,y)=sin2(x2+y2) is continuous on R2. Composition (d), then a product (a).
The outside.log is continuous on the open half-line (0,∞), and nowhere else is it defined. Here log means the natural logarithm, as in all of the course.
Where the composition works.h=log∘v is continuous at every point where v>0. Composition (d), valid where the outer function is defined and continuous at the inner value.
Where v>0 fails.sin2w=0 exactly when w=mπ for a whole number m. With w=x2+y2≥0 we need m=0,1,2,…x2+y2 is never negative.
Answer.h is continuous at every point except those with x2+y2=mπ, m=0,1,2,…: the origin and the circles of radius mπ about it. There h is not defined (it tends to −∞). The discontinuities of a function of two variables can be isolated points or entire curves.
Your answerHow many of the circles x2+y2=mπ (m≥1) of discontinuity of log(sin2(x2+y2)) lie inside the disk of radius 5?
Solve mπ<25.
We need mπ<5, that is mπ<25, m<7.96. So m=1,…,7. (Seven circles, plus the origin itself.)
Worked example MATH 375 HW 11 (Apostol 8.5 #1f); the printed key's answer is wrong
Where is f(x,y)=arcsinx2+y2x continuous?
Solution.
The domain.f is defined when (x,y)=(0,0) and −1≤x2+y2x≤1. arcsin is defined on [−1,1] and the denominator must be nonzero.
The inequality always holds.∣x∣≤x2+y2, so the quotient lies in [−1,1] for every (x,y)=(0,0). One coordinate is not longer than the vector.
The inner field.g(x,y)=x2+y2x is continuous on R2∖{(0,0)}. x and x2+y2 are continuous, and the denominator is not zero there (quotient law).
The outer function.arcsin is continuous on its whole domain [−1,1], including the endpoints ±1. It has an infinite slope at ±1, which means it is not differentiable there, but it has no jump: arcsint→2π as t→1−.
Compose.f=arcsin∘g is continuous at every point of R2∖{(0,0)}, including points (x,0) on the x-axis where g=±1. Composition (d).
Answer.f is continuous at every point except the origin (where it is not defined). The printed key said f is discontinuous along y=0; that mixes up “infinite slope” with “discontinuous”. Near (1,0) for instance g→1 and f→2π.
Quick checkFor f(x,y)=arcsinx2+y2x, can we define f(0,0) so that f becomes continuous at the origin?
A continuous extension needs one limit, and two paths give 2π and −2π. (Along the y-axis the value is 0, a third number.) The limit at the origin does not exist, so no value works.
Open sets from continuous fields
Continuity is the tool that shows a set defined by an inequality is open. Chapter 4.1 introduced open sets; here is the bridge.
Theorem TApostol 8.5 #9; used in 8.3 #2
A strict inequality between continuous fields defines an open set
Let g be a scalar field, continuous on an open set U⊆Rn (for example on all of Rn). Then P={x∈U:g(x)>0} is open. The same holds for g<0, and for g<c or g>c with any constant c (apply the result to c−g or g−c).
In one lineIf g is a continuous scalar field on an open set, then {x:g(x)>0} is open.
Why it is trueIt lets you prove 'this set is open' by writing the set as {g>0} and checking that g is continuous, instead of finding a ball around every point.
ProofApostol 8.5 #9
The idea: At a point a with g(a) > 0, continuity with the choice ε = g(a) keeps g within g(a) of g(a), so g stays positive on a whole ball.
Let a∈P and put ε=g(a)>0.
a∈P means g(a)>0. This positive number is a legitimate choice of ε.
There is δ>0 with B(a,δ)⊆U and ∣g(x)−g(a)∣<g(a) for all x∈B(a,δ).
Continuity of g at a, together with U open so the ball can be taken inside U.
So 0<g(x)<2g(a) for x∈B(a,δ); in particular g(x)>0.
∣g(x)−g(a)∣<g(a) means −g(a)<g(x)−g(a)<g(a); add g(a) to all three parts.
So B(a,δ)⊆P, and P is open. ■
Definition of open set (4.1): every point has a ball inside.
Worked example MATH 375 HW 11 (Apostol 8.3 #2m); the key's sketch does not match this set
Is S={(x,y):(x2+y2−1)(4−x2−y2)>0} open? Sketch it and indicate its boundary.
Solution.
Write S as {g>0}.g(x,y)=(x2+y2−1)(4−x2−y2) is a polynomial, hence continuous on R2. Building continuous fields (b).
So S is open.By the theorem proved above.
Describe S. Put ρ=x2+y2. A product (ρ−1)(4−ρ) is positive when both factors have the same sign. Both positive: ρ>1 and ρ<4. Both negative: ρ<1 and ρ>4, impossible. So S={1<x2+y2<4}. Sign analysis of a product.
Identify the shape.S is the open annulus between the circles of radius 1 and radius 2 about the origin. ρ=r2, so 1<r<2.
The boundary.∂S is the two circles x2+y2=1 and x2+y2=4. There g=0, so they are not in S; every ball around such a point contains points with 1<r<2 (in S) and points outside, which is the definition of a boundary point (4.1).
Answer.S is open: the annulus 1<∥(x,y)∥<2. Its boundary is the two circles; no boundary point belongs to S. (The printed key draws two overlapping discs, which is the picture for a similar problem with non-concentric circles; its conclusion “open, boundary excluded” is right.)
Worked example Lecture 19 (second version); Apostol 8.2
Prove that the open rectangle A1×A2 is open in R2 when A1 and A2 are open intervals.
Solution.
Take a point. Let a=(a1,a2)∈A1×A2. To show a set is open we must find a ball around an arbitrary point of it.
Use that each interval is open. There are r1,r2>0 with B(a1,r1)⊆A1 and B(a2,r2)⊆A2 (balls in R are intervals). A1 and A2 are open sets of R.
Take the smaller radius. Put r=min(r1,r2). The ball in the plane must fit in both directions at once.
Check the ball. If ∥x−a∥<r, then ∣x1−a1∣≤∥x−a∥<r≤r1 and likewise ∣x2−a2∣<r2. So x1∈A1 and x2∈A2. A coordinate is not longer than the vector.
Answer.B(a,r)⊆A1×A2, so every point of the rectangle has a ball inside: it is open. (An open interval of the line, viewed as a subset of the plane, is not open in the plane: no disc fits inside a line.) ■
Worked example Apostol 8.3 #2e
Is S={(x,y):∣x∣≤1,∣y∣<1} open?
Solution.
Look for a bad point. A set is open only if every one of its points has a ball inside it. So we look for a point of S with no such ball. The suspects are the points with ∣x∣=1, where the inequality is not strict. At a point with ∣x∣<1 and ∣y∣<1 a small ball fits (the open rectangle example). Only the edge points can fail.
Take a=(1,0). It is in S because ∣1∣≤1 and ∣0∣<1. We need a point that belongs to S.
Show no ball around a fits. Let r>0 be any radius. The point b=(1+2r,0) is at distance 2r<r from a, so b∈B(a,r). But ∣1+2r∣>1, so b∈/S. Every ball around a, however small, contains a point with x>1.
Answer. No, S is not open: the point (1,0) of S has no ball around it inside S. To show a set is not open, find one point and show every ball around it leaves the set. To show it is open, take an arbitrary point and find a ball.
Same idea elsewhere· Interior, exterior and boundary in Lecture 19
Lecture 19 splits the space into three parts for a set S. A point is interior if a ball around it lies in S; exterior if a ball around it lies entirely outside S (that is, it is interior to the complement); and a boundary point otherwise. The first and third are the interior and boundary of 4.1; Apostol’s exterior is the interior of the complement. Every point is in exactly one of the three. That the derivative of a field is defined at interior points is the reason these words appear here: a derivative needs room around the point in every direction.
Where it is used
Used inside maths· Inside maths: the set of invertible matrices is open
The determinant of an n×n matrix is a polynomial in its n2 entries (2.7), so det:Rn2→R is a continuous scalar field. A matrix is invertible exactly when detA=0, that is, when (detA)2>0. By the theorem above, the set of invertible matrices is an open subset of Rn2: if A is invertible, every matrix close enough to A is invertible too. This is why a tiny perturbation of an invertible matrix cannot make it singular, and why conditioning (3.5) measures how tiny “tiny” must be.
Used in the real world· Weather and AI: fields on a grid, and the loss landscape
The ERA5 reanalysis of the European weather centre stores the wind 10 metres above the ground as two scalar fields, an east-west component and a north-south component, on a grid with 721 latitudes and 1440 longitudes (every quarter of a degree): 721×1440=1,038,240 points for each hour. Together they form a vector field on the sphere. The sea-level pressure on the same grid is a scalar field whose level curves are the isobars on every weather map.
A neural network with n weights has a loss L(w1,…,wn), a scalar field on Rn. The largest version of GPT-2 has about 1.5×109 weights, so its loss is a scalar field on a space of about 1.5 billion dimensions. Nobody can draw its graph; the two-dimensional “loss landscape” pictures in papers are the graph of L restricted to a plane through the current weights, and the contour lines in them are level sets. Training moves a point of that space downhill (chapters 5.2 and 5.10).
Traps
Watch out· Lines are not enough
A limit that is the same along every straight line can still fail to exist (x4+y2x2y), and a function with the same limit along every line can be discontinuous. A limit is a statement about all approaches. To disprove a limit, find two paths (curved ones too). To prove one, bound the difference by a function of the distance alone.
Watch out· Equal iterated limits do not give a limit
Apostol 8.5 #4: f=x2y2+(x−y)2x2y2 has both iterated limits equal to 0, but along y=x its value is 1. The converse of Apostol 8.5 #2 is false. Iterated limits are two limits in one variable at a time, which is much weaker than the two-variable limit.
Watch out· Separately continuous is not continuous
A function can be continuous in x for each y and continuous in y for each x, and still be discontinuous (Peano’s x2+y2xy). Joint continuity is what the course and the theorems of the next chapters use.
Watch out· Domain and discontinuity are different things
A point where f is not defined is not automatically a “point of discontinuity”, and a function can be continuous everywhere on its domain even if it has infinite slope somewhere. The key to HW 11 #1(f) and #1(j) made this mistake: arcsin and arccos are continuous on all of [−1,1], endpoints included. First find the domain; then use compositions of continuous fields to conclude continuity on it.
Watch out· A bound in polar coordinates must be free of θ
∣rcos2θsinθ∣≤r proves a limit. An expression like r2cos4θ+sin2θrcos2θsinθ does not, because near θ=0 its size is not controlled by r.
Watch out· There is no quotient of vectors
F/G for vector fields has no meaning (Lecture 19: “don’t have such an object”). Dot products F⋅G and cross products make sense; dividing by a vector does not. The quotient law is for scalar fields only.
Problems
checkApostol 8.3 #1a
Describe the level sets of f(x,y)=x2+y2 for c=0,1,4,9.
Solution
x2+y2=c. For c=0 it is the single point (0,0); for c=1,4,9 it is the circle about the origin of radius 1,2,3. For c<0 the level set is empty.
checkApostol 8.3 #1b
Describe the level set exy=c for c=e−2,1,e.
Solution
exy=c means xy=lnc. For c=e−2: xy=−2, a hyperbola in the second and fourth quadrants. For c=1: xy=0, the two coordinate axes. For c=e: xy=1, a hyperbola in the first and third quadrants.
checkApostol 8.3 #2c and #2e
Are {(x,y):∣x∣<1,∣y∣<1} and {(x,y):∣x∣≤1,∣y∣<1} open?
Solution
The first is the product of the open intervals (−1,1)×(−1,1), hence open (worked example). The second is not open: the point (1,0) belongs to it, but every ball around (1,0) contains points with x>1, which are not in the set.
checkMATH 375 HW 11 (Apostol 8.5 #1b)
Find the set of points where f(x,y)=log(x2+y2) is continuous.
Solution
x2+y2 is continuous, and log is continuous on (0,∞). So f is continuous wherever x2+y2>0, that is at every point except (0,0), where it is not defined.
useApostol 8.5 #6
Let f(x,y)=x2+y2x2−y2 for (x,y)=(0,0). Find the limit of f along the line y=mx. Can f(0,0) be defined so that f is continuous at the origin?
Solution
f(x,mx)=x2(1+m2)x2(1−m2)=1+m21−m2, which depends on m: it is 1 on the x-axis, −1 on the y-axis and 0 on the diagonal. Two paths give different limits, so lim(x,y)→(0,0)f does not exist and no value of f(0,0) makes f continuous.
useMATH 375 HW 11 (Apostol 8.5 #1j); the printed key drops the boundary cases
Find the set where f(x,y)=arccosx/y is continuous.
Solution
Domain: y=0 and 0≤x/y≤1 (for ⋅ to be defined and for the value to lie in [−1,1], the domain of arccos). Within this set, x/y is continuous (quotient with y=0), ⋅ is continuous on [0,∞) and arccos is continuous on [−1,1], endpoints included. So f is continuous on its whole domain: {y>0,0≤x≤y}∪{y<0,y≤x≤0}. That includes the points with x=0 (where f=2π) and with x=y (where f=0). The printed key kept only the strict inequalities.
useApostol 8.5 #4
Let f(x,y)=x2y2+(x−y)2x2y2 when the denominator is not zero. Show that both iterated limits at the origin are 0, but that f has no limit at the origin.
Solution
For fixed x=0, as y→0 the numerator tends to 0 and the denominator to x2=0, so f(x,y)→0; thus limx→0limy→0f=0. By symmetry in x and y the other order also gives 0. On the line y=x: f(x,x)=x4+0x4=1. A path with value 1 and a path with limit 0 (the axes) show that the two-variable limit does not exist.
useApostol 8.5 #7
Let f(x,y)=1 if 0<y<x2 and f(x,y)=0 otherwise. Show f→0 along every straight line through the origin, find a curve through the origin on which f=1 except at the origin, and decide whether f is continuous at the origin.
Solution
A line y=mx with m=0 lies in {0<y<x2} only if 0<mx<x2, which for small ∣x∣ fails (it would need ∣x∣>∣m∣). So near the origin f=0 on every such line; on the axes f=0 as well. On the parabola y=x2/2, for x=0: 0<2x2<x2, so f=1. Since f(0,0)=0, f is not continuous at the origin.
proveApostol 8.5 #2
Suppose lim(x,y)→(a,b)f(x,y)=L and that for every y near b (y=b) the limit φ(y)=limx→af(x,y) exists. Prove limy→bφ(y)=L.
Solution
Plan. Use the two-variable ε and δ with y held fixed, then let x→a inside the inequality.
Let ε>0. Choose δ>0 with ∣f(x,y)−L∣<ε whenever 0<∥(x−a,y−b)∥<δ. Fix y with 0<∣y−b∣<δ. For every x with ∣x−a∣<δ2−(y−b)2 we have 0<∥(x−a,y−b)∥<δ (positive because y=b), so ∣f(x,y)−L∣<ε. Letting x→a, the limit preserves the non-strict inequality: ∣φ(y)−L∣≤ε. This holds for all y with 0<∣y−b∣<δ, so φ(y)→L as y→b. ■ (The same argument with the roles of x and y swapped gives the other iterated limit.)
prove
Prove that if f is a continuous scalar field on Rn and c is a number, then {x:f(x)<c} is open and {x:f(x)≥c} is closed.
Solution
Plan. Apply the strict-inequality theorem to g=c−f, then take a complement.
g=c−f is continuous (difference of continuous fields), so {g>0}={f<c} is open. Its complement is {f≥c}, which is closed by the definition of a closed set (4.1). ■
proveApostol 8.4 Example 3
Prove that a linear map T:Rn→Rm satisfies ∥T(h)∥≤K∥h∥ for some constant K, and deduce that T is continuous.
Solution
Plan. Write h in the standard basis and use the triangle inequality.
h=∑khkek and T is linear, so T(h)=∑khkT(ek). By the triangle inequality and ∣hk∣≤∥h∥: ∥T(h)∥≤∑k∣hk∣∥T(ek)∥≤∥h∥∑k∥T(ek)∥. Take K=∑k∥T(ek)∥. Then ∥T(a+h)−T(a)∥=∥T(h)∥≤K∥h∥, which is below ε when ∥h∥<ε/(K+1). So T is continuous at every a. ■
prove
Write an ε and δ argument showing that f(x,y)=x4+y2x2y (with f(0,0)=0) is not continuous at the origin.
Solution
Plan. To deny continuity, exhibit one ε for which no δ works.
Take ε=41. Let δ>0 be arbitrary. Choose x>0 so small that x1+x2<δ (possible since the left side tends to 0), and let y=x2. The point (x,x2) has length x1+x2<δ, yet ∣f(x,x2)−f(0,0)∣=21>41. So no δ works for this ε, and f is not continuous at the origin. ■
stretch
For a,b>0 and c>0, let f(x,y)=(x2+y2)c∣x∣a∣y∣b with f(0,0)=0. Prove that f is continuous at the origin if and only if a+b>2c.
Solution
Plan. If a+b>2c, bound by a power of r. If not, the diagonal is a path along which f does not tend to 0.
If a+b>2c: ∣x∣≤r and ∣y∣≤r, so f≤r2crarb=ra+b−2c→0 as r→0. By the squeeze, f→0=f(0,0). If a+b≤2c: on the diagonal y=x, f(x,x)=2c∣x∣2c∣x∣a+b=2−c∣x∣a+b−2c, which equals the constant 2−c=0 if a+b=2c and tends to ∞ if a+b<2c. Either way it does not tend to 0=f(0,0), so f is not continuous. ■ (Examples: x2y/(x2+y2) has a+b=3>2; xy/(x2+y2) has a+b=2=2c.)
stretchMATH 375 Final Review, 8.4
Give an example of a function f:R2→R that is continuous in each variable separately everywhere and yet discontinuous at the origin, and one that has limit 0 along every line through the origin but is discontinuous at the origin. Are the two examples the same function?
Solution
The first: x2+y2xy with f(0,0)=0 (worked above). It is not an example of the second kind, since along y=x its value is 21. The second: x4+y2x2y with f(0,0)=0: along every line the limit is 0, but along y=x2 the value is 21. It is also separately continuous at the origin (on the axes it is 0), though one would still check separate continuity at other points, where it is a quotient with nonzero denominator and hence continuous. So the second function is a counterexample to both claims at once; the first is a counterexample to the first claim only.
Summary
A scalar fieldf:S→R (S⊆Rn) gives a number at each point; a vector fieldF:S→Rm gives a vector, with m scalar-field components. A level setL(c)={f=c} is the slice of the graph at height c, projected to the floor.
limx→aF(x)=b means ∥F(x)−b∥→0 as ∥x−a∥→0. The laws of 1.2 hold (sum, scalar multiple, dot product, norm, and quotients of scalar fields); a field has a limit exactly when each component does.
In Rn a point can be approached along infinitely many paths. Two paths with different limits (or one path with no limit) prove that a limit does not exist. Lines are not enough: x4+y2x2y has limit 0 along every line and no limit.
To prove a limit exists, squeeze: bound ∥F(x)−b∥ by a function of r=∥x−a∥ alone. In polar coordinates the bound must be free of θ.
A field is continuous at a if F(a) is defined and equals the limit. Sums, products, quotients (nonzero denominator), norms, polynomials, linear maps and compositions of continuous fields are continuous; log(sin2(x2+y2)) fails to be continuous exactly on the circles x2+y2=mπ.
Separately continuous does not mean jointly continuous (Peano). Equal iterated limits do not give a limit.
A strict inequality g>0 for a continuous g defines an open set: this is how to show that sets such as the annulus 1<∥x∥<2 are open, and that the invertible matrices form an open set.
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
MATH 375: Lecture 19 and Apostol 8.1 to 8.5. The examples (x − y)/(x + y), log(sin²(x² + y²)) and the homework on level sets, continuity sets and iterated limits are all worked below.
MATH 521: 521 proves that a continuous map sends compact sets to compact sets, and that continuity can be tested with sequences. The path test below is the sequence test, and the failure of line-by-line checking is why 521 insists on ε and δ.
MATH 551: Topology defines continuity by open sets alone. The theorem that a strict inequality between continuous fields gives an open set is the first half of that definition.
AI: A loss function is a scalar field on the space of all weights. Every picture of a 'loss landscape' is a graph or a set of level curves of that field.