STATUS: Draft
import numpy as np
import sympy as sp
import pickle
from IPython.display import HTML
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)
#
# function to print latex
def renderListToLatex(e):
latex_rendering = []
for i in range(len(e)):
latex_rendering.append("$$" + sp.latex(e[i]) + "$$<br/>")
return(HTML("".join(latex_rendering[0:])))
Aim: Understand the bridge betwen polygon subdivisions and polynomial equations
Observe consider the operation $\bar{\triangledown}$ and its use as an operation between multisets of polygonal subdivisions
Observe It is possible to use this operation to operate on multisets:
$$ [\text{all polygons that can be divided into triangles}] \bar{\triangledown} [\text{all polygons that can be divided into triangles}] $$Observe: It is to find these combinations, it is possible to use concatenation of trees and come at this from a computational perspective.
Let $F1$ be a function to calculate all combinations of rooted planar binary trees
def F1(s):
if len(s) == 1:
yield s
else:
for i in range(1, len(s), 2):
for l in F1(s[:i]):
for r in F1(s[i+1:]):
yield '({}{}{})'.format(l, s[i], r)
allComb = []
for t in F1('x:x:x:x'):
allComb.append(t)
#allComb
Let $F2$ be a function to multiply rooted binary trees.
def F2(t1, t2):
treeStructure = ['x:' for i in range(t1 + t2)]
t = ''.join(treeStructure)[:-1]
allComb = []
for i in F1(t):
allComb.append(i)
return(allComb)
Observe: The nature of this multiplication on multisets yields all combinations of multiples.
print("Multiplication (2, 0):\n", F2(2, 0))
print("\nMultiplication (0, 2):\n", F2(0,3))
print("\nMultiplication (2, 3):\n",F2(2, 3))
Multiplication (2, 0): ['(x:x)'] Multiplication (0, 2): ['(x:(x:x))', '((x:x):x)'] Multiplication (2, 3): ['(x:(x:(x:(x:x))))', '(x:(x:((x:x):x)))', '(x:((x:x):(x:x)))', '(x:((x:(x:x)):x))', '(x:(((x:x):x):x))', '((x:x):(x:(x:x)))', '((x:x):((x:x):x))', '((x:(x:x)):(x:x))', '(((x:x):x):(x:x))', '((x:(x:(x:x))):x)', '((x:((x:x):x)):x)', '(((x:x):(x:x)):x)', '(((x:(x:x)):x):x)', '((((x:x):x):x):x)']
Observe: Because of the way the $\bar{\triangledown}$ operator works, if $A$ is the sum of all polygonal triangle subdivisions it will be the case that $ A = | + A \bar{\triangledown} A $
Observe: Recall the relationship between the number of leaves in a rooted planar binary tree and the number of polygon sizes.
Number of leaves | Number of ways to arrange leaves in a rooted binary tree | Number of Polygon sides |
---|---|---|
3 | 2 | 4 |
4 | 5 | 5 |
5 | 14 | 6 |
6 | 42 | 7 |
7 | 132 | 8 |
Observe: Carrying out the multiplication fo $A$ with $A$ will result in:
$$ A = | + A \bar{\triangledown} A $$Observe: It is simpler to move back to a more usual algebra, in order to map back to polynomials
$$\Phi : \text{Rooted subdivided polygons} \rightarrow \text{Polynomials in } t$$Observe: This can be done as the following:
$$ \Phi (P) = t^n $$where $n$ is the number of triangles in the subdivision $P$
Example: If $P, Q$ are both subdivided polygons (into triangles) then:
$$ \Phi(P \bar{\triangledown} Q) $$Observe that $P$ and $Q$ will have the same number of triangles, however there will anoter $|$ that arises
Observe This can be written as:
$$ \Phi(P \bar{\triangledown} Q) = t \Phi (P) \Phi(Q) $$Observe Possible to apply this homeomorphism to the fundamental equation of the multiset of subdivided polygons:
$$ A = | + A \bar{\triangledown} A $$# TO DO