Maulana's personal blog
Main feedMath/PhysicsLarge Language Model - Learning NotesSoftware Development

Pythagorean Theorem

04-May-2023

Definition

Wikipedia Link

Given aa, bb, rr real numbers.

r2=a2+b2r^2 = a^2 + b^2

Insights

Any square numbers can be decomposed into two square numbers

Length scales proportionally

Euclidean geometry needs to have Pythagorean theorem to be true

If in a geometry, Pythagorean theorem holds true. Then Pythagorean theorem will also applies for the n-th derivative of the metric.

Collection of proofs sketches

Einstein’s proof

This is an interesting proof because it doesn’t require any image or drawing. Only definition and set relationship.

Given a right triangle, one of its side is a hypothenuse rr. The other side is aa and bb. A triangle is defined by 3 angles α\alpha, β\beta, γ\gamma and its hypothenuse. All by definition.

A hypothenuse can be dissected with equal parts of right triangle, so any right triangle is composed of two right triangles. Call the dissected triangles AA and BB. Call original triangle as RR

All these triangles is guaranteed to be similar because two of the angles are the same for all triangles.

Assume a function called Area(α,β,γ,r)Area(\alpha,\beta,\gamma,r). It doesn’t matter what the formula to calculate the area is. By function mapping, it should be possible to map these parameter to a certain area.

Angle γ\gamma can be calculated from α\alpha and β\beta because the total has to be constant for all kind of triangles. (can be set to 180 degrees, although any value won’t matter)

Angle β\beta is definitely determined to be a constant for any right triangles. (can be set to 90 degrees, although any value won’t matter)

For angle α\alpha it has to be the same for triangle AA, BB, and RR.

So, actually the entire setup is invariant to above parameters, and only dependent solely on the length of rr.

Area(α,β,γ,r)=Area(r)Area(\alpha,\beta,\gamma,r) = Area(r)

Key insight is that:

Area(r)=Area(a)+Area(b)Area(r) = Area(a) + Area(b)

Any area of triangle should be proportional to a square rectangle of one of its sides. This is because making the square bigger should also make the triangle bigger the same way.

All these triangles uses the same square grid, so the proportionality has to be the same. So just call it kk.

Finish the proof

Area(r)=Area(a)+Area(b)kr2=ka2+kb2r2=a2+b2Area(r) = Area(a) + Area(b) \\ kr^2 = ka^2 + kb^2 \\ r^2 = a^2 + b^2

Proof by differential

Suppose that this holds true

r2=a2+b2r^2 = a^2 + b^2

Then we want to proof it that it was necessary for this to be a right triangle.

For ease of convention, rename a=xa=x and b=yb=y. Let xx, yy, and rr be arbitrary function that depends on a shared parameter tt.

Inspect derivative with respect to tt

2rdrdt=2xdxdt+2ydydtrdrdt=xdxdt+ydydt2r\frac{dr}{dt} =2x\frac{dx}{dt} + 2y\frac{dy}{dt} \\[8pt] r\frac{dr}{dt} =x\frac{dx}{dt} + y\frac{dy}{dt} \\[8pt]

Multiply by rr and substitute r2r^2 again

(x2+y2)drdt=rxdxdt+rydydtxxdrdt+yydrdt=xrdxdt+yrdydtx(xdrdt)+y(ydrdt)=x(rdxdt)+y(rdydt)(x^2+y^2)\frac{dr}{dt} =rx\frac{dx}{dt} + ry\frac{dy}{dt} \\[8pt] x\cdot x\frac{dr}{dt}+y\cdot y\frac{dr}{dt} =x\cdot r \frac{dx}{dt} + y\cdot r\frac{dy}{dt} \\[8pt] x\cdot (x\frac{dr}{dt})+y\cdot (y\frac{dr}{dt}) =x\cdot (r \frac{dx}{dt}) + y\cdot (r\frac{dy}{dt}) \\[8pt]

Taking a look at how the terms organized in the left side and right side. Coefficient of xx and yy must each corresponds. So we got two equations:

xdrdt=rdxdtdrdx=rxx\frac{dr}{dt} = r \frac{dx}{dt} \\[8pt] \frac{dr}{dx} = \frac{r}{x} \\[8pt]

And

ydrdt=rdydtdrdy=ryy\frac{dr}{dt} = r \frac{dy}{dt} \\[8pt] \frac{dr}{dy} = \frac{r}{y} \\[8pt]

If we subsitute this back, we can also get

