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 Recall the quintic equation in geometric form:
$ \displaystyle c_{2} x^{2} + c_{3} x^{3} + c_{4} x^{4} + c_{5} x^{5} - x + 1 = 0 $
Observe: Recall this has the proposed solution:
$$ 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: This solution is a polynomial power series in $c2, c3, c4$ and $c5$.
Aim: This solution should be computationally verified up to a certain degree.
Observe: The verification to be undertaken is not intended to work with infite sums or infite computations, but should be truncated to an arbitrary number.
Observe: The proposed solution includes an extension of the BiTriQuad numbers.
Definition: The extension of the BiTriQuad numbers to degree 5 is defined as BiTriQuadQuintic numbers:
$$ \frac{(2m + 3n + 4p + 5q)!}{(1 + m + 2n + 3p + 4q)!m!n!p!q!} $$Definition: These types of numbers (such as BiTri, BiTriQuad etc.) can be denoted as Roofed Polygonal Subdivision numbers (here in the special case of degree 5).
Let $P1$ be a function that implements $r$
Let the following be unknown types.
m, n, p, q, c2, c3, c4, c5, x = sp.symbols('m, n, p, q, c2, c3, c4, c5, x')
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 $P1$ converted to geometric form.
P2 = P1.subs({c0:1, c1:1})
P2
Let $P3$ be a function that returns a roofed polygon subdivision number (to degree 5).
def P3(m, n, p, q):
numerator = sp.factorial(2 * m + 3 * n + 4 * p + 5 * q)
denominator = sp.factorial(1 + m + 2 * n + 3 * p + 4 * q) * sp.factorial(m) * sp.factorial(n) * sp.factorial(p) * sp.factorial(q)
return(numerator / denominator)
Example: $P3$ evaluated at $(3, 2, 0, 0)$.
P3(3, 2, 0, 0)
Let $P4$ be a function that returns a roofed polygon subdivision number for variables $c_2, c_3, c_4$ and $c_5$.
def P4(m, n, p, q, c2, c3, c4, c5):
numerator = sp.factorial(2 * m + 3 * n + 4 * p + 5 * q)
denominator = sp.factorial(1 + m + 2 * n + 3 * p + 4 * q) * sp.factorial(m) * sp.factorial(n) * sp.factorial(p) * sp.factorial(q)
v = (numerator / denominator) * (c2**m * c3**n * c4**p * c5**q)
return(v)
Example: Evaluate $P4$ at $m, n, p, q, c2, c3, c4, c5$.
P4(m, n, p, q, c2, c3, c4, c5)
Let $P5$ be a function that implements:
$$ 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 $$def P5(degree = 2):
degree = 2
F1 = []
for m in range(0, degree):
for n in range(0, degree):
for p in range(0, degree):
for q in range(0, degree):
F1.append(P4(m, n, p, q, c2, c3, c4, c5))
return(np.sum(F1))
Let $P6$ be $P5$ evaluated with an an degree of $2$.
P6 = P5(2)
P6
Let $P7$ be the geometric form of the the general quintic equation, with a subsution of $x$ for $P6$
P7 = P2.subs(x, P6)
P7
Observe: To evaluate $P7$ and and ascertain if it verifies $P2$ (truncated to degree 2), a power series expansion is needed.
Let $P8$ be a power series expansion of $P7$ in variables $c_2, c_3, c_4$ and $c_5$.
P8 = sp.expand(P7.lhs).series(c2, 0, 2).removeO().series(c3, 0, 2).removeO().series(c4, 0, 2).removeO().series(c5, 0, 2).removeO()
P8
Observe: this result verifies up to degree 2 that the solution found using a substitution of $P6$ for $x$ satisfies $ \displaystyle c_{2} x^{2} + c_{3} x^{3} + c_{4} x^{4} + c_{5} x^{5} - x + 1 = 0 $
Todo: Find a a faster implementation in Python for the multivariate series expansion.