STATUS: Draft
import numpy as np
import sympy as sp
import pickle
from IPython.display import HTML, Image
import ipywidgets as widgets
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
import pandas as pd
import itertools
pd.set_option('display.max_colwidth', None)
import treelib as tr
# function to print latex
def renderListToLatex(e):
latex_rendering = []
for i in range(len(e)):
latex_rendering.append("$$" + sp.latex(e[i]) + "$$")
return(HTML("".join(latex_rendering[0:])))
Observe: The previous notebook provided a possible solution to a cubic and quartic equation.
Observe: This solution is based on extending the BiTri Roofed Polygon idea and adopting a different view in regard to the term of $c_1$ in order to remove the need for the different signs that appear in the terms of the solution (i.e. so every term can be positive).
Observe: A solution to the equation $c_0 - c_1x + c_2x^2 + c_3x^3 + c_4x^4 = 0$ was given as:
$$x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \frac{(2m + 3n + 4p)!}{(1 + m + 2n + 3p)!m!n!p!} \frac{c_0^{1 + m + 2n + 3p} c_2^{m} c_3^{n} c_4^{p} }{c_1^{4p + 2m + 3n + 1}} $$Observe: $c_0 - c_1x + c_2x^2 + c_3x^3 + c_4x^4 = 0$ is slightly different from the original general cubic equation at the beginning of the investigation, however it simplifies the process of extending this theorem to higher degrees.
Observe: The single minus sign in the revised general form of the cubic now appears in front of the linear term.
Theorem: A solution to
$$ c_0 - c_1x + c_2x^2 + c_3x^3 + c_4x^4 + c_5x^5 = 0 $$is
$$x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} \frac{c_0^{1 + m + 2n + 3p + 4q} c_2^{m} c_3^{n} c_4^{p} c_5^q }{c_1^{5q + 4p + 2m + 3n + 1}} $$and this have been arbitrarily extendeded from the formula to sovle degree 4 polynomials.
Aim: To understand if is possible to solve a general quintic equation using the above approach, where the forumula has been extended to degree 5.
Observe: The above theorem is not intended to imply the use of infinite processes. Possible solutions are linked to a specifically chosen level of truncation, which is expressed as a finite rational expression, which can explicitly disregard higher terms.
Observe: This means that $\Sigma_{x=0}^+$ notation is not intended to imply an infinite sum but signal the need for a choice to truncate the computation.
Let the following be unknown types.
c0, c1, c2, c3, c4, c5, x, d2, d3, d4, d5, _lambda, y = sp.symbols('c0, c1, c2, c3, c4, c5, x, d2, d3, d4, d5, lambda, y')
Let $P1$ be a general quintic equation.
P1 = sp.Eq(c0 - c1 * x + c2 * x**2 + c3 * x**3 + c4 * x**4 + c5 * x**5, 0)
P1
Let $P2$ be a special case of $P1$ where $c_0 = c_1 = 1$
P2 = P1.subs({c0:1, c1:1})
P2
Observe: Equating $c_0 = c_1 = 1$ allows the formula used in the theorem to be simplified where there are no $c_i$ variables in the denominator.
$$x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} c_2^{m} c_3^{n} c_4^{p} c_5^q $$Observe: A natural question to ask when the equation is in this form, is whether it is possible to show that the general case can be a consequence of this special case.
Observe: If the general case can be derived as a consequence of the special case, this will allow the theorem to be simplified.
Definition: The special case of the general cubic (where $c_0 = c_1 = 0$) is called the geometrical form of the quintic equation.
Observe: There is a link between the multiplicative structure of roofed polygons up to an arbitrary degree and the geometric form.
Observe: The geometric form of the quintic equation is then:
$$c_{2} x^{2} + c_{3} x^{3} + c_{4} x^{4} + c_{5} x^{5} - x + 1 = 0 $$Aim: Undertake algebraic manipulation of the geometric form to show that the general form is a consequence of the geometric form.
Observe: Recall the $P2$ is the geometric form of the general quintic equation.
P2
Let $P3$ be the geometric form of a general quintic, with a substution of $c_i$ to $d_i$ to help simplify the algebraic manipulations
P3 = P2.subs({c2:d2, c3:d3, c4: d4, c5:d5})
P3
Observe: The goal of the algebraic manipulations should allow it to be possible to recover the following theorem starting from $P3$:
$$x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} d_2^m d_3^n d_4^p d_5^q $$Let $P5$ be $P3$ where both sides are multipled by $C_0$:
P4 = sp.Poly(sp.expand(P3.lhs * c0))
P5 = sp.Eq(sp.expand(P3.lhs * c0), 0)
P5
Observe: Consider that the linear term in $x$ should have a coefficient of $c_1$, not $c_0$, to recover the formula of the general form.
Observe: To change these coefficients, a transformation $y = \lambda x$ can be used.
Let $P6$ be a subsitution of $P5$ using the transformation $x = \frac{y}{\lambda}$.
P6 = sp.Eq(P5.lhs.subs(x, y / _lambda), 0)
P6
Observe: The original equation (though here in $y$, not $x$) should be: $\displaystyle c_{2} y^{2} + c_{3} y^{3} + c_{4} y^{4} + c_{5} y^{5} - y + 1 = 0$
Let $P7$ be a substitution on $P6$ where $\lambda = \frac{c_0}{c_1}$, (which also implies that $y = \frac{c_0}{c_1} x$)
P7 = sp.Eq(P6.lhs.subs(_lambda, c0 / c1), 0)
P7
Observe: To return to the general form, it must be the case that:
$$ \frac{c_{1}^{2} d_{2}}{c_{0}} = c_2 $$$$ \frac{c_{1}^{3} d_{3}}{c_{0}^2} = c_3 $$$$ \frac{c_{1}^{4} d_{4}}{c_{0}^3} = c_4 $$$$ \frac{c_{1}^{5} d_{5}}{c_{0}^4} = c_5 $$Let $P8$ through $P11$ be equations of the above, and let $P13$ be solutions to $d_i$.
P8 = sp.Eq((c1**2 * d2) / c0, c2)
P9 = sp.Eq((c1**3 * d3) / c0**2, c3)
P10 = sp.Eq((c1**4 * d4) / c0**3, c4)
P11 = sp.Eq((c1**5 * d5) / c0**4, c5)
P12 = sp.solve([P8, P9, P10, P11], (d2, d3, d4, d5))
rhsValues = list(P12.keys())
lhsValues = list(P12.values())
P13 = [sp.Eq(rhsValues[i], lhsValues[i]) for i in range(len(rhsValues))]
renderListToLatex(P13)
Observe: These values can be substituted into $$x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} d_2^m d_3^n d_4^p d_5^q $$
To give the following:
$$y = \frac {c_0}{c_1} x= \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} (\frac{c_0}{c_1})(\frac{c_{0} c_{2}}{c_{1}^{2}})^m (\frac{c_{0}^{2} c_{3}}{c_{1}^{3}})^n (\frac{c_{0}^{3} c_{4}}{c_{1}^{4}})^p (\frac{c_{0}^{4} c_{5}}{c_{1}^{5}})^q $$Observe: Recall the proposed theorem for the solution for the general quintic provided at the beginning of this notebook:
$$ x = \Sigma_{m = 0}^+ \Sigma_{n = 0}^+ \Sigma_{p = 0}^+ \Sigma_{q = 0}^+ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} \frac{c_0^{1 + m + 2n + 3p + 4q} c_2^{m} c_3^{n} c_4^{p} c_5^q }{c_1^{5q + 4p + 2m + 3n + 1}} $$Observe: If the previous 2 formulas are equivalent (i.e meaning that the general case can be seen as a consequence of the special case) it must be the case that:
$$ \frac{c_0^{1 + m + 2n + 3p + 4q} c_2^{m} c_3^{n} c_4^{p} c_5^q }{c_1^{5q + 4p + 2m + 3n + 1}} = (\frac{c_0}{c_1})(\frac{c_{0} c_{2}}{c_{1}^{2}})^m (\frac{c_{0}^{2} c_{3}}{c_{1}^{3}})^n (\frac{c_{0}^{3} c_{4}}{c_{1}^{4}})^p (\frac{c_{0}^{4} c_{5}}{c_{1}^{5}})^q $$Observe: It is true that $\frac{c_0^{1 + m + 2n + 3p + 4q} c_2^{m} c_3^{n} c_4^{p} c_5^q }{c_1^{5q + 4p + 2m + 3n + 1}} = (\frac{c_0}{c_1})(\frac{c_{0} c_{2}}{c_{1}^{2}})^m (\frac{c_{0}^{2} c_{3}}{c_{1}^{3}})^n (\frac{c_{0}^{3} c_{4}}{c_{1}^{4}})^p (\frac{c_{0}^{4} c_{5}}{c_{1}^{5}})^q$
Observe: This means that the value for $y$ (which can be regarded as a scaled version of $x$ using $\lambda$) is a solution to the gneral equation $c_0 - c_1x + c_2x^2 + c_3x^3 + c_4x^4 = 0$
Observe: This establishes that the special geometric form where $c_0 = c_1 = 1$ implies the general solution.
Observe: This also shows that the values, $1 + m + 2n + 3p + 4q$ arise as scaling factors and, in order to prove the general solution, it suffices to prove the simpler geometric form. In the simpler geometric form, $\displaystyle c_{2} y^{2} + c_{3} y^{3} + c_{4} y^{4} + c_{5} y^{5} - y + 1 = 0$, $c_0$ and $c_1$ are not required and appear in the general form as a consequence of scaling.
Observe: This is a move from away from the original investigation where that explored solutions to $c_0$ using a power series in $t$, however $c_0$ is no longer needed for this solution.
Observe: This simplification means that at arbitrarily higher degrees, computations will be simpler.
Todo: Verification is still needed to demonstrate this theorem.