ydxdt=xdydtdydx=yxy\frac{dx}{dt} = x \frac{dy}{dt} \\[8pt] \frac{dy}{dx} = \frac{y}{x}

There should be no preferences between xx and yy. Each must changes wrt to rr the same way. So this satisfy scaling property. If this satisfy scaling property, then xx and yy are completely normal/independent/perpendicular. If xx and yy has to be perpendicular, then it has to be a right triangle. So it completes the proof.

To illustrate this, use contradiction. I can think of several alternatives.

Contradict the shape of the triangle

Suppose at t=0t=0 all r0r_0,x0x_0,y0y_0 form a Pythagorean triplet and a right triangle. Call the ratio of the sides that is not hypothenuse as kk, written:

y0x0=k\frac{y_0}{x_0}=k

Now, claim that when xx and yy changes, even though it satisfies Pythagorean triplet, the triangle after the changes is not a right triangle.

From the differential equation of yy and xx we can derive yy as a function of xx alone.

dydx=yxdyy=dxxlny=lnx+lnCyx=C=k\frac{dy}{dx} = \frac{y}{x} \\[8pt] \int \frac{dy}{y} = \int \frac{dx}{x} \\[8pt] \ln{|y|} = \ln{|x|} + \ln{C} \\[8pt] \left| \frac{y}{x} \right| = C = k \\[8pt]

CC is just a constant so it essentially the same as kk.

Because the ratio is the same even when the sides changes, then it had to be similar triangle with the initial triangle. Since the initial triangle is a right triangle, then after the changes it has to be a right triangle again.

So the claim is contradictory and Pythagorean triplet has to be true for all right triangles, with any initial constant kk.

Contradict the independence of the axis

For a right triangle to work, xx and yy has to be always perpendicular.

Given an independent parameter tt, it must change xx and yy independently.

Now, claim that xx and yy is independent. Meaning, the partial derivatives has to be as follow:

dydx=ytdtdx+yxdxdxdydx=ytdtdx+yx\frac{dy}{dx} = \frac{\partial y}{\partial t}\frac{dt}{dx} + \frac{\partial y}{\partial x}\frac{dx}{dx} \\[8pt] \frac{dy}{dx} = \frac{\partial y}{\partial t}\frac{dt}{dx} + \frac{\partial y}{\partial x} \\[8pt]

The equation above can be understood this way:

Left side has to be non-zero expression (we already derive it before). If we express yy and xx using only tt, it will mean the right hand side, first term has some expression. But yx=0\frac{\partial y}{\partial x}=0 if yy and xx is independent.

Meanwhile, using the previous result of the total derivative of Pythagorean theorem, we add extra constraint that rr doesn’t change.

This is because we want to check only the relation between xx and yy given parameter tt. This will cause drdt=0\frac{dr}{dt}=0

drdt=xrdxdt+yrdydt0=xdxdt+ydydtdydx=xy\frac{dr}{dt} =\frac{x}{r}\frac{dx}{dt} + \frac{y}{r}\frac{dy}{dt} \\[8pt] 0 =x \frac{dx}{dt} + y \frac{dy}{dt} \\[8pt] \frac{dy}{dx} = -\frac{x}{y} \\[8pt]

The above differential equation is total and can be solved. But it didn’t tell us much. If we integrate it, we are back to Pythagorean equation. So, we showed it to be dependent (contradiction), but not conclusive because the dependency are back to the original equation.

We try a different approach. Manipulate the equation further, but substitute the constancy of rr later.

From the original derivation, we subsitute xr\frac{x}{r} and yr\frac{y}{r}. For sufficient reason, let be rr a constant non-zero, so we can divide it.

drdt=(xr)dxdt+(yr)dydtdrdt=(dxdr)dxdt+(dydr)dydt(drdt)drdt=(dxdt)dxdt+(dydt)dydt(drdt)2=(dxdt)2+(dydt)2\frac{dr}{dt} =\left(\frac{x}{r}\right)\frac{dx}{dt} + \left(\frac{y}{r}\right)\frac{dy}{dt} \\[8pt] \frac{dr}{dt} =\left(\frac{dx}{dr}\right)\frac{dx}{dt} + \left(\frac{dy}{dr}\right)\frac{dy}{dt} \\[8pt] \left(\frac{dr}{dt}\right)\frac{dr}{dt} =\left(\frac{dx}{dt}\right)\frac{dx}{dt} + \left(\frac{dy}{dt}\right)\frac{dy}{dt} \\[8pt] \left(\frac{dr}{dt}\right)^2 =\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 \\[8pt]

