(* ::Package:: *)

(* ::Subsubsection:: *)
(**)
(*Results (assuming parameter interval pmi=(T0,1) and parameter t = T)*)


(* ::Input:: *)
(*Root[-1 + 12 # - 20 #^2 + 8 #^3& , 2, 0]*)


(* ::Input:: *)
(*T0=Root[8T^3-20T^2+12T-1,2];N[T0,4]*)


(* ::Input:: *)
(*OO=Sqrt[(4-11 T^1+8 T^2)/T];*)


(* ::Input:: *)
(*\[Gamma]\[Gamma]=(5-24 T^1+23 T^2+4 T^3-6 T^4+2 T^5)/(98 ((-1+T)^3) (T^2) )+((1-4 T^1+5 T^2-6 T^3) \[CapitalOmega])/(98 ((-1+T)^3) (T^2) );*)
(**)
(*\[Beta]\[Beta]=(3-31 T^1+135 T^2-328 T^3+484 T^4-440 T^5+240 T^6-72 T^7+8 T^8)/(8 (-1+T)^3 T^2   (-1+5 T^1-6 T^2+T^3))+((-1+9 T^1-31 T^2+52 T^3-44 T^4+16 T^5) \[CapitalOmega])/(8 (-1+T)^3 T^2  (-1+5 T^1-6 T^2+T^3));*)
(**)


(* ::Input:: *)
(*Limit[\[Gamma]\[Gamma]/.\[CapitalOmega]->OO,T->1,Direction->1]*)


(* ::Input:: *)
(*RootReduce[(\[Gamma]\[Gamma]/.\[CapitalOmega]->OO/.T->T0)]-1*)


(* ::Input:: *)
(*Limit[\[Beta]\[Beta]/.\[CapitalOmega]->OO,T->1,Direction->1]*)


(* ::Input:: *)
(*RootReduce[(\[Beta]\[Beta]/.\[CapitalOmega]->OO/.T->T0)]-RootReduce[(1+2Tan[\[Pi]/14]^2)^2]*)


(* ::Input:: *)
(**)


(* ::Subsubsection:: *)
(**)
(*Checks, now symbolically*)


(* ::Input:: *)
(*p1=(4-11 T^1+8 T^2)-T \[CapitalOmega]^2;*)
(*p2=(5-24 T^1+23 T^2+4 T^3-6 T^4+2 T^5)+\[CapitalOmega]((1-4 T^1+5 T^2-6 T^3))-C (98 (-1+T)^3 T^2 );*)
(*p3=(3-31 T^1+135 T^2-328 T^3+484 T^4-440 T^5+240 T^6-72 T^7+8 T^8)+\[CapitalOmega](-1+9 T^1-31 T^2+52 T^3-44 T^4+16 T^5)-B(8 (-1+T)^3 T^2  (-1+5 T^1-6 T^2+T^3));*)


(* ::Input:: *)
(*qv1=Collect[Factor[GroebnerBasis[{p1,p2,p3,T(T-1)(-1+5 T-6 T^2+T^3)u+1},{B,C},{u,\[CapitalOmega],T}]][[1]],B]*)


(* ::Input:: *)
(*qv1b=Collect[Factor[GroebnerBasis[{p1,p2,p3,T(T-1)(-1+5 T-6 T^2+T^3)u+1,\[Beta]^2-B,\[Gamma]^2-C},{\[Beta],\[Gamma]},{u,\[CapitalOmega],T,B,C}]][[1,1]],\[Beta]]*)


(* ::Input:: *)
(*p7[x_]=x^7+(-7s)x^6+a5 x^5+a4 x^4+a3 x^3+a2 x^2+a1 x+a0*)


(* ::Input:: *)
(*Solve[{p7[1]+L==0,p7[-1]+L==0},{a0,a1}]*)


(* ::Input:: *)
(*p7a[x_]=p7[x]/.{a0->-a2-a4-L+7 s,a1->-1-a3-a5}*)


(* ::Text:: *)
(*Coefficient Comparison for obtaining polynomials (all should vanish!)*)


(* ::Input:: *)
(*L1=Drop[CoefficientList[Numerator[Together[((1-x^2)(x-\[Alpha])(x-\[Beta])/(49(x-\[Gamma])^2)D[p7a[x],x]^2)-(L^2-p7a[x]^2)]],x]/.\[Alpha]->(2 s-\[Beta]+2\[Gamma]),-1];*)


(* ::Text:: *)
(**)
(*Tailoring the ideal by known values for ,\[Alpha],\[Beta] *)


(* ::Input:: *)
(*L2={p7a[2s-\[Beta]+2\[Gamma]]+L,p7a[\[Beta]]-L};*)


(* ::Input:: *)
(*LL=Join[L1,L2];*)


(* ::Input:: *)
(*Union[Cases[LL,_Symbol,\[Infinity]]]*)


(* ::Input:: *)
(*q2=Collect[Factor[GroebnerBasis[Join[L1,L2,{(\[Gamma]^2-1)(49\[Gamma]^2-1)(49\[Gamma]^2-9)(49\[Gamma]^2-25)u+1}],{\[Beta],\[Gamma]},{u,a2,a3,a4,a5,s,L}]][[1]],\[Beta]]*)


(* ::Input:: *)
(*qv1b-q2*)


(* ::Text:: *)
(**)
(*The Weierstrass normal form for the p(B,CC)=0 genus 1 elliptic planar curve (check it via Maple algcurves)*)
(**)
(*wf=-1518+b0^2-225 c0+3 c0^3=0*)


(* ::Input:: *)
(*b0/.Solve[-1518+b0^2-225 c0+3 c0^3==0,b0][[-1]]*)


(* ::Text:: *)
(**)
(*a symbolic  check for p(\[Beta]s,\[Gamma]s)=p(B,CC)=0*)


(* ::Input:: *)
(*Together[qv1/.{B->\[Beta]\[Beta],C->\[Gamma]\[Gamma]}/.{\[CapitalOmega]->OO}]*)


(* ::Text:: *)
(**)
(*a symbolic  check for p(\[Beta],\[Gamma])=0*)
(**)
(*Lemma \[Beta]\[Gamma]=lexpr \[And] p(\[Beta],\[Gamma])=p1(B,CC)+p2(B,CC)\[Beta]\[Gamma]*)


(* ::Input:: *)
(*lexpr=1/(28 T^2 (T-1)^3)((1-2 T-7 T^2+18 T^3-12 T^4+4 T^5)+\[CapitalOmega]((-1)(-1+6 T-9 T^2+6 T^3)))*)


(* ::Input:: *)
(*Together[\[Beta]\[Beta] \[Gamma]\[Gamma]-lexpr^2/.\[CapitalOmega]->OO]*)


(* ::Input:: *)
(*q2b=Collect[Expand[q2/.{\[Beta]->Sqrt[B],\[Gamma]->Sqrt[C]}/.{(B)^(3/2)->(B)S2,(B)^(5/2)->(B)^2S2,(B)^(7/2)->(B)^3S2,*)
(*(B)^(9/2)->(B)^4S2,*)
(*(B)^(11/2)->(B)^5S2,*)
(*(C)^(3/2)->(C)S1,*)
(*(C)^(5/2)->(C)^2S1,*)
(*(C)^(7/2)->(C)^3S1,*)
(*(C)^(9/2)->(C)^4S1,*)
(*(C)^(11/2)->(C)^5S1*)
(*}/.{Sqrt[B]->S2,Sqrt[C]->S1}],{S2,S1}]*)


(* ::Input:: *)
(*Together[RootReduce[q2b/.{S1 S2->lexpr}/.{B->\[Beta]\[Beta],C->\[Gamma]\[Gamma]}/.\[CapitalOmega]->OO]]*)