Unrelated with the proofing method, this is actually quite an interesting corollary. If Pythagorean theorem is true, it was direct consequences that the derivative of each variables with respect to independent parameter tt is also a Pythagorean triplet. Applying this statement to itself, if the n-th derivative exists, it will also form a Pythagorean triplet. That means Pythagorean theorem is invariant to derivative operator in Euclidean geometry. Then by Fundamental Theorem of Calculus, it would mean that it is also invariant to integral.

Now back with the proof. Since rr is constant, it cause drdt=0\frac{dr}{dt}=0. The consequence is quite surprising.

0=(dxdt)2+(dydt)20=\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 \\[8pt]

This is a square function. In the domain of real number, there is no solution. Meaning xx and yy can’t be independent, because we already assume Pythagorean triplets were real numbers. This completes the proof by contradition.

However, there is another way to proof it.

Suppose that Pythagorean theorem can be applied in complex numbers. Proofing it will also proof it in the real numbers. If all rr, xx, and yy complex numbers, then we can solve equation above. One of the solution is just rearranging and taking the square roots. Other solution is just a difference in sign due to absolute values.

(dydt)2=(dxdt)2(dydx)2=1dydx=±iy=±ix+C\left(\frac{dy}{dt}\right)^2= - \left(\frac{dx}{dt}\right)^2 \\[8pt] \left(\frac{dy}{dx}\right)^2= -1 \\[8pt] \frac{dy}{dx}= \pm i \\[8pt] y = \pm ix + C \\[8pt]

The difference with the proof is that we directly proof that yy is dependent on xx in a very particular way. In complex number, multiplication by ii means it rotate the number by 90 degrees.

In other words, yy is always perpendicular to xx. So it is dependent in such a way that it guarantees the orthogonality of xx and yy, hence it is always a right triangle.

The problem with this line of reasoning is because the construction of Complex numbers usually uses Pythagorean theorem itself. If we have alternative construction using only group theory and definition of ii from a square root, then it can be used to prove Pythagorean theorem.

Proof by matrix

I found it from Terrence Tao’s article.

I think it is quite fascinating. The first proof is essentially the same with “Einstein’s proof”.

The second part is interesting because it is handwaived from matrix construction without prior assumption!

Let a matrix exists like this (call it MM):

(abba)\begin{pmatrix} a & b \\ -b & a \end{pmatrix}

The determinant of the matrix is conveniently a2+b2a^2+b^2

Now choose a second matrix like this (call it CC):

(c00c)\begin{pmatrix} c & 0 \\ 0 & c \end{pmatrix}

The determinant of the matrix is c2c^2

Now claiming a2+b2=c2a^2+b^2=c^2 (the Pythagorean theorem) is equivalent in saying that there exists a matrix RR such that if multiplied in any direction, it will cause both sides to be true, because the determinant is the same. Meaning, these will work:

MR=CRM=CCR=MRC=MMR=C \\[8pt] RM=C \\[8pt] CR=M \\[8pt] RC=M \\[8pt]

But for any matrices with non-zero determinant, you can always find RR by inverting, like this:

R=MC1R=MC^{-1} \\[8pt]

Given actual numbers aa, bb, cc, then this is just a numerical works.

The proof is then to cover that these operation is always possible.

First, note that CC is a diagonal matrix. It will always have an inverse as long as cc is not zero.

Second, it is always possible to do matrix multiplication.

So RR will exists.

Third, the determinant can be calculated easily. Meaning determinant of RR is always 1, following the rule below:

det(R)=det(M)det(C1)=1\det(R)=\det(M)\det(C^{-1}) = 1

Lastly, if we want to define matrix RR from a more generic function, there are only some restricted class of function with determinant to be always 1, and always invertible. This is called the rotation matrix which has a more generic form like this:

R(θ)=(cosθsinθsinθcosθ)R(\theta) = \begin{pmatrix} \cos{\theta} & -\sin{\theta} \\ \sin{\theta} & \cos{\theta} \end{pmatrix}

However, note that it doesn’t really necessary to define the trig function. Just knowing that RR always exists is enough for the proof. The key to the proof is how we make sure that the matrix imply that each basis is orthogonal from each other (so it became a right triangle).


Rizky Maulana Nugraha

Written by Rizky Maulana Nugraha
Software Developer. Currently remotely working from Indonesia.
Twitter FollowGitHub followers