diff --git a/.ipynb_checkpoints/examples-checkpoint.ipynb b/.ipynb_checkpoints/examples-checkpoint.ipynb index 4e27353..7453a7b 100644 --- a/.ipynb_checkpoints/examples-checkpoint.ipynb +++ b/.ipynb_checkpoints/examples-checkpoint.ipynb @@ -2556,6 +2556,9 @@ ], "source": [ "newproof()\n", + "#this is equivalent to\n", + "#prove(makesubs('(x-1)^4','[1,oo]'))\n", + "#prove(makesubs('(x-1)^4','[-oo,1]'))\n", "powerprove('(x-1)^4')" ] }, @@ -3406,6 +3409,15 @@ "source": [ "newproof()\n", "formula=Sm('-(3a + 2b + c)(2a^3 + 3b^2 + 6c + 1) + (4a + 4b + 4c)(a^4 + b^3 + c^2 + 3)')\n", + "#this is equivalent to\n", + "#prove(makesubs(formula,'[1,oo],[1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[-1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[-1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[-1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[-1,oo],[-1,oo]'))\n", "powerprove(formula)" ] }, diff --git a/.ipynb_checkpoints/statistics-checkpoint.ipynb b/.ipynb_checkpoints/statistics-checkpoint.ipynb index ad6b447..d65b5bc 100644 --- a/.ipynb_checkpoints/statistics-checkpoint.ipynb +++ b/.ipynb_checkpoints/statistics-checkpoint.ipynb @@ -17,7 +17,6 @@ "metadata": {}, "outputs": [], "source": [ - "from importlib import reload\n", "from sympy import *\n", "import shiroindev\n", "from shiroindev import *\n", @@ -58,25 +57,20 @@ " if not m:\n", " break\n", " s2+=s[p:p+m.end()]\n", - " #print('a',s[p:m.end()],p)\n", " p+=m.end()\n", " if m.group() in arg:\n", " for i in range(arg[m.group()]):\n", " sp=re.search('^ *',s[p:])\n", " s2+=sp.group()\n", - " #print('b',sp.group(),p)\n", " p+=sp.end()\n", " if s[p]=='{':\n", " cb=re.search(r'^\\{.*?\\}',s[p:])\n", " ab=addbraces(cb.group())\n", " s2+=ab\n", - " #print('c',ab,p)\n", " p+=cb.end()\n", " else:\n", " s2+='{'+s[p]+'}'\n", - " #print('d','{'+s[p]+'}',p)\n", " p+=1\n", - " #print('e',p)\n", " s2+=s[p:]\n", " return s2\n", "print(addbraces(r'\\frac{ \\sqrt 3}2'))\n", @@ -147,7 +141,6 @@ "def parser(formula,intervals='[]',subs='[]',func=dif):\n", " newproof()\n", " shiro.display=lambda x:None\n", - " #display=lambda x:None\n", " if intervals=='':\n", " intervals='[]'\n", " if subs=='':\n", @@ -175,34 +168,7 @@ "name": "stderr", "output_type": "stream", "text": [ - " 74%|███████▍ | 26/35 [00:21<00:07, 1.21it/s]\n" - ] - }, - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mineqs2\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mineq\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mtqdm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mineqs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mineqs2\u001b[0m\u001b[0;34m+=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mparser\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mineq\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m\u001b[0m in \u001b[0;36mparser\u001b[0;34m(formula, intervals, subs, func)\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 17\u001b[0m \u001b[0mformula\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0ms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 18\u001b[0;31m \u001b[0mformula\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msimplify\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mformula\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 19\u001b[0m \u001b[0mnum\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mden\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfractioncancel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mformula\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mnum\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/simplify/simplify.py\u001b[0m in \u001b[0;36msimplify\u001b[0;34m(expr, ratio, measure, rational, inverse)\u001b[0m\n\u001b[1;32m 560\u001b[0m \u001b[0m_e\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcancel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 561\u001b[0m \u001b[0mexpr1\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mshorter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_e\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0m_mexpand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_e\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcancel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# issue 6829\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 562\u001b[0;31m \u001b[0mexpr2\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mshorter\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtogether\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtogether\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdeep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 563\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 564\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mratio\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mS\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mInfinity\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36mtogether\u001b[0;34m(expr, deep, fraction)\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 84\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 85\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msympify\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m_together\u001b[0;34m(expr)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 79\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0miterable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mex\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mex\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 79\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0miterable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mex\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mex\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m_together\u001b[0;34m(expr)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Add\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 68\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mgcd_terms\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_together\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAdd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_args\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfraction\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfraction\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 69\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Pow\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0mbase\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m_together\u001b[0;34m(expr)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 79\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0miterable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mex\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mex\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mexp\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 78\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 79\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marg\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0marg\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0margs\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 80\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0miterable\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 81\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mex\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mex\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mexpr\u001b[0m \u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/polys/rationaltools.py\u001b[0m in \u001b[0;36m_together\u001b[0;34m(expr)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Add\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 68\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mgcd_terms\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmap\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_together\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAdd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmake_args\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfraction\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfraction\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 69\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_Pow\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0mbase\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_together\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mbase\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36mgcd_terms\u001b[0;34m(terms, isprimitive, clear, fraction)\u001b[0m\n\u001b[1;32m 1061\u001b[0m \u001b[0mterms\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msympify\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mterms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1062\u001b[0m \u001b[0mterms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mreps\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mmask\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mterms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1063\u001b[0;31m \u001b[0mcont\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnumer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdenom\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_gcd_terms\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mterms\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0misprimitive\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfraction\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1064\u001b[0m \u001b[0mnumer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnumer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mxreplace\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mreps\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1065\u001b[0m \u001b[0mcoeff\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfactors\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcont\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_coeff_Mul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36m_gcd_terms\u001b[0;34m(terms, isprimitive, fraction)\u001b[0m\n\u001b[1;32m 954\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 955\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mterm\u001b[0m \u001b[0;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mterms\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 956\u001b[0;31m \u001b[0mterms\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mterm\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mquo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcont\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 957\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 958\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfraction\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36mquo\u001b[0;34m(self, other)\u001b[0m\n\u001b[1;32m 872\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 873\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mquo\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mother\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Term\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 874\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 875\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 876\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mpow\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mother\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Term\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36mmul\u001b[0;34m(self, other)\u001b[0m\n\u001b[1;32m 864\u001b[0m \u001b[0mdenom\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdenom\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmul\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdenom\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 865\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 866\u001b[0;31m \u001b[0mnumer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdenom\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnumer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mnormal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdenom\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 867\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 868\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mTerm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcoeff\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnumer\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdenom\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36mnormal\u001b[0;34m(self, other)\u001b[0m\n\u001b[1;32m 556\u001b[0m \u001b[0;32mdel\u001b[0m \u001b[0mother_factors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mfactor\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 557\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 558\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mFactors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself_factors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mFactors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother_factors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 559\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 560\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdiv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mother\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Factors\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/exprtools.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, factors)\u001b[0m\n\u001b[1;32m 367\u001b[0m \u001b[0mhandle\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 368\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mfactors\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 369\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mI\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mk\u001b[0m \u001b[0;32min\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 370\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mk\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 371\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;32m/home/grzegorz/Pobrane/SageMath/local/lib/python3.7/site-packages/sympy/core/basic.py\u001b[0m in \u001b[0;36m__eq__\u001b[0;34m(self, other)\u001b[0m\n\u001b[1;32m 333\u001b[0m \u001b[0;31m# (https://github.com/sympy/sympy/issues/4269), we only compare\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[0;31m# types in Python 2 directly if they actually have __ne__.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 335\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mPY3\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__ne__\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mtype\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__ne__\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 336\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtself\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0mtother\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + "100%|██████████| 35/35 [00:46<00:00, 1.32s/it]\n" ] } ], @@ -222,9 +188,675 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{2} - ab - ac + b^{2} - bc + c^{2}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**2 - a*b - a*c + b**2 - b*c + c**2, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "1\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{2} - ab - ac - ad + b^{2} + c^{2} + d^{2}, a, b, c, d, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**2 - a*b - a*c - a*d + b**2 + c**2 + d**2, a, b, c, d, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{4}b^{2} + a^{3}b^{2} - a^{3}b - 2 a^{2}b + a^{2} + ab^{2} - ab + b^{2}, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**4*b**2 + a**3*b**2 - a**3*b - 2*a**2*b + a**2 + a*b**2 - a*b + b**2, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{3}b + a^{3} - 4 a^{2}b^{2} - a^{2}b + a^{2} + 2 ab^{3} - ab^{2} - 2 ab + b^{3} + b^{2}, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**3*b + a**3 - 4*a**2*b**2 - a**2*b + a**2 + 2*a*b**3 - a*b**2 - 2*a*b + b**3 + b**2, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3} - a^{2}b - ab^{2} + b^{3}, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3 - a**2*b - a*b**2 + b**3, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{3} - a^{2}b - a^{2}c - ab^{2} - ac^{2} + 2 b^{3} - b^{2}c - bc^{2} + 2 c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**3 - a**2*b - a**2*c - a*b**2 - a*c**2 + 2*b**3 - b**2*c - b*c**2 + 2*c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "6\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{3} - 3 a^{2}b + b^{3}, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**3 - 3*a**2*b + b**3, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "7\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3} - a^{2}b - ac^{2} + b^{3} - b^{2}c + c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3 - a**2*b - a*c**2 + b**3 - b**2*c + c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3}c + a^{3}d + a^{2}b^{2} - a^{2}bd - 2 a^{2}c^{2} - a^{2}cd + a^{2}d^{2} + ab^{3} - ab^{2}c - ab^{2}d - abc^{2} + ac^{3} - acd^{2} + b^{3}d + b^{2}c^{2} - 2 b^{2}d^{2} + bc^{3} - bc^{2}d - bcd^{2} + bd^{3} + c^{2}d^{2} + cd^{3}, a, b, c, d, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3*c + a**3*d + a**2*b**2 - a**2*b*d - 2*a**2*c**2 - a**2*c*d + a**2*d**2 + a*b**3 - a*b**2*c - a*b**2*d - a*b*c**2 + a*c**3 - a*c*d**2 + b**3*d + b**2*c**2 - 2*b**2*d**2 + b*c**3 - b*c**2*d - b*c*d**2 + b*d**3 + c**2*d**2 + c*d**3, a, b, c, d, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "9\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{5}b^{2} + 2 a^{5}bc + 2 a^{5}c^{2} + a^{4}b^{3} - a^{4}b^{2}c - a^{4}bc^{2} + a^{4}c^{3} + a^{3}b^{4} - 2 a^{3}b^{3}c - 4 a^{3}b^{2}c^{2} - 2 a^{3}bc^{3} + a^{3}c^{4} + 2 a^{2}b^{5} - a^{2}b^{4}c - 4 a^{2}b^{3}c^{2} - 4 a^{2}b^{2}c^{3} - a^{2}bc^{4} + 2 a^{2}c^{5} + 2 ab^{5}c - ab^{4}c^{2} - 2 ab^{3}c^{3} - ab^{2}c^{4} + 2 abc^{5} + 2 b^{5}c^{2} + b^{4}c^{3} + b^{3}c^{4} + 2 b^{2}c^{5}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**5*b**2 + 2*a**5*b*c + 2*a**5*c**2 + a**4*b**3 - a**4*b**2*c - a**4*b*c**2 + a**4*c**3 + a**3*b**4 - 2*a**3*b**3*c - 4*a**3*b**2*c**2 - 2*a**3*b*c**3 + a**3*c**4 + 2*a**2*b**5 - a**2*b**4*c - 4*a**2*b**3*c**2 - 4*a**2*b**2*c**3 - a**2*b*c**4 + 2*a**2*c**5 + 2*a*b**5*c - a*b**4*c**2 - 2*a*b**3*c**3 - a*b**2*c**4 + 2*a*b*c**5 + 2*b**5*c**2 + b**4*c**3 + b**3*c**4 + 2*b**2*c**5, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "10\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( ad + af - 2 \\sqrt{a}\\sqrt{b}\\sqrt{c}\\sqrt{d} - 2 \\sqrt{a}\\sqrt{b}\\sqrt{e}\\sqrt{f} + bc + be + cf - 2 \\sqrt{c}\\sqrt{d}\\sqrt{e}\\sqrt{f} + de, \\sqrt{a}, \\sqrt{b}, \\sqrt{c}, \\sqrt{d}, \\sqrt{e}, \\sqrt{f}, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly((sqrt(a))**2*(sqrt(d))**2 + (sqrt(a))**2*(sqrt(f))**2 - 2*(sqrt(a))*(sqrt(b))*(sqrt(c))*(sqrt(d)) - 2*(sqrt(a))*(sqrt(b))*(sqrt(e))*(sqrt(f)) + (sqrt(b))**2*(sqrt(c))**2 + (sqrt(b))**2*(sqrt(e))**2 + (sqrt(c))**2*(sqrt(f))**2 - 2*(sqrt(c))*(sqrt(d))*(sqrt(e))*(sqrt(f)) + (sqrt(d))**2*(sqrt(e))**2, sqrt(a), sqrt(b), sqrt(c), sqrt(d), sqrt(e), sqrt(f), domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "11\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 3 a^{4}b + 3 a^{4}c - 2 a^{3}b^{2} + 2 a^{3}c^{2} + 2 a^{2}b^{3} - 6 a^{2}b^{2}c - 6 a^{2}bc^{2} - 2 a^{2}c^{3} + 3 ab^{4} - 6 ab^{2}c^{2} + 3 ac^{4} + 3 b^{4}c - 2 b^{3}c^{2} + 2 b^{2}c^{3} + 3 bc^{4}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(3*a**4*b + 3*a**4*c - 2*a**3*b**2 + 2*a**3*c**2 + 2*a**2*b**3 - 6*a**2*b**2*c - 6*a**2*b*c**2 - 2*a**2*c**3 + 3*a*b**4 - 6*a*b**2*c**2 + 3*a*c**4 + 3*b**4*c - 2*b**3*c**2 + 2*b**2*c**3 + 3*b*c**4, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "12\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 4 x^{8}y^{4} + 4 x^{7}y^{4} - 3 x^{5}y^{5} - 3 x^{5}y^{4} + 4 x^{4}y^{8} + 4 x^{4}y^{7} - 3 x^{4}y^{5} - 6 x^{4}y^{4} - 3 x^{4}y^{3} - 3 x^{3}y^{4} - 3 x^{3}y^{3} + 4 xy + 4, x, y, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(4*x**8*y**4 + 4*x**7*y**4 - 3*x**5*y**5 - 3*x**5*y**4 + 4*x**4*y**8 + 4*x**4*y**7 - 3*x**4*y**5 - 6*x**4*y**4 - 3*x**4*y**3 - 3*x**3*y**4 - 3*x**3*y**3 + 4*x*y + 4, x, y, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "13\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3}c^{2} + a^{2}b^{3} - a^{2}b^{2}c - a^{2}bc^{2} - ab^{2}c^{2} + b^{2}c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3*c**2 + a**2*b**3 - a**2*b**2*c - a**2*b*c**2 - a*b**2*c**2 + b**2*c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "14\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{4}c + a^{3}c^{2} + a^{2}b^{3} + ab^{4} + b^{2}c^{3} + bc^{4}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**4*c + a**3*c**2 + a**2*b**3 + a*b**4 + b**2*c**3 + b*c**4, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "15\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{4}c - 4 a^{3}bc + a^{3}c^{2} + a^{2}b^{3} + 6 a^{2}b^{2}c - 2 a^{2}bc^{2} + ab^{4} - 4 ab^{3}c - 2 ab^{2}c^{2} + b^{2}c^{3} + bc^{4}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**4*c - 4*a**3*b*c + a**3*c**2 + a**2*b**3 + 6*a**2*b**2*c - 2*a**2*b*c**2 + a*b**4 - 4*a*b**3*c - 2*a*b**2*c**2 + b**2*c**3 + b*c**4, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "16\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{6}b^{3} + a^{6}c^{3} - 2 a^{5}b^{2}c^{2} + a^{3}b^{6} + a^{3}c^{6} - 2 a^{2}b^{5}c^{2} - 2 a^{2}b^{2}c^{5} + b^{6}c^{3} + b^{3}c^{6}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**6*b**3 + a**6*c**3 - 2*a**5*b**2*c**2 + a**3*b**6 + a**3*c**6 - 2*a**2*b**5*c**2 - 2*a**2*b**2*c**5 + b**6*c**3 + b**3*c**6, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "17\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{8}b^{8} + 2 a^{7}b^{6} + 2 a^{6}b^{7} - 3 a^{6}b^{5} - 3 a^{5}b^{6} + 2 a^{5}b^{5} - 3 a^{5}b^{3} + 2 a^{5}b^{2} - 6 a^{4}b^{4} + 2 a^{4}b^{3} + 2 a^{4} - 3 a^{3}b^{5} + 2 a^{3}b^{4} - 3 a^{3}b^{2} + 2 a^{3}b + 2 a^{2}b^{5} - 3 a^{2}b^{3} + 2 ab^{3} + 2 b^{4}, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**8*b**8 + 2*a**7*b**6 + 2*a**6*b**7 - 3*a**6*b**5 - 3*a**5*b**6 + 2*a**5*b**5 - 3*a**5*b**3 + 2*a**5*b**2 - 6*a**4*b**4 + 2*a**4*b**3 + 2*a**4 - 3*a**3*b**5 + 2*a**3*b**4 - 3*a**3*b**2 + 2*a**3*b + 2*a**2*b**5 - 3*a**2*b**3 + 2*a*b**3 + 2*b**4, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "18\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{8} - a^{6}bc - 2 a^{5}b^{3} + a^{5}b^{2}c + a^{5}bc^{2} - 2 a^{5}c^{3} + 3 a^{4}b^{4} - a^{4}b^{3}c + 2 a^{4}b^{2}c^{2} - a^{4}bc^{3} + 3 a^{4}c^{4} - 2 a^{3}b^{5} - a^{3}b^{4}c - a^{3}b^{3}c^{2} - a^{3}b^{2}c^{3} - a^{3}bc^{4} - 2 a^{3}c^{5} + a^{2}b^{5}c + 2 a^{2}b^{4}c^{2} - a^{2}b^{3}c^{3} + 2 a^{2}b^{2}c^{4} + a^{2}bc^{5} - ab^{6}c + ab^{5}c^{2} - ab^{4}c^{3} - ab^{3}c^{4} + ab^{2}c^{5} - abc^{6} + b^{8} - 2 b^{5}c^{3} + 3 b^{4}c^{4} - 2 b^{3}c^{5} + c^{8}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**8 - a**6*b*c - 2*a**5*b**3 + a**5*b**2*c + a**5*b*c**2 - 2*a**5*c**3 + 3*a**4*b**4 - a**4*b**3*c + 2*a**4*b**2*c**2 - a**4*b*c**3 + 3*a**4*c**4 - 2*a**3*b**5 - a**3*b**4*c - a**3*b**3*c**2 - a**3*b**2*c**3 - a**3*b*c**4 - 2*a**3*c**5 + a**2*b**5*c + 2*a**2*b**4*c**2 - a**2*b**3*c**3 + 2*a**2*b**2*c**4 + a**2*b*c**5 - a*b**6*c + a*b**5*c**2 - a*b**4*c**3 - a*b**3*c**4 + a*b**2*c**5 - a*b*c**6 + b**8 - 2*b**5*c**3 + 3*b**4*c**4 - 2*b**3*c**5 + c**8, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "19\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( y^{18}z^{9} + 2 y^{16}z^{14} - y^{15}z^{9} + 2 y^{14}z^{16} - y^{14}z^{13} - y^{13}z^{14} - y^{13}z^{11} - y^{12}z^{12} + y^{12}z^{9} - y^{11}z^{13} - y^{11}z^{7} + 2 y^{11}z^{4} - y^{10}z^{5} + y^{9}z^{18} - y^{9}z^{15} + y^{9}z^{12} - y^{9}z^{6} - y^{8}z^{4} - y^{7}z^{11} - y^{7}z^{5} + 2 y^{7}z^{2} - y^{6}z^{9} + y^{6}z^{6} - y^{5}z^{10} - y^{5}z^{7} + 2 y^{4}z^{11} - y^{4}z^{8} - y^{3}z^{3} + 2 y^{2}z^{7} + 1, y, z, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(y**18*z**9 + 2*y**16*z**14 - y**15*z**9 + 2*y**14*z**16 - y**14*z**13 - y**13*z**14 - y**13*z**11 - y**12*z**12 + y**12*z**9 - y**11*z**13 - y**11*z**7 + 2*y**11*z**4 - y**10*z**5 + y**9*z**18 - y**9*z**15 + y**9*z**12 - y**9*z**6 - y**8*z**4 - y**7*z**11 - y**7*z**5 + 2*y**7*z**2 - y**6*z**9 + y**6*z**6 - y**5*z**10 - y**5*z**7 + 2*y**4*z**11 - y**4*z**8 - y**3*z**3 + 2*y**2*z**7 + 1, y, z, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "20\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3} - a^{2}b - a^{2}c - ab^{2} + 3 abc - ac^{2} + b^{3} - b^{2}c - bc^{2} + c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3 - a**2*b - a**2*c - a*b**2 + 3*a*b*c - a*c**2 + b**3 - b**2*c - b*c**2 + c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "21\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 y^{4}z^{2} - y^{3}z^{3} - 5 y^{3}z + 2 y^{2}z^{4} - 9 y^{2}z^{2} + 5 y^{2} - 5 yz^{3} + 23 yz + 5 z^{2} - 9, y, z, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*y**4*z**2 - y**3*z**3 - 5*y**3*z + 2*y**2*z**4 - 9*y**2*z**2 + 5*y**2 - 5*y*z**3 + 23*y*z + 5*z**2 - 9, y, z, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "22\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{\\frac{5}{2}}b\\frac{1}{\\sqrt{a b + a + b + 1}} + 2 a^{\\frac{5}{2}}\\frac{1}{\\sqrt{a b + a + b + 1}} + 2 a^{2}b^{\\frac{7}{2}}\\frac{1}{\\sqrt{b + 1}} + 2 a^{2}b^{\\frac{5}{2}}\\frac{1}{\\sqrt{b + 1}} + 2 a^{2}b^{2}\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - a^{2}b^{2}\\sqrt{3} + 2 a^{2}b\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - a^{2}b\\sqrt{3} + 2 a^{\\frac{3}{2}}b\\frac{1}{\\sqrt{a b + a + b + 1}} + 4 ab^{\\frac{7}{2}}\\frac{1}{\\sqrt{b + 1}} + 4 ab^{\\frac{5}{2}}\\frac{1}{\\sqrt{b + 1}} + 4 ab^{2}\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - 2 ab^{2}\\sqrt{3} + 2 ab^{\\frac{3}{2}}\\frac{1}{\\sqrt{b + 1}} + 6 ab\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - 2 ab\\sqrt{3} + 2 a\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - a\\sqrt{3} + 2 b^{\\frac{7}{2}}\\frac{1}{\\sqrt{b + 1}} + 2 b^{\\frac{5}{2}}\\frac{1}{\\sqrt{b + 1}} + 2 b^{2}\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - b^{2}\\sqrt{3} + 4 b\\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}} - b\\sqrt{3} + 2 \\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}}, \\sqrt{a}, \\sqrt{b}, \\frac{1}{a b \\sqrt{a b + a + b + 1} + a \\sqrt{a b + a + b + 1} + b \\sqrt{a b + a + b + 1} + \\sqrt{a b + a + b + 1}}, \\frac{1}{\\sqrt{a b + a + b + 1}}, \\frac{1}{\\sqrt{b + 1}}, \\sqrt{3}, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*(sqrt(a))**5*(sqrt(b))**2*(1/sqrt(a*b + a + b + 1)) + 2*(sqrt(a))**5*(1/sqrt(a*b + a + b + 1)) + 2*(sqrt(a))**4*(sqrt(b))**7*(1/sqrt(b + 1)) + 2*(sqrt(a))**4*(sqrt(b))**5*(1/sqrt(b + 1)) + 2*(sqrt(a))**4*(sqrt(b))**4*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - (sqrt(a))**4*(sqrt(b))**4*(sqrt(3)) + 2*(sqrt(a))**4*(sqrt(b))**2*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - (sqrt(a))**4*(sqrt(b))**2*(sqrt(3)) + 2*(sqrt(a))**3*(sqrt(b))**2*(1/sqrt(a*b + a + b + 1)) + 4*(sqrt(a))**2*(sqrt(b))**7*(1/sqrt(b + 1)) + 4*(sqrt(a))**2*(sqrt(b))**5*(1/sqrt(b + 1)) + 4*(sqrt(a))**2*(sqrt(b))**4*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - 2*(sqrt(a))**2*(sqrt(b))**4*(sqrt(3)) + 2*(sqrt(a))**2*(sqrt(b))**3*(1/sqrt(b + 1)) + 6*(sqrt(a))**2*(sqrt(b))**2*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - 2*(sqrt(a))**2*(sqrt(b))**2*(sqrt(3)) + 2*(sqrt(a))**2*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - (sqrt(a))**2*(sqrt(3)) + 2*(sqrt(b))**7*(1/sqrt(b + 1)) + 2*(sqrt(b))**5*(1/sqrt(b + 1)) + 2*(sqrt(b))**4*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - (sqrt(b))**4*(sqrt(3)) + 4*(sqrt(b))**2*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))) - (sqrt(b))**2*(sqrt(3)) + 2*(1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1))), sqrt(a), sqrt(b), 1/(a*b*sqrt(a*b + a + b + 1) + a*sqrt(a*b + a + b + 1) + b*sqrt(a*b + a + b + 1) + sqrt(a*b + a + b + 1)), 1/sqrt(a*b + a + b + 1), 1/sqrt(b + 1), sqrt(3), domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "23\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{4} - 4 abcd + b^{4} + c^{4} + d^{4}, a, b, c, d, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**4 - 4*a*b*c*d + b**4 + c**4 + d**4, a, b, c, d, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "24\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{3}b^{2} + a^{3}c^{2} + a^{2}b^{3} - 2 a^{2}b^{2}c - 2 a^{2}bc^{2} + a^{2}c^{3} - 2 ab^{2}c^{2} + b^{3}c^{2} + b^{2}c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**3*b**2 + a**3*c**2 + a**2*b**3 - 2*a**2*b**2*c - 2*a**2*b*c**2 + a**2*c**3 - 2*a*b**2*c**2 + b**3*c**2 + b**2*c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "25\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( def + de + df - 2 \\sqrt{d}\\sqrt{e} - 2 \\sqrt{d}\\sqrt{f} + ef - 2 \\sqrt{e}\\sqrt{f} + f + 2, \\sqrt{d}, \\sqrt{e}, \\sqrt{f}, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly((sqrt(d))**2*(sqrt(e))**2*(sqrt(f))**2 + (sqrt(d))**2*(sqrt(e))**2 + (sqrt(d))**2*(sqrt(f))**2 - 2*(sqrt(d))*(sqrt(e)) - 2*(sqrt(d))*(sqrt(f)) + (sqrt(e))**2*(sqrt(f))**2 - 2*(sqrt(e))*(sqrt(f)) + (sqrt(f))**2 + 2, sqrt(d), sqrt(e), sqrt(f), domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "26\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( de^{2}f^{2} + de^{2}f + 2 def^{2} - 6 def + de + df^{2} + df + e^{2}f^{2} + e^{2}f + 2 ef^{2} + 3 ef + e + f^{2} + 2 f + 1, d, e, f, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(d*e**2*f**2 + d*e**2*f + 2*d*e*f**2 - 6*d*e*f + d*e + d*f**2 + d*f + e**2*f**2 + e**2*f + 2*e*f**2 + 3*e*f + e + f**2 + 2*f + 1, d, e, f, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "27\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( s^{2}def + s^{2}, s, d, e, f, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(s**2*d*e*f + s**2, s, d, e, f, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "28\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( -2 \\sqrt{3}x_{1}x_{2} - 2 \\sqrt{3}x_{2}x_{3} - 2 \\sqrt{3}x_{3}x_{4} - 2 \\sqrt{3}x_{4}x_{5} + 3 x_{1}^{2} + 3 x_{2}^{2} + 3 x_{3}^{2} + 3 x_{4}^{2} + 3 x_{5}^{2}, \\sqrt{3}, x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(-2*(sqrt(3))*x_1*x_2 - 2*(sqrt(3))*x_2*x_3 - 2*(sqrt(3))*x_3*x_4 - 2*(sqrt(3))*x_4*x_5 + 3*x_1**2 + 3*x_2**2 + 3*x_3**2 + 3*x_4**2 + 3*x_5**2, sqrt(3), x_1, x_2, x_3, x_4, x_5, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "29\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 7 a^{2}b^{3} - 6 a^{2}b^{2} - 6 a^{2}b + 7 a^{2} + 14 ab^{3} - 12 ab^{2} + 15 ab - 13 a + 7 b^{3} - 6 b^{2} - 6 b + 7, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(7*a**2*b**3 - 6*a**2*b**2 - 6*a**2*b + 7*a**2 + 14*a*b**3 - 12*a*b**2 + 15*a*b - 13*a + 7*b**3 - 6*b**2 - 6*b + 7, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "30\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{2}b^{2} + a^{2}b + 2 ab^{2} + ab + a + b^{2} + b, a, b, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**2*b**2 + a**2*b + 2*a*b**2 + a*b + a + b**2 + b, a, b, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "31\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( -2 \\frac{1}{\\sqrt{b}}\\sqrt{\\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}} - 2 \\frac{1}{\\sqrt{b}}\\sqrt{\\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \\frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}} - 2 \\sqrt{\\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}}\\sqrt{\\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \\frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}} + 3, \\frac{1}{\\sqrt{b}}, \\sqrt{\\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \\frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}}, \\sqrt{\\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \\frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}}, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(-2*(1/sqrt(b))*(sqrt(a**2*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a**2*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1))) - 2*(1/sqrt(b))*(sqrt(a*b/(a**2*b + a**2 + a*b + 2*a + 1) + b/(a**2*b + a**2 + a*b + 2*a + 1))) - 2*(sqrt(a**2*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a**2*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1)))*(sqrt(a*b/(a**2*b + a**2 + a*b + 2*a + 1) + b/(a**2*b + a**2 + a*b + 2*a + 1))) + 3, 1/sqrt(b), sqrt(a**2*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a**2*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b**2/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1) + a*b/(a**2*b + a**2 + a*b**2 + 3*a*b + 2*a + b**2 + 2*b + 1)), sqrt(a*b/(a**2*b + a**2 + a*b + 2*a + 1) + b/(a**2*b + a**2 + a*b + 2*a + 1)), domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "32\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( a^{5}b^{2} + a^{5}c^{2} + a^{4}b^{3} - a^{4}b^{2}c - a^{4}bc^{2} - a^{4}c^{3} - a^{3}b^{4} + a^{3}c^{4} + a^{2}b^{5} - a^{2}b^{4}c - a^{2}bc^{4} + a^{2}c^{5} - ab^{4}c^{2} - ab^{2}c^{4} + b^{5}c^{2} + b^{4}c^{3} - b^{3}c^{4} + b^{2}c^{5}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(a**5*b**2 + a**5*c**2 + a**4*b**3 - a**4*b**2*c - a**4*b*c**2 - a**4*c**3 - a**3*b**4 + a**3*c**4 + a**2*b**5 - a**2*b**4*c - a**2*b*c**4 + a**2*c**5 - a*b**4*c**2 - a*b**2*c**4 + b**5*c**2 + b**4*c**3 - b**3*c**4 + b**2*c**5, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "33\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{2}d^{3} - a^{2}d^{2} - a^{2}d + 2 a^{2} + 4 ad^{3} - 2 ad^{2} - 3 a + 2 d^{3} - d^{2} - d + 2, a, d, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**2*d**3 - a**2*d**2 - a**2*d + 2*a**2 + 4*a*d**3 - 2*a*d**2 - 3*a + 2*d**3 - d**2 - d + 2, a, d, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "34\n" + ] + }, + { + "data": { + "text/latex": [ + "$\\displaystyle \\operatorname{Poly}{\\left( 2 a^{3} - 3 a^{2}b + a^{2}c + ab^{2} - 3 ac^{2} + 2 b^{3} - 3 b^{2}c + bc^{2} + 2 c^{3}, a, b, c, domain=\\mathbb{Z} \\right)}$" + ], + "text/plain": [ + "Poly(2*a**3 - 3*a**2*b + a**2*c + a*b**2 - 3*a*c**2 + 2*b**3 - 3*b**2*c + b*c**2 + 2*c**3, a, b, c, domain='ZZ')" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "for i,ineq in zip(range(len(ineqs2)),ineqs2):\n", " print(i)\n", @@ -242,7 +874,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -251,9 +883,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,2,0,2,2,0,2,0,2,0,\n", + "20.714609994000057\n" + ] + }, + { + "data": { + "text/plain": [ + "Counter({0: 21, 2: 14})" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "from collections import Counter\n", "from timeit import default_timer as timer\n", @@ -278,9 +929,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,2,2,0,2,0,2,0,\n", + "21.832711064998875\n" + ] + }, + { + "data": { + "text/plain": [ + "Counter({0: 24, 2: 11})" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def cut(a):\n", " if a<=0 or a>=100 or (a is None):\n", @@ -308,9 +978,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,2,2,0,2,0,2,0,\n", + "21.697120987002563\n" + ] + }, + { + "data": { + "text/plain": [ + "Counter({0: 23, 2: 12})" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def cut(a):\n", " if a<=0 or a>=1000 or (a is None):\n", @@ -341,9 +1030,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,0,2,0,2,0,2,0,\n", + "23.187820409999404\n" + ] + }, + { + "data": { + "text/plain": [ + "Counter({0: 24, 2: 11})" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "def betw(a):\n", " return a>0.001 and a<1000 and a!=None\n", @@ -381,9 +1089,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 17, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "image/png": "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\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import matplotlib.pyplot as plt\n", "plt.bar(['1','2','3','4'],tm)\n", @@ -394,7 +1113,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -404,9 +1123,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "image/png": "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\n", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "plt.bar(['1','2','3','4'],[sum(u[i]==0)/len(ineqs2)*100 for i in range(1,5)])\n", "plt.ylabel('inequalities proven [%]')\n", @@ -423,9 +1153,340 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
2FalseTrue
1
False113
True021
\n", + "
" + ], + "text/plain": [ + "2 False True \n", + "1 \n", + "False 11 3\n", + "True 0 21" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
3FalseTrue
1
False122
True021
\n", + "
" + ], + "text/plain": [ + "3 False True \n", + "1 \n", + "False 12 2\n", + "True 0 21" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
4FalseTrue
1
False113
True021
\n", + "
" + ], + "text/plain": [ + "4 False True \n", + "1 \n", + "False 11 3\n", + "True 0 21" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
3FalseTrue
2
False110
True123
\n", + "
" + ], + "text/plain": [ + "3 False True \n", + "2 \n", + "False 11 0\n", + "True 1 23" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
4FalseTrue
2
False101
True123
\n", + "
" + ], + "text/plain": [ + "4 False True \n", + "2 \n", + "False 10 1\n", + "True 1 23" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
4FalseTrue
3
False111
True023
\n", + "
" + ], + "text/plain": [ + "4 False True \n", + "3 \n", + "False 11 1\n", + "True 0 23" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "for i in range(4):\n", " for j in range(i+1,4):\n", @@ -434,9 +1495,28 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pvalue 0.25\n", + "statistic 0.0\n", + "pvalue 0.5\n", + "statistic 0.0\n", + "pvalue 0.25\n", + "statistic 0.0\n", + "pvalue 1.0\n", + "statistic 0.0\n", + "pvalue 1.0\n", + "statistic 1.0\n", + "pvalue 1.0\n", + "statistic 0.0\n" + ] + } + ], "source": [ "from statsmodels.stats.contingency_tables import mcnemar\n", "for i in range(4):\n", diff --git a/examples.html b/examples.html new file mode 100644 index 0000000..d795937 --- /dev/null +++ b/examples.html @@ -0,0 +1,17915 @@ + + + + +examples + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+

In this notebook there are presented examples of usage of shiroin, a python library for proving inequalities of multivariate polynomials.

+

At the beginning we need to load the packages.

+ +
+
+
+
+
+
In [1]:
+
+
+
from sympy import *
+from shiroindev import *
+from IPython.display import Latex
+shiro.seed=1
+shiro.display=lambda x:display(Latex(x))
+
+ +
+
+
+ +
+
+
+
+

shiro.seed=1 sets a seed for proving functions. If you don't write it, you can get a slightly different proof each time you run a function. This line is here only for the sake of reproducibility.

+

The next line provides a nicer display of proofs, i.e. formulas will be shown instead of LaTeX code of these formulas. Note that this works on Jupyter, but not on the git page.

+

Now let's make some proofs. We will use problems from https://www.imomath.com/index.php?options=593&lmm=0.

+ +
+
+
+
+
+
+

Problem 1

Prove the inequality $a^2+b^2+c^2\ge ab+bc+ca$, if $a,b,c$ are real numbers.

+ +
+
+
+
+
+
+

Function prove tries to prove that given formula is nonnegative, assuming all variables are nonnegative. In this case the nonnegativity assumption is not a problem, since all powers on the left side are even, so if $|a|^2+|b|^2+|c|^2 \ge |ab|+|ac|+|bc|,$ then $a^2+b^2+c^2= |a|^2+|b|^2+|c|^2 \ge |ab|+|ac|+|bc| \ge ab+ac+bc$.

+ +
+
+
+
+
+
In [2]:
+
+
+
prove('(a^2+b^2+c^2-a*b-a*c-b*c)')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $a^{2} - a b - a c + b^{2} - b c + c^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+Program couldn't find a solution with integer coefficients. Try to multiple the formula by some integer and run this function again. +
+ +
+ +
+ +
+ + + + +
+$$ a b+a c+b c \le a^{2}+b^{2}+c^{2} $$ +
+ +
+ +
+ +
Out[2]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Function prove prints several things. The first two gives us a formula after expanding it. The next one is status, which is the return status of the first use of scipy.optimize.linprog. Possible outputs and explanations are

+
    +
  • 0 - found a proof with real coefficients,
  • +
  • 1 - need more time,
  • +
  • 2 - function didn't find a proof,
  • +
  • 3,4 - loss of precision (which may happen if it has to work with big numbers).
  • +
+

Then we've got a hint. So let's use it!

+ +
+
+
+
+
+
In [3]:
+
+
+
prove('(a^2+b^2+c^2-a*b-a*c-b*c)*2')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $2 a^{2} - 2 a b - 2 a c + 2 b^{2} - 2 b c + 2 c^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 a b \le a^{2}+b^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 a c \le a^{2}+c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 b c \le b^{2}+c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 0 $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[3]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Problem 2

Find all real numbers such that $a^2+b^2+c^2+d^2=a(b+c+d)$.

+ +
+
+
+
+
+
+

At first glance it doesn't look like an inequality problem, but actually it is one. If you try to calculate both sides for different values, you can see that the left side of the equation is never less than the right one. So let's try

+ +
+
+
+
+
+
In [4]:
+
+
+
prove('a^2+b^2+c^2+d^2-a*(b+c+d)')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $a^{2} - a b - a c - a d + b^{2} + c^{2} + d^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 2 +
+ +
+ +
+ +
+ + + + +
+Program couldn't find any proof. +
+ +
+ +
+ +
+ + + + +
+$$ a b+a c+a d \le a^{2}+b^{2}+c^{2}+d^{2} $$ +
+ +
+ +
+ +
Out[4]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
+

This time prove didn't found the proof. But it doesn't mean that the inequality is not true! prove uses a list of $n$ positive values, where $n$ is a number of variables in the formula. List of values should correspond to the list of variables in alphabetical order. Here are a few tips how to choose the right values.

+
    +
  1. Consider a function $pos(values)$ which is the sum of the positive addends in the formula after substitution of values to variables. Analogically, let $neg(values)$ be the sum of the negative addends. We should choose such values for which $quotient=pos(values)/|neg(values)|$ is small.
  2. +
  3. The symmetry group of the formula splits set of variables into orbits. Using the same values for variables in one orbit is recommended. In particular, if the symmetry group of the formula is transitive (for example, when the formula is cyclic), then all values (probably) should be the same.
  4. +
  5. If the formula is homogeneous, then $values=(a_1,a_2,...,a_n)$ provide a proof iff $values=(ka_1,ka_2,...,ka_n)$ provides a proof for any $k\in Q_+$ (as long as you don't run into overflow error).
  6. +
+

In the formula above $b,c,d$ are in one orbit and the formula is homogenous, so let's try $a=2$ and $b=c=d=1$.

+ +
+
+
+
+
+
In [5]:
+
+
+
prove('a^2+b^2+c^2+d^2-a*(b+c+d)','2,1,1,1')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to 2 e$ +
+ +
+ +
+ +
+ + + + +
+numerator: $b^{2} - 2 b e + c^{2} - 2 c e + d^{2} - 2 d e + 4 e^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 b e \le b^{2}+e^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 c e \le c^{2}+e^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 d e \le d^{2}+e^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le e^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[5]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Function makes a substitution $a\to 2e$ and try to prove new inequality. This time it succeeded. Moreover, if starting formula is equal to 0, then all these inequalities have to be equalities, so $e^2=0$ and eventually $a=0$. We can also try a little bit lower value for $a$.

+ +
+
+
+
+
+
In [6]:
+
+
+
prove('a^2+b^2+c^2+d^2-a*(b+c+d)','7/4,1,1,1')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to \frac{7 f}{4}$ +
+ +
+ +
+ +
+ + + + +
+numerator: $16 b^{2} - 28 b f + 16 c^{2} - 28 c f + 16 d^{2} - 28 d f + 49 f^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $16$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$28 b f \le 14 b^{2}+14 f^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$28 c f \le 14 c^{2}+14 f^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$28 d f \le 14 d^{2}+14 f^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 2 b^{2}+2 c^{2}+2 d^{2}+7 f^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[6]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Now we can see that if $a^2+b^2+c^2+d^2-a(b+c+d)=0$, then $7f^2+2b^2+2c^2+2d^2=0$ and eventually $a=b=c=d=0$. Note that inequality is proved only for positive numbers (which, by continuity, can be expanded to nonnegative numbers). But using similar argumentation to the one in previous problem, if $(a,b,c,d)=(x,y,z,t)$ is the solution of $a^2+b^2+c^2+d^2-a(b+c+d)=0$, then $(a,b,c,d)=(|x|,|y|,|z|,|t|)$ is a solution, too. Since the only nonnegative solution is $(0,0,0,0)$, it means that it is the only solution.

+

It is worth noting that this time function prove used $f$ as a new variable instead of $e$. If you want to start a new proof and you don't care about the collision of variables from previous proofs, you can use newproof function, which clears the set of used variables.

+

We can also use the findvalues function to find values for the proof more automatically. It looks for (local) minimum of the $quotient$ value defined above.

+ +
+
+
+
+
+
In [7]:
+
+
+
formula=S('a^2+b^2+c^2+d^2-a*(b+c+d)')
+numvalues=findvalues(formula)
+numvalues
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
Optimization terminated successfully.
+         Current function value: 1.154701
+         Iterations: 68
+         Function evaluations: 127
+
+
+
+ +
+ +
Out[7]:
+ + + + +
+
(1.4339109663193974,
+ 0.8278441585048405,
+ 0.8279027492686561,
+ 0.8278930696996669)
+
+ +
+ +
+
+ +
+
+
+
+

If the $quotient$ value were less than 1, that would mean that the formula is negative for given values. If $quotient$ were equal to 1, then we have to choose exactly these values (or other values for which the $quotient$ is equal to 1. But here $quotient$ is greater than 1, so we can take a point near it and (probably) still have a proof. The values given to the prove function must not be floating point numbers, so we can rationalize them.

+ +
+
+
+
+
+
In [8]:
+
+
+
values=nsimplify(numvalues,tolerance=0.1,rational=True)
+values
+
+ +
+
+
+ +
+
+ + +
+ +
Out[8]:
+ + + + +
+$\displaystyle \left( \frac{10}{7}, \ \frac{5}{6}, \ \frac{5}{6}, \ \frac{5}{6}\right)$ +
+ +
+ +
+
+ +
+
+
+
In [9]:
+
+
+
newproof()
+prove(formula,values)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to \frac{10 e}{7}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to \frac{5 f}{6}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $c\to \frac{5 g}{6}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $d\to \frac{5 h}{6}$ +
+ +
+ +
+ +
+ + + + +
+numerator: $3600 e^{2} - 2100 e f - 2100 e g - 2100 e h + 1225 f^{2} + 1225 g^{2} + 1225 h^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1764$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2100 e f \le 1050 e^{2}+1050 f^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2100 e g \le 1050 e^{2}+1050 g^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2100 e h \le 1050 e^{2}+1050 h^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 450 e^{2}+175 f^{2}+175 g^{2}+175 h^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[9]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

If you set the tolerance bigger, then the values will have smaller numerators and denominators, so coefficients in the proof will be smaller, too. But if the tolerance is too big, then proof will not be found.

+

Let's skip the problem 3 and look solve the problem 4 instead.

+

Problem 4

If $x$ and $y$ are two positive numbers less than 1, prove that +$$\frac{1}{1-x^2}+\frac{1}{1-y^2}\ge \frac{2}{1-xy}.$$

+ +
+
+
+
+
+
In [10]:
+
+
+
prove('1/(1-x^2)+1/(1-y^2)-2/(1-x*y)')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $- x^{3} y + 2 x^{2} y^{2} - x^{2} - x y^{3} + 2 x y - y^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $x^{3} y^{3} - x^{3} y - x^{2} y^{2} + x^{2} - x y^{3} + x y + y^{2} - 1$ +
+ +
+ +
+ +
+ + + + +
+status: 2 +
+ +
+ +
+ +
+ + + + +
+Program couldn't find any proof. +
+ +
+ +
+ +
+ + + + +
+$$ x^{3} y+x^{2}+x y^{3}+y^{2} \le 2 x^{2} y^{2}+2 x y $$ +
+ +
+ +
+ +
+ + + + +
+It looks like the formula is symmetric. You can assume without loss of generality that x >= y. Try +
+ +
+ +
+ +
+ + + + +
+prove(makesubs(S("-x**3*y + 2*x**2*y**2 - x**2 - x*y**3 + 2*x*y - y**2"),[('y', 'oo')]) +
+ +
+ +
+ +
Out[10]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
+

prove assumes that formula is well-defined if all variables are positive, so it doesn't have to analyze the denominator (except of choosing the right sign). In this case it is not true, since if $x=1$, then $1-x^2=0$. Also denominator is equal to $(x^2-1)(y^2-1)(xy-1)$ which is negative for $x,y\in (0,1)$. So we need to make some substitution after which new variables can have all positive values, not just these inside (0,1) interval.

+

We will use a function makesubs to generate these substitutions. It has three basic parameters: formula, intervals and values. intervals are current limitations of variables, values are values of variables for which $quotient$ of formula is small. values should be inside corresponding intervals. This argument is optional but it's better to use it. +Let's go back to our problem. If $x=y$, then $\frac{1}{1-x^2}+\frac{1}{1-y^2}\ge \frac{2}{1-xy}$, so it's the minimum value of the formula. So let values=(1/2,1/2) (warning: do not use decimal point, for example '0.5,0.5').

+ +
+
+
+
+
+
In [11]:
+
+
+
newproof()
+newformula,newvalues=makesubs('1/(1-x^2)+1/(1-y^2)-2/(1-x*y)','[0,1],[0,1]','1/2,1/2')
+prove(newformula*3,newvalues)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $x\to 1 - \frac{1}{a + 1}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $y\to 1 - \frac{1}{b + 1}$ +
+ +
+ +
+ +
+ + + + +
+numerator: $6 a^{3} b + 3 a^{3} - 12 a^{2} b^{2} - 3 a^{2} b + 3 a^{2} + 6 a b^{3} - 3 a b^{2} - 6 a b + 3 b^{3} + 3 b^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $4 a^{2} b + 2 a^{2} + 4 a b^{2} + 8 a b + 3 a + 2 b^{2} + 3 b + 1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$12 a^{2} b^{2} \le 6 a^{3} b+6 a b^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$3 a^{2} b \le 2 a^{3}+b^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$3 a b^{2} \le a^{3}+2 b^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$6 a b \le 3 a^{2}+3 b^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 0 $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[11]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Now let's get back to problem 3.

+

Problem 3

If $a,b,c$ are positive real numbers that satisfy $a^2+b^2+c^2=1$, find the minimal value of +$$\frac{a^2b^2}{c^2}+\frac{b^2c^2}{a^2}+\frac{c^2a^2}{b^2}$$

+

The problem is equivalent to finding minimum of $xy/z+yz/x+zx/y$ assuming $x+y+z=1$ and $x,y,z>0$. The first idea is to suppose that the minimum is reached when $x=y=z$. In that case, $x=y=z=1/3$ and formula is equal to 1. Now we can substitute $z\to 1-x-y$. Constraints for variables are $x>0$, $y>0$, $x+y<1$. We can rewrite it as $x \in (0,1-y)$, $y \in (0,1)$. These two conditions have two important properties:

+
    +
  • constraints for variables are written as intervals,
  • +
  • there are no "backwards dependencies", i.e. there is no $x$ in the interval of $y$.
  • +
+

If these two conditions hold, then you can use makesubs function.

+ +
+
+
+
+
+
In [12]:
+
+
+
newproof()
+formula=Sm('xy/z+yz/x+zx/y-1').subs('z',S('1-x-y'))
+newformula,values=makesubs(formula,'[0,1-y],[0,1]','1/3,1/3')
+prove(newformula,values)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $x\to - y + 1 + \frac{y - 1}{a + 1}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $y\to 1 - \frac{1}{b + 1}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to \frac{c}{2}$ +
+ +
+ +
+ +
+ + + + +
+numerator: $a^{4} c^{2} + a^{3} c^{2} - 2 a^{3} c - 4 a^{2} c + 4 a^{2} + a c^{2} - 2 a c + c^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $a^{3} c^{2} + 2 a^{3} c + 2 a^{2} c^{2} + 4 a^{2} c + a c^{2} + 2 a c$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 a^{3} c \le a^{4} c^{2}+a^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$4 a^{2} c \le a^{3} c^{2}+2 a^{2}+a c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 a c \le a^{2}+c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 0 $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[12]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

The proof is found, so the assumption that 1 is the minimum of xy/z+yz/x+zx/y was good.

+

Functions S and Sm creates a SymPy object from a string. The only difference is that Sm assumes that there are no multi-letter variables and adds a multiplication sign between every two terms which has no operator sign, so object Sm(xy/z+yz/x+zx/y) has 3 variables x,y,z and S('xy/z+yz/x+zx/y') has 6 variables x,y,z,xy,yz,zx.

+

As you may have noticed, formulas are often cyclic or symmetric. Therefore you can use cyclize or symmetrize function to reduce the length of the written formula. Here are a few commands which will do the same as each other.

+ +
+
+
+
+
+
In [13]:
+
+
+
prove('(a^2+b^2+c^2-a*b-a*c-b*c)*2')
+#prove(S('(a^2+b^2+c^2-a*b-a*c-b*c)*2'))
+#prove(Sm('2(a^2+b^2+c^2-ab-ac-bc)'))
+#prove(cyclize('2*a^2-2*a*b'))
+#prove(symmetrize('a^2-a*b'))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $2 a^{2} - 2 a b - 2 a c + 2 b^{2} - 2 b c + 2 c^{2}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 a b \le a^{2}+b^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 a c \le a^{2}+c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 b c \le b^{2}+c^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 0 $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[13]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Now look at formula $(x-1)^4$. It's quite obvious that it's nonnegative, but prove fails to show this!

+ +
+
+
+
+
+
In [14]:
+
+
+
prove('(x-1)^4')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $x^{4} - 4 x^{3} + 6 x^{2} - 4 x + 1$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 2 +
+ +
+ +
+ +
+ + + + +
+Program couldn't find any proof. +
+ +
+ +
+ +
+ + + + +
+$$ 4 x^{3}+4 x \le x^{4}+6 x^{2}+1 $$ +
+ +
+ +
+ +
Out[14]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
+

But there is a relatively simple method to generate a proof using this library. We will make to proofs: one for $x\in (1,\infty)$ and the second one for $(-\infty,1)$.

+ +
+
+
+
+
+
In [15]:
+
+
+
newproof()
+prove(makesubs('(x-1)^4','(1,oo)'))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $x\to a + 1$ +
+ +
+ +
+ +
+ + + + +
+numerator: $a^{4}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le a^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[15]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
In [16]:
+
+
+
newproof()
+prove(makesubs('(x-1)^4','(-oo,1)'))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $x\to 1 - a$ +
+ +
+ +
+ +
+ + + + +
+numerator: $a^{4}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le a^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[16]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Now let's go to the problem 10

+

Problem 10

If $a,b,c,d>0$, prove that +$$\frac a{b+c}+\frac b{c+d}+ \frac c{d+a}+ \frac d{a+b}\geq 2.$$

+

Let's try a simple approach.

+ +
+
+
+
+
+
In [17]:
+
+
+
formula=cyclize('a/(b+c)',variables='a,b,c,d')-2
+formula
+
+ +
+
+
+ +
+
+ + +
+ +
Out[17]:
+ + + + +
+$\displaystyle \frac{a}{b + c} + \frac{b}{c + d} + \frac{c}{a + d} + \frac{d}{a + b} - 2$ +
+ +
+ +
+
+ +
+
+
+
In [18]:
+
+
+
prove(formula)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $a^{3} c + a^{3} d + a^{2} b^{2} - a^{2} b d - 2 a^{2} c^{2} - a^{2} c d + a^{2} d^{2} + a b^{3} - a b^{2} c - a b^{2} d - a b c^{2} + a c^{3} - a c d^{2} + b^{3} d + b^{2} c^{2} - 2 b^{2} d^{2} + b c^{3} - b c^{2} d - b c d^{2} + b d^{3} + c^{2} d^{2} + c d^{3}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $a^{2} b c + a^{2} b d + a^{2} c^{2} + a^{2} c d + a b^{2} c + a b^{2} d + a b c^{2} + 2 a b c d + a b d^{2} + a c^{2} d + a c d^{2} + b^{2} c d + b^{2} d^{2} + b c^{2} d + b c d^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 2 +
+ +
+ +
+ +
+ + + + +
+Program couldn't find any proof. +
+ +
+ +
+ +
+ + + + +
+$$ a^{2} b d+2 a^{2} c^{2}+a^{2} c d+a b^{2} c+a b^{2} d+a b c^{2}+a c d^{2}+2 b^{2} d^{2}+b c^{2} d+b c d^{2} \le a^{3} c+a^{3} d+a^{2} b^{2}+a^{2} d^{2}+a b^{3}+a c^{3}+b^{3} d+b^{2} c^{2}+b c^{3}+b d^{3}+c^{2} d^{2}+c d^{3} $$ +
+ +
+ +
+ +
Out[18]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
+

This problem, like the previous one, can be solved by splitting the domain of variables to several subdomains. But we can also use the symmetry of this inequality. For example, without loss of generality we can assume that $a\ge c$ and $b\ge d$, so $a\in [c,\infty)$, $b\in [d,\infty)$.

+ +
+
+
+
+
+
In [19]:
+
+
+
newproof()
+prove(makesubs(formula,'[c,oo],[d,oo]'))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to c + e$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to d + f$ +
+ +
+ +
+ +
+ + + + +
+numerator: $c^{2} e^{2} - c^{2} e f + c^{2} f^{2} + 2 c d e^{2} + 2 c d f^{2} + c e^{3} + c e f^{2} + c f^{3} + d^{2} e^{2} + d^{2} e f + d^{2} f^{2} + d e^{3} + d e^{2} f + 2 d e f^{2} + d f^{3} + e^{2} f^{2} + e f^{3}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $c^{4} + 4 c^{3} d + 2 c^{3} e + 2 c^{3} f + 6 c^{2} d^{2} + 6 c^{2} d e + 6 c^{2} d f + c^{2} e^{2} + 3 c^{2} e f + c^{2} f^{2} + 4 c d^{3} + 6 c d^{2} e + 6 c d^{2} f + 2 c d e^{2} + 6 c d e f + 2 c d f^{2} + c e^{2} f + c e f^{2} + d^{4} + 2 d^{3} e + 2 d^{3} f + d^{2} e^{2} + 3 d^{2} e f + d^{2} f^{2} + d e^{2} f + d e f^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+Program couldn't find a solution with integer coefficients. Try to multiple the formula by some integer and run this function again. +
+ +
+ +
+ +
+ + + + +
+$$ c^{2} e f \le c^{2} e^{2}+c^{2} f^{2}+2 c d e^{2}+2 c d f^{2}+c e^{3}+c e f^{2}+c f^{3}+d^{2} e^{2}+d^{2} e f+d^{2} f^{2}+d e^{3}+d e^{2} f+2 d e f^{2}+d f^{3}+e^{2} f^{2}+e f^{3} $$ +
+ +
+ +
+ +
Out[19]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
In [20]:
+
+
+
newproof()
+prove(makesubs(formula,'[c,oo],[d,oo]')*2)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to c + e$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to d + f$ +
+ +
+ +
+ +
+ + + + +
+numerator: $2 c^{2} e^{2} - 2 c^{2} e f + 2 c^{2} f^{2} + 4 c d e^{2} + 4 c d f^{2} + 2 c e^{3} + 2 c e f^{2} + 2 c f^{3} + 2 d^{2} e^{2} + 2 d^{2} e f + 2 d^{2} f^{2} + 2 d e^{3} + 2 d e^{2} f + 4 d e f^{2} + 2 d f^{3} + 2 e^{2} f^{2} + 2 e f^{3}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $c^{4} + 4 c^{3} d + 2 c^{3} e + 2 c^{3} f + 6 c^{2} d^{2} + 6 c^{2} d e + 6 c^{2} d f + c^{2} e^{2} + 3 c^{2} e f + c^{2} f^{2} + 4 c d^{3} + 6 c d^{2} e + 6 c d^{2} f + 2 c d e^{2} + 6 c d e f + 2 c d f^{2} + c e^{2} f + c e f^{2} + d^{4} + 2 d^{3} e + 2 d^{3} f + d^{2} e^{2} + 3 d^{2} e f + d^{2} f^{2} + d e^{2} f + d e f^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 c^{2} e f \le c^{2} e^{2}+c^{2} f^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le c^{2} e^{2}+c^{2} f^{2}+4 c d e^{2}+4 c d f^{2}+2 c e^{3}+2 c e f^{2}+2 c f^{3}+2 d^{2} e^{2}+2 d^{2} e f+2 d^{2} f^{2}+2 d e^{3}+2 d e^{2} f+4 d e f^{2}+2 d f^{3}+2 e^{2} f^{2}+2 e f^{3} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[20]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

It's a good idea to use intervals that are unbounded from one side (i.e. those which contain $\pm\infty$). In this problem we could assume that $a\in (0,c]$, $b\in (0,d]$ as well. But as you can see, in this case the proof is several times longer.

+ +
+
+
+
+
+
In [21]:
+
+
+
newproof()
+prove(makesubs(formula,'[0,c],[0,d]')*2)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Substitute $a\to c - \frac{c}{e + 1}$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to d - \frac{d}{f + 1}$ +
+ +
+ +
+ +
+ + + + +
+numerator: $2 c^{4} e f^{3} + 6 c^{4} e f^{2} + 6 c^{4} e f + 2 c^{4} e - 2 c^{3} d e^{2} f^{2} - 4 c^{3} d e^{2} f - 2 c^{3} d e^{2} + 4 c^{3} d e f^{3} + 8 c^{3} d e f^{2} + 4 c^{3} d e f + 2 c^{3} d f^{3} + 4 c^{3} d f^{2} + 2 c^{3} d f + 2 c^{2} d^{2} e^{3} f + 2 c^{2} d^{2} e^{3} + 4 c^{2} d^{2} e^{2} f + 4 c^{2} d^{2} e^{2} + 2 c^{2} d^{2} e f^{3} + 4 c^{2} d^{2} e f^{2} + 6 c^{2} d^{2} e f + 4 c^{2} d^{2} e + 2 c^{2} d^{2} f^{3} + 4 c^{2} d^{2} f^{2} + 4 c^{2} d^{2} f + 2 c^{2} d^{2} + 4 c d^{3} e^{3} f + 2 c d^{3} e^{3} + 2 c d^{3} e^{2} f^{2} + 12 c d^{3} e^{2} f + 6 c d^{3} e^{2} + 4 c d^{3} e f^{2} + 12 c d^{3} e f + 6 c d^{3} e + 2 c d^{3} f^{2} + 4 c d^{3} f + 2 c d^{3} + 2 d^{4} e^{3} f + 6 d^{4} e^{2} f + 6 d^{4} e f + 2 d^{4} f$ +
+ +
+ +
+ +
+ + + + +
+denominator: $c^{4} e^{3} f^{3} + 3 c^{4} e^{3} f^{2} + 3 c^{4} e^{3} f + c^{4} e^{3} + c^{4} e^{2} f^{3} + 3 c^{4} e^{2} f^{2} + 3 c^{4} e^{2} f + c^{4} e^{2} + 4 c^{3} d e^{3} f^{3} + 10 c^{3} d e^{3} f^{2} + 8 c^{3} d e^{3} f + 2 c^{3} d e^{3} + 6 c^{3} d e^{2} f^{3} + 15 c^{3} d e^{2} f^{2} + 12 c^{3} d e^{2} f + 3 c^{3} d e^{2} + 2 c^{3} d e f^{3} + 5 c^{3} d e f^{2} + 4 c^{3} d e f + c^{3} d e + 6 c^{2} d^{2} e^{3} f^{3} + 12 c^{2} d^{2} e^{3} f^{2} + 7 c^{2} d^{2} e^{3} f + c^{2} d^{2} e^{3} + 12 c^{2} d^{2} e^{2} f^{3} + 24 c^{2} d^{2} e^{2} f^{2} + 14 c^{2} d^{2} e^{2} f + 2 c^{2} d^{2} e^{2} + 7 c^{2} d^{2} e f^{3} + 14 c^{2} d^{2} e f^{2} + 8 c^{2} d^{2} e f + c^{2} d^{2} e + c^{2} d^{2} f^{3} + 2 c^{2} d^{2} f^{2} + c^{2} d^{2} f + 4 c d^{3} e^{3} f^{3} + 6 c d^{3} e^{3} f^{2} + 2 c d^{3} e^{3} f + 10 c d^{3} e^{2} f^{3} + 15 c d^{3} e^{2} f^{2} + 5 c d^{3} e^{2} f + 8 c d^{3} e f^{3} + 12 c d^{3} e f^{2} + 4 c d^{3} e f + 2 c d^{3} f^{3} + 3 c d^{3} f^{2} + c d^{3} f + d^{4} e^{3} f^{3} + d^{4} e^{3} f^{2} + 3 d^{4} e^{2} f^{3} + 3 d^{4} e^{2} f^{2} + 3 d^{4} e f^{3} + 3 d^{4} e f^{2} + d^{4} f^{3} + d^{4} f^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 c^{3} d e^{2} f^{2} \le c^{4} e f^{3}+c^{2} d^{2} e^{3} f$$ +
+ +
+ +
+ +
+ + + + +
+$$2 c^{3} d e^{2} \le c^{4} e+c^{2} d^{2} e^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$4 c^{3} d e^{2} f \le c^{4} e f^{3}+c^{4} e+c^{2} d^{2} e^{3} f+c^{2} d^{2} e^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 6 c^{4} e f^{2}+6 c^{4} e f+4 c^{3} d e f^{3}+8 c^{3} d e f^{2}+4 c^{3} d e f+2 c^{3} d f^{3}+4 c^{3} d f^{2}+2 c^{3} d f+4 c^{2} d^{2} e^{2} f+4 c^{2} d^{2} e^{2}+2 c^{2} d^{2} e f^{3}+4 c^{2} d^{2} e f^{2}+6 c^{2} d^{2} e f+4 c^{2} d^{2} e+2 c^{2} d^{2} f^{3}+4 c^{2} d^{2} f^{2}+4 c^{2} d^{2} f+2 c^{2} d^{2}+4 c d^{3} e^{3} f+2 c d^{3} e^{3}+2 c d^{3} e^{2} f^{2}+12 c d^{3} e^{2} f+6 c d^{3} e^{2}+4 c d^{3} e f^{2}+12 c d^{3} e f+6 c d^{3} e+2 c d^{3} f^{2}+4 c d^{3} f+2 c d^{3}+2 d^{4} e^{3} f+6 d^{4} e^{2} f+6 d^{4} e f+2 d^{4} f $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[21]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Function powerprove is a shortcut for splitting domain $R_+^n$ on several subdomains and proving the inequality for each of them. This function uses $2^n$ of $n$-dimensional intervals with a common point (by default it's $(1,1,...,1)$), where $n$ is a number of variables. Here there are two examples of using it. As you can see, proofs are very long.

+ +
+
+
+
+
+
In [22]:
+
+
+
newproof()
+#this is equivalent to
+#prove(makesubs('(x-1)^4','[1,oo]'))
+#prove(makesubs('(x-1)^4','[-oo,1]'))
+powerprove('(x-1)^4')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $x^{4} - 4 x^{3} + 6 x^{2} - 4 x + 1$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $x\to 1+a$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $a^{4}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le a^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $x\to 1/(1+b)$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $b^{4}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le b^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[22]:
+ + + + +
+
Counter({0: 2})
+
+ +
+ +
+
+ +
+
+
+
In [23]:
+
+
+
newproof()
+formula=Sm('-(3a + 2b + c)(2a^3 + 3b^2 + 6c + 1) + (4a + 4b + 4c)(a^4 + b^3 + c^2 + 3)')
+#this is equivalent to
+#prove(makesubs(formula,'[1,oo],[1,oo],[1,oo]'))
+#prove(makesubs(formula,'[-1,oo],[1,oo],[1,oo]'))
+#prove(makesubs(formula,'[1,oo],[-1,oo],[1,oo]'))
+#prove(makesubs(formula,'[-1,oo],[-1,oo],[1,oo]'))
+#prove(makesubs(formula,'[1,oo],[1,oo],[-1,oo]'))
+#prove(makesubs(formula,'[-1,oo],[1,oo],[-1,oo]'))
+#prove(makesubs(formula,'[1,oo],[-1,oo],[-1,oo]'))
+#prove(makesubs(formula,'[-1,oo],[-1,oo],[-1,oo]'))
+powerprove(formula)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $4 a^{5} + 4 a^{4} b + 4 a^{4} c - 6 a^{4} - 4 a^{3} b - 2 a^{3} c + 4 a b^{3} - 9 a b^{2} + 4 a c^{2} - 18 a c + 9 a + 4 b^{4} + 4 b^{3} c - 6 b^{3} - 3 b^{2} c + 4 b c^{2} - 12 b c + 10 b + 4 c^{3} - 6 c^{2} + 11 c$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1+d,b\to 1+e,c\to 1+f$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 d^{5} + 4 d^{4} e + 4 d^{4} f + 22 d^{4} + 12 d^{3} e + 14 d^{3} f + 42 d^{3} + 12 d^{2} e + 18 d^{2} f + 34 d^{2} + 4 d e^{3} + 3 d e^{2} - 2 d e + 4 d f^{2} + 4 e^{4} + 4 e^{3} f + 18 e^{3} + 9 e^{2} f + 18 e^{2} + 4 e f^{2} + 2 e f + 4 f^{3} + 14 f^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 d e \le d^{2}+e^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 d^{5}+4 d^{4} e+4 d^{4} f+22 d^{4}+12 d^{3} e+14 d^{3} f+42 d^{3}+12 d^{2} e+18 d^{2} f+33 d^{2}+4 d e^{3}+3 d e^{2}+4 d f^{2}+4 e^{4}+4 e^{3} f+18 e^{3}+9 e^{2} f+17 e^{2}+4 e f^{2}+2 e f+4 f^{3}+14 f^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1/(1+g),b\to 1+h,c\to 1+i$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 g^{5} h^{4} + 4 g^{5} h^{3} i + 14 g^{5} h^{3} + 9 g^{5} h^{2} i + 15 g^{5} h^{2} + 4 g^{5} h i^{2} + 2 g^{5} h i + 6 g^{5} h + 4 g^{5} i^{3} + 10 g^{5} i^{2} + 8 g^{5} i + 10 g^{5} + 20 g^{4} h^{4} + 20 g^{4} h^{3} i + 74 g^{4} h^{3} + 45 g^{4} h^{2} i + 78 g^{4} h^{2} + 20 g^{4} h i^{2} + 10 g^{4} h i + 24 g^{4} h + 20 g^{4} i^{3} + 54 g^{4} i^{2} + 30 g^{4} i + 40 g^{4} + 40 g^{3} h^{4} + 40 g^{3} h^{3} i + 156 g^{3} h^{3} + 90 g^{3} h^{2} i + 162 g^{3} h^{2} + 40 g^{3} h i^{2} + 20 g^{3} h i + 36 g^{3} h + 40 g^{3} i^{3} + 116 g^{3} i^{2} + 40 g^{3} i + 60 g^{3} + 40 g^{2} h^{4} + 40 g^{2} h^{3} i + 164 g^{2} h^{3} + 90 g^{2} h^{2} i + 168 g^{2} h^{2} + 40 g^{2} h i^{2} + 20 g^{2} h i + 20 g^{2} h + 40 g^{2} i^{3} + 124 g^{2} i^{2} + 18 g^{2} i + 34 g^{2} + 20 g h^{4} + 20 g h^{3} i + 86 g h^{3} + 45 g h^{2} i + 87 g h^{2} + 20 g h i^{2} + 10 g h i + 2 g h + 20 g i^{3} + 66 g i^{2} + 4 h^{4} + 4 h^{3} i + 18 h^{3} + 9 h^{2} i + 18 h^{2} + 4 h i^{2} + 2 h i + 4 i^{3} + 14 i^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 g^{5} h^{4}+4 g^{5} h^{3} i+14 g^{5} h^{3}+9 g^{5} h^{2} i+15 g^{5} h^{2}+4 g^{5} h i^{2}+2 g^{5} h i+6 g^{5} h+4 g^{5} i^{3}+10 g^{5} i^{2}+8 g^{5} i+10 g^{5}+20 g^{4} h^{4}+20 g^{4} h^{3} i+74 g^{4} h^{3}+45 g^{4} h^{2} i+78 g^{4} h^{2}+20 g^{4} h i^{2}+10 g^{4} h i+24 g^{4} h+20 g^{4} i^{3}+54 g^{4} i^{2}+30 g^{4} i+40 g^{4}+40 g^{3} h^{4}+40 g^{3} h^{3} i+156 g^{3} h^{3}+90 g^{3} h^{2} i+162 g^{3} h^{2}+40 g^{3} h i^{2}+20 g^{3} h i+36 g^{3} h+40 g^{3} i^{3}+116 g^{3} i^{2}+40 g^{3} i+60 g^{3}+40 g^{2} h^{4}+40 g^{2} h^{3} i+164 g^{2} h^{3}+90 g^{2} h^{2} i+168 g^{2} h^{2}+40 g^{2} h i^{2}+20 g^{2} h i+20 g^{2} h+40 g^{2} i^{3}+124 g^{2} i^{2}+18 g^{2} i+34 g^{2}+20 g h^{4}+20 g h^{3} i+86 g h^{3}+45 g h^{2} i+87 g h^{2}+20 g h i^{2}+10 g h i+2 g h+20 g i^{3}+66 g i^{2}+4 h^{4}+4 h^{3} i+18 h^{3}+9 h^{2} i+18 h^{2}+4 h i^{2}+2 h i+4 i^{3}+14 i^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1+j,b\to 1/(1+k),c\to 1+l$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 j^{5} k^{4} + 16 j^{5} k^{3} + 24 j^{5} k^{2} + 16 j^{5} k + 4 j^{5} + 4 j^{4} k^{4} l + 18 j^{4} k^{4} + 16 j^{4} k^{3} l + 76 j^{4} k^{3} + 24 j^{4} k^{2} l + 120 j^{4} k^{2} + 16 j^{4} k l + 84 j^{4} k + 4 j^{4} l + 22 j^{4} + 14 j^{3} k^{4} l + 30 j^{3} k^{4} + 56 j^{3} k^{3} l + 132 j^{3} k^{3} + 84 j^{3} k^{2} l + 216 j^{3} k^{2} + 56 j^{3} k l + 156 j^{3} k + 14 j^{3} l + 42 j^{3} + 18 j^{2} k^{4} l + 22 j^{2} k^{4} + 72 j^{2} k^{3} l + 100 j^{2} k^{3} + 108 j^{2} k^{2} l + 168 j^{2} k^{2} + 72 j^{2} k l + 124 j^{2} k + 18 j^{2} l + 34 j^{2} + 4 j k^{4} l^{2} + j k^{4} + 16 j k^{3} l^{2} + 8 j k^{3} + 24 j k^{2} l^{2} + 9 j k^{2} + 16 j k l^{2} + 2 j k + 4 j l^{2} + 4 k^{4} l^{3} + 10 k^{4} l^{2} + 3 k^{4} l + 4 k^{4} + 16 k^{3} l^{3} + 44 k^{3} l^{2} + 8 k^{3} l + 18 k^{3} + 24 k^{2} l^{3} + 72 k^{2} l^{2} + 3 k^{2} l + 18 k^{2} + 16 k l^{3} + 52 k l^{2} - 2 k l + 4 l^{3} + 14 l^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 k l \le k^{2}+l^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 j^{5} k^{4}+16 j^{5} k^{3}+24 j^{5} k^{2}+16 j^{5} k+4 j^{5}+4 j^{4} k^{4} l+18 j^{4} k^{4}+16 j^{4} k^{3} l+76 j^{4} k^{3}+24 j^{4} k^{2} l+120 j^{4} k^{2}+16 j^{4} k l+84 j^{4} k+4 j^{4} l+22 j^{4}+14 j^{3} k^{4} l+30 j^{3} k^{4}+56 j^{3} k^{3} l+132 j^{3} k^{3}+84 j^{3} k^{2} l+216 j^{3} k^{2}+56 j^{3} k l+156 j^{3} k+14 j^{3} l+42 j^{3}+18 j^{2} k^{4} l+22 j^{2} k^{4}+72 j^{2} k^{3} l+100 j^{2} k^{3}+108 j^{2} k^{2} l+168 j^{2} k^{2}+72 j^{2} k l+124 j^{2} k+18 j^{2} l+34 j^{2}+4 j k^{4} l^{2}+j k^{4}+16 j k^{3} l^{2}+8 j k^{3}+24 j k^{2} l^{2}+9 j k^{2}+16 j k l^{2}+2 j k+4 j l^{2}+4 k^{4} l^{3}+10 k^{4} l^{2}+3 k^{4} l+4 k^{4}+16 k^{3} l^{3}+44 k^{3} l^{2}+8 k^{3} l+18 k^{3}+24 k^{2} l^{3}+72 k^{2} l^{2}+3 k^{2} l+17 k^{2}+16 k l^{3}+52 k l^{2}+4 l^{3}+13 l^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1/(1+m),b\to 1/(1+n),c\to 1+o$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 m^{5} n^{4} o^{3} + 6 m^{5} n^{4} o^{2} + 11 m^{5} n^{4} o + 9 m^{5} n^{4} + 16 m^{5} n^{3} o^{3} + 28 m^{5} n^{3} o^{2} + 40 m^{5} n^{3} o + 38 m^{5} n^{3} + 24 m^{5} n^{2} o^{3} + 48 m^{5} n^{2} o^{2} + 51 m^{5} n^{2} o + 57 m^{5} n^{2} + 16 m^{5} n o^{3} + 36 m^{5} n o^{2} + 30 m^{5} n o + 34 m^{5} n + 4 m^{5} o^{3} + 10 m^{5} o^{2} + 8 m^{5} o + 10 m^{5} + 20 m^{4} n^{4} o^{3} + 34 m^{4} n^{4} o^{2} + 45 m^{4} n^{4} o + 40 m^{4} n^{4} + 80 m^{4} n^{3} o^{3} + 156 m^{4} n^{3} o^{2} + 160 m^{4} n^{3} o + 170 m^{4} n^{3} + 120 m^{4} n^{2} o^{3} + 264 m^{4} n^{2} o^{2} + 195 m^{4} n^{2} o + 246 m^{4} n^{2} + 80 m^{4} n o^{3} + 196 m^{4} n o^{2} + 110 m^{4} n o + 136 m^{4} n + 20 m^{4} o^{3} + 54 m^{4} o^{2} + 30 m^{4} o + 40 m^{4} + 40 m^{3} n^{4} o^{3} + 76 m^{3} n^{4} o^{2} + 70 m^{3} n^{4} o + 70 m^{3} n^{4} + 160 m^{3} n^{3} o^{3} + 344 m^{3} n^{3} o^{2} + 240 m^{3} n^{3} o + 300 m^{3} n^{3} + 240 m^{3} n^{2} o^{3} + 576 m^{3} n^{2} o^{2} + 270 m^{3} n^{2} o + 414 m^{3} n^{2} + 160 m^{3} n o^{3} + 424 m^{3} n o^{2} + 140 m^{3} n o + 204 m^{3} n + 40 m^{3} o^{3} + 116 m^{3} o^{2} + 40 m^{3} o + 60 m^{3} + 40 m^{2} n^{4} o^{3} + 84 m^{2} n^{4} o^{2} + 48 m^{2} n^{4} o + 58 m^{2} n^{4} + 160 m^{2} n^{3} o^{3} + 376 m^{2} n^{3} o^{2} + 152 m^{2} n^{3} o + 248 m^{2} n^{3} + 240 m^{2} n^{2} o^{3} + 624 m^{2} n^{2} o^{2} + 138 m^{2} n^{2} o + 312 m^{2} n^{2} + 160 m^{2} n o^{3} + 456 m^{2} n o^{2} + 52 m^{2} n o + 116 m^{2} n + 40 m^{2} o^{3} + 124 m^{2} o^{2} + 18 m^{2} o + 34 m^{2} + 20 m n^{4} o^{3} + 46 m n^{4} o^{2} + 15 m n^{4} o + 19 m n^{4} + 80 m n^{3} o^{3} + 204 m n^{3} o^{2} + 40 m n^{3} o + 82 m n^{3} + 120 m n^{2} o^{3} + 336 m n^{2} o^{2} + 15 m n^{2} o + 81 m n^{2} + 80 m n o^{3} + 244 m n o^{2} - 10 m n o - 2 m n + 20 m o^{3} + 66 m o^{2} + 4 n^{4} o^{3} + 10 n^{4} o^{2} + 3 n^{4} o + 4 n^{4} + 16 n^{3} o^{3} + 44 n^{3} o^{2} + 8 n^{3} o + 18 n^{3} + 24 n^{2} o^{3} + 72 n^{2} o^{2} + 3 n^{2} o + 18 n^{2} + 16 n o^{3} + 52 n o^{2} - 2 n o + 4 o^{3} + 14 o^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 m n \le m^{2}+n^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 n o \le n^{2}+o^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$10 m n o \le 2 m^{2}+2 m n^{2} o+4 m o^{2}+2 n^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 m^{5} n^{4} o^{3}+6 m^{5} n^{4} o^{2}+11 m^{5} n^{4} o+9 m^{5} n^{4}+16 m^{5} n^{3} o^{3}+28 m^{5} n^{3} o^{2}+40 m^{5} n^{3} o+38 m^{5} n^{3}+24 m^{5} n^{2} o^{3}+48 m^{5} n^{2} o^{2}+51 m^{5} n^{2} o+57 m^{5} n^{2}+16 m^{5} n o^{3}+36 m^{5} n o^{2}+30 m^{5} n o+34 m^{5} n+4 m^{5} o^{3}+10 m^{5} o^{2}+8 m^{5} o+10 m^{5}+20 m^{4} n^{4} o^{3}+34 m^{4} n^{4} o^{2}+45 m^{4} n^{4} o+40 m^{4} n^{4}+80 m^{4} n^{3} o^{3}+156 m^{4} n^{3} o^{2}+160 m^{4} n^{3} o+170 m^{4} n^{3}+120 m^{4} n^{2} o^{3}+264 m^{4} n^{2} o^{2}+195 m^{4} n^{2} o+246 m^{4} n^{2}+80 m^{4} n o^{3}+196 m^{4} n o^{2}+110 m^{4} n o+136 m^{4} n+20 m^{4} o^{3}+54 m^{4} o^{2}+30 m^{4} o+40 m^{4}+40 m^{3} n^{4} o^{3}+76 m^{3} n^{4} o^{2}+70 m^{3} n^{4} o+70 m^{3} n^{4}+160 m^{3} n^{3} o^{3}+344 m^{3} n^{3} o^{2}+240 m^{3} n^{3} o+300 m^{3} n^{3}+240 m^{3} n^{2} o^{3}+576 m^{3} n^{2} o^{2}+270 m^{3} n^{2} o+414 m^{3} n^{2}+160 m^{3} n o^{3}+424 m^{3} n o^{2}+140 m^{3} n o+204 m^{3} n+40 m^{3} o^{3}+116 m^{3} o^{2}+40 m^{3} o+60 m^{3}+40 m^{2} n^{4} o^{3}+84 m^{2} n^{4} o^{2}+48 m^{2} n^{4} o+58 m^{2} n^{4}+160 m^{2} n^{3} o^{3}+376 m^{2} n^{3} o^{2}+152 m^{2} n^{3} o+248 m^{2} n^{3}+240 m^{2} n^{2} o^{3}+624 m^{2} n^{2} o^{2}+138 m^{2} n^{2} o+312 m^{2} n^{2}+160 m^{2} n o^{3}+456 m^{2} n o^{2}+52 m^{2} n o+116 m^{2} n+40 m^{2} o^{3}+124 m^{2} o^{2}+18 m^{2} o+31 m^{2}+20 m n^{4} o^{3}+46 m n^{4} o^{2}+15 m n^{4} o+19 m n^{4}+80 m n^{3} o^{3}+204 m n^{3} o^{2}+40 m n^{3} o+82 m n^{3}+120 m n^{2} o^{3}+336 m n^{2} o^{2}+13 m n^{2} o+81 m n^{2}+80 m n o^{3}+244 m n o^{2}+20 m o^{3}+62 m o^{2}+4 n^{4} o^{3}+10 n^{4} o^{2}+3 n^{4} o+4 n^{4}+16 n^{3} o^{3}+44 n^{3} o^{2}+8 n^{3} o+16 n^{3}+24 n^{2} o^{3}+72 n^{2} o^{2}+3 n^{2} o+16 n^{2}+16 n o^{3}+52 n o^{2}+4 o^{3}+13 o^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1+p,b\to 1+q,c\to 1/(1+r)$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 p^{5} r^{3} + 12 p^{5} r^{2} + 12 p^{5} r + 4 p^{5} + 4 p^{4} q r^{3} + 12 p^{4} q r^{2} + 12 p^{4} q r + 4 p^{4} q + 18 p^{4} r^{3} + 58 p^{4} r^{2} + 62 p^{4} r + 22 p^{4} + 12 p^{3} q r^{3} + 36 p^{3} q r^{2} + 36 p^{3} q r + 12 p^{3} q + 28 p^{3} r^{3} + 98 p^{3} r^{2} + 112 p^{3} r + 42 p^{3} + 12 p^{2} q r^{3} + 36 p^{2} q r^{2} + 36 p^{2} q r + 12 p^{2} q + 16 p^{2} r^{3} + 66 p^{2} r^{2} + 84 p^{2} r + 34 p^{2} + 4 p q^{3} r^{3} + 12 p q^{3} r^{2} + 12 p q^{3} r + 4 p q^{3} + 3 p q^{2} r^{3} + 9 p q^{2} r^{2} + 9 p q^{2} r + 3 p q^{2} - 2 p q r^{3} - 6 p q r^{2} - 6 p q r - 2 p q + 4 p r^{3} + 4 p r^{2} + 4 q^{4} r^{3} + 12 q^{4} r^{2} + 12 q^{4} r + 4 q^{4} + 14 q^{3} r^{3} + 46 q^{3} r^{2} + 50 q^{3} r + 18 q^{3} + 9 q^{2} r^{3} + 36 q^{2} r^{2} + 45 q^{2} r + 18 q^{2} + 2 q r^{3} - 2 q r + 10 r^{3} + 14 r^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 p q r^{3} \le p^{2} q r^{3}+q r^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 p q \le p^{2}+q^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 q r \le q^{2}+r^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$6 p q r \le 2 p^{3} q+2 q^{2} r+2 r^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$6 p q r^{2} \le 2 p q^{2} r^{3}+p q^{2}+3 p r^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 p^{5} r^{3}+12 p^{5} r^{2}+12 p^{5} r+4 p^{5}+4 p^{4} q r^{3}+12 p^{4} q r^{2}+12 p^{4} q r+4 p^{4} q+18 p^{4} r^{3}+58 p^{4} r^{2}+62 p^{4} r+22 p^{4}+12 p^{3} q r^{3}+36 p^{3} q r^{2}+36 p^{3} q r+10 p^{3} q+28 p^{3} r^{3}+98 p^{3} r^{2}+112 p^{3} r+42 p^{3}+11 p^{2} q r^{3}+36 p^{2} q r^{2}+36 p^{2} q r+12 p^{2} q+16 p^{2} r^{3}+66 p^{2} r^{2}+84 p^{2} r+33 p^{2}+4 p q^{3} r^{3}+12 p q^{3} r^{2}+12 p q^{3} r+4 p q^{3}+p q^{2} r^{3}+9 p q^{2} r^{2}+9 p q^{2} r+2 p q^{2}+4 p r^{3}+p r^{2}+4 q^{4} r^{3}+12 q^{4} r^{2}+12 q^{4} r+4 q^{4}+14 q^{3} r^{3}+46 q^{3} r^{2}+50 q^{3} r+18 q^{3}+9 q^{2} r^{3}+36 q^{2} r^{2}+43 q^{2} r+16 q^{2}+q r^{3}+10 r^{3}+11 r^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1/(1+s),b\to 1+t,c\to 1/(1+u)$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 s^{5} t^{4} u^{3} + 12 s^{5} t^{4} u^{2} + 12 s^{5} t^{4} u + 4 s^{5} t^{4} + 10 s^{5} t^{3} u^{3} + 34 s^{5} t^{3} u^{2} + 38 s^{5} t^{3} u + 14 s^{5} t^{3} + 6 s^{5} t^{2} u^{3} + 27 s^{5} t^{2} u^{2} + 36 s^{5} t^{2} u + 15 s^{5} t^{2} + 8 s^{5} t u^{3} + 18 s^{5} t u^{2} + 16 s^{5} t u + 6 s^{5} t + 8 s^{5} u^{3} + 24 s^{5} u^{2} + 22 s^{5} u + 10 s^{5} + 20 s^{4} t^{4} u^{3} + 60 s^{4} t^{4} u^{2} + 60 s^{4} t^{4} u + 20 s^{4} t^{4} + 54 s^{4} t^{3} u^{3} + 182 s^{4} t^{3} u^{2} + 202 s^{4} t^{3} u + 74 s^{4} t^{3} + 33 s^{4} t^{2} u^{3} + 144 s^{4} t^{2} u^{2} + 189 s^{4} t^{2} u + 78 s^{4} t^{2} + 34 s^{4} t u^{3} + 72 s^{4} t u^{2} + 62 s^{4} t u + 24 s^{4} t + 44 s^{4} u^{3} + 114 s^{4} u^{2} + 90 s^{4} u + 40 s^{4} + 40 s^{3} t^{4} u^{3} + 120 s^{3} t^{4} u^{2} + 120 s^{3} t^{4} u + 40 s^{3} t^{4} + 116 s^{3} t^{3} u^{3} + 388 s^{3} t^{3} u^{2} + 428 s^{3} t^{3} u + 156 s^{3} t^{3} + 72 s^{3} t^{2} u^{3} + 306 s^{3} t^{2} u^{2} + 396 s^{3} t^{2} u + 162 s^{3} t^{2} + 56 s^{3} t u^{3} + 108 s^{3} t u^{2} + 88 s^{3} t u + 36 s^{3} t + 96 s^{3} u^{3} + 216 s^{3} u^{2} + 140 s^{3} u + 60 s^{3} + 40 s^{2} t^{4} u^{3} + 120 s^{2} t^{4} u^{2} + 120 s^{2} t^{4} u + 40 s^{2} t^{4} + 124 s^{2} t^{3} u^{3} + 412 s^{2} t^{3} u^{2} + 452 s^{2} t^{3} u + 164 s^{2} t^{3} + 78 s^{2} t^{2} u^{3} + 324 s^{2} t^{2} u^{2} + 414 s^{2} t^{2} u + 168 s^{2} t^{2} + 40 s^{2} t u^{3} + 60 s^{2} t u^{2} + 40 s^{2} t u + 20 s^{2} t + 100 s^{2} u^{3} + 190 s^{2} u^{2} + 84 s^{2} u + 34 s^{2} + 20 s t^{4} u^{3} + 60 s t^{4} u^{2} + 60 s t^{4} u + 20 s t^{4} + 66 s t^{3} u^{3} + 218 s t^{3} u^{2} + 238 s t^{3} u + 86 s t^{3} + 42 s t^{2} u^{3} + 171 s t^{2} u^{2} + 216 s t^{2} u + 87 s t^{2} + 12 s t u^{3} + 6 s t u^{2} - 4 s t u + 2 s t + 46 s u^{3} + 66 s u^{2} + 4 t^{4} u^{3} + 12 t^{4} u^{2} + 12 t^{4} u + 4 t^{4} + 14 t^{3} u^{3} + 46 t^{3} u^{2} + 50 t^{3} u + 18 t^{3} + 9 t^{2} u^{3} + 36 t^{2} u^{2} + 45 t^{2} u + 18 t^{2} + 2 t u^{3} - 2 t u + 10 u^{3} + 14 u^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$4 s t u \le s^{2} u^{2}+2 s t^{2}+u^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$2 t u \le t^{2}+u^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 s^{5} t^{4} u^{3}+12 s^{5} t^{4} u^{2}+12 s^{5} t^{4} u+4 s^{5} t^{4}+10 s^{5} t^{3} u^{3}+34 s^{5} t^{3} u^{2}+38 s^{5} t^{3} u+14 s^{5} t^{3}+6 s^{5} t^{2} u^{3}+27 s^{5} t^{2} u^{2}+36 s^{5} t^{2} u+15 s^{5} t^{2}+8 s^{5} t u^{3}+18 s^{5} t u^{2}+16 s^{5} t u+6 s^{5} t+8 s^{5} u^{3}+24 s^{5} u^{2}+22 s^{5} u+10 s^{5}+20 s^{4} t^{4} u^{3}+60 s^{4} t^{4} u^{2}+60 s^{4} t^{4} u+20 s^{4} t^{4}+54 s^{4} t^{3} u^{3}+182 s^{4} t^{3} u^{2}+202 s^{4} t^{3} u+74 s^{4} t^{3}+33 s^{4} t^{2} u^{3}+144 s^{4} t^{2} u^{2}+189 s^{4} t^{2} u+78 s^{4} t^{2}+34 s^{4} t u^{3}+72 s^{4} t u^{2}+62 s^{4} t u+24 s^{4} t+44 s^{4} u^{3}+114 s^{4} u^{2}+90 s^{4} u+40 s^{4}+40 s^{3} t^{4} u^{3}+120 s^{3} t^{4} u^{2}+120 s^{3} t^{4} u+40 s^{3} t^{4}+116 s^{3} t^{3} u^{3}+388 s^{3} t^{3} u^{2}+428 s^{3} t^{3} u+156 s^{3} t^{3}+72 s^{3} t^{2} u^{3}+306 s^{3} t^{2} u^{2}+396 s^{3} t^{2} u+162 s^{3} t^{2}+56 s^{3} t u^{3}+108 s^{3} t u^{2}+88 s^{3} t u+36 s^{3} t+96 s^{3} u^{3}+216 s^{3} u^{2}+140 s^{3} u+60 s^{3}+40 s^{2} t^{4} u^{3}+120 s^{2} t^{4} u^{2}+120 s^{2} t^{4} u+40 s^{2} t^{4}+124 s^{2} t^{3} u^{3}+412 s^{2} t^{3} u^{2}+452 s^{2} t^{3} u+164 s^{2} t^{3}+78 s^{2} t^{2} u^{3}+324 s^{2} t^{2} u^{2}+414 s^{2} t^{2} u+168 s^{2} t^{2}+40 s^{2} t u^{3}+60 s^{2} t u^{2}+40 s^{2} t u+20 s^{2} t+100 s^{2} u^{3}+189 s^{2} u^{2}+84 s^{2} u+34 s^{2}+20 s t^{4} u^{3}+60 s t^{4} u^{2}+60 s t^{4} u+20 s t^{4}+66 s t^{3} u^{3}+218 s t^{3} u^{2}+238 s t^{3} u+86 s t^{3}+42 s t^{2} u^{3}+171 s t^{2} u^{2}+216 s t^{2} u+85 s t^{2}+12 s t u^{3}+6 s t u^{2}+2 s t+46 s u^{3}+66 s u^{2}+4 t^{4} u^{3}+12 t^{4} u^{2}+12 t^{4} u+4 t^{4}+14 t^{3} u^{3}+46 t^{3} u^{2}+50 t^{3} u+18 t^{3}+9 t^{2} u^{3}+36 t^{2} u^{2}+45 t^{2} u+17 t^{2}+2 t u^{3}+10 u^{3}+12 u^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1+v,b\to 1/(1+w),c\to 1/(1+x)$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $4 v^{5} w^{4} x^{3} + 12 v^{5} w^{4} x^{2} + 12 v^{5} w^{4} x + 4 v^{5} w^{4} + 16 v^{5} w^{3} x^{3} + 48 v^{5} w^{3} x^{2} + 48 v^{5} w^{3} x + 16 v^{5} w^{3} + 24 v^{5} w^{2} x^{3} + 72 v^{5} w^{2} x^{2} + 72 v^{5} w^{2} x + 24 v^{5} w^{2} + 16 v^{5} w x^{3} + 48 v^{5} w x^{2} + 48 v^{5} w x + 16 v^{5} w + 4 v^{5} x^{3} + 12 v^{5} x^{2} + 12 v^{5} x + 4 v^{5} + 14 v^{4} w^{4} x^{3} + 46 v^{4} w^{4} x^{2} + 50 v^{4} w^{4} x + 18 v^{4} w^{4} + 60 v^{4} w^{3} x^{3} + 196 v^{4} w^{3} x^{2} + 212 v^{4} w^{3} x + 76 v^{4} w^{3} + 96 v^{4} w^{2} x^{3} + 312 v^{4} w^{2} x^{2} + 336 v^{4} w^{2} x + 120 v^{4} w^{2} + 68 v^{4} w x^{3} + 220 v^{4} w x^{2} + 236 v^{4} w x + 84 v^{4} w + 18 v^{4} x^{3} + 58 v^{4} x^{2} + 62 v^{4} x + 22 v^{4} + 16 v^{3} w^{4} x^{3} + 62 v^{3} w^{4} x^{2} + 76 v^{3} w^{4} x + 30 v^{3} w^{4} + 76 v^{3} w^{3} x^{3} + 284 v^{3} w^{3} x^{2} + 340 v^{3} w^{3} x + 132 v^{3} w^{3} + 132 v^{3} w^{2} x^{3} + 480 v^{3} w^{2} x^{2} + 564 v^{3} w^{2} x + 216 v^{3} w^{2} + 100 v^{3} w x^{3} + 356 v^{3} w x^{2} + 412 v^{3} w x + 156 v^{3} w + 28 v^{3} x^{3} + 98 v^{3} x^{2} + 112 v^{3} x + 42 v^{3} + 4 v^{2} w^{4} x^{3} + 30 v^{2} w^{4} x^{2} + 48 v^{2} w^{4} x + 22 v^{2} w^{4} + 28 v^{2} w^{3} x^{3} + 156 v^{2} w^{3} x^{2} + 228 v^{2} w^{3} x + 100 v^{2} w^{3} + 60 v^{2} w^{2} x^{3} + 288 v^{2} w^{2} x^{2} + 396 v^{2} w^{2} x + 168 v^{2} w^{2} + 52 v^{2} w x^{3} + 228 v^{2} w x^{2} + 300 v^{2} w x + 124 v^{2} w + 16 v^{2} x^{3} + 66 v^{2} x^{2} + 84 v^{2} x + 34 v^{2} + 5 v w^{4} x^{3} + 7 v w^{4} x^{2} + 3 v w^{4} x + v w^{4} + 24 v w^{3} x^{3} + 40 v w^{3} x^{2} + 24 v w^{3} x + 8 v w^{3} + 33 v w^{2} x^{3} + 51 v w^{2} x^{2} + 27 v w^{2} x + 9 v w^{2} + 18 v w x^{3} + 22 v w x^{2} + 6 v w x + 2 v w + 4 v x^{3} + 4 v x^{2} + 7 w^{4} x^{3} + 16 w^{4} x^{2} + 9 w^{4} x + 4 w^{4} + 38 w^{3} x^{3} + 82 w^{3} x^{2} + 46 w^{3} x + 18 w^{3} + 63 w^{2} x^{3} + 120 w^{2} x^{2} + 51 w^{2} x + 18 w^{2} + 38 w x^{3} + 56 w x^{2} + 2 w x + 10 x^{3} + 14 x^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 v^{5} w^{4} x^{3}+16 v^{5} w^{3} x^{3}+24 v^{5} w^{2} x^{3}+16 v^{5} w x^{3}+4 v^{5} x^{3}+14 v^{4} w^{4} x^{3}+60 v^{4} w^{3} x^{3}+96 v^{4} w^{2} x^{3}+68 v^{4} w x^{3}+18 v^{4} x^{3}+16 v^{3} w^{4} x^{3}+76 v^{3} w^{3} x^{3}+132 v^{3} w^{2} x^{3}+100 v^{3} w x^{3}+28 v^{3} x^{3}+4 v^{2} w^{4} x^{3}+28 v^{2} w^{3} x^{3}+60 v^{2} w^{2} x^{3}+52 v^{2} w x^{3}+16 v^{2} x^{3}+5 v w^{4} x^{3}+24 v w^{3} x^{3}+33 v w^{2} x^{3}+18 v w x^{3}+4 v x^{3}+7 w^{4} x^{3}+38 w^{3} x^{3}+63 w^{2} x^{3}+38 w x^{3}+10 x^{3}+12 v^{5} w^{4} x^{2}+48 v^{5} w^{3} x^{2}+72 v^{5} w^{2} x^{2}+48 v^{5} w x^{2}+12 v^{5} x^{2}+46 v^{4} w^{4} x^{2}+196 v^{4} w^{3} x^{2}+312 v^{4} w^{2} x^{2}+220 v^{4} w x^{2}+58 v^{4} x^{2}+62 v^{3} w^{4} x^{2}+284 v^{3} w^{3} x^{2}+480 v^{3} w^{2} x^{2}+356 v^{3} w x^{2}+98 v^{3} x^{2}+30 v^{2} w^{4} x^{2}+156 v^{2} w^{3} x^{2}+288 v^{2} w^{2} x^{2}+228 v^{2} w x^{2}+66 v^{2} x^{2}+7 v w^{4} x^{2}+40 v w^{3} x^{2}+51 v w^{2} x^{2}+22 v w x^{2}+4 v x^{2}+16 w^{4} x^{2}+82 w^{3} x^{2}+120 w^{2} x^{2}+56 w x^{2}+14 x^{2}+12 v^{5} w^{4} x+48 v^{5} w^{3} x+72 v^{5} w^{2} x+48 v^{5} w x+12 v^{5} x+50 v^{4} w^{4} x+212 v^{4} w^{3} x+336 v^{4} w^{2} x+236 v^{4} w x+62 v^{4} x+76 v^{3} w^{4} x+340 v^{3} w^{3} x+564 v^{3} w^{2} x+412 v^{3} w x+112 v^{3} x+48 v^{2} w^{4} x+228 v^{2} w^{3} x+396 v^{2} w^{2} x+300 v^{2} w x+84 v^{2} x+3 v w^{4} x+24 v w^{3} x+27 v w^{2} x+6 v w x+9 w^{4} x+46 w^{3} x+51 w^{2} x+2 w x+4 v^{5} w^{4}+16 v^{5} w^{3}+24 v^{5} w^{2}+16 v^{5} w+4 v^{5}+18 v^{4} w^{4}+76 v^{4} w^{3}+120 v^{4} w^{2}+84 v^{4} w+22 v^{4}+30 v^{3} w^{4}+132 v^{3} w^{3}+216 v^{3} w^{2}+156 v^{3} w+42 v^{3}+22 v^{2} w^{4}+100 v^{2} w^{3}+168 v^{2} w^{2}+124 v^{2} w+34 v^{2}+v w^{4}+8 v w^{3}+9 v w^{2}+2 v w+4 w^{4}+18 w^{3}+18 w^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+_______________________ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to 1/(1+y),b\to 1/(1+z),c\to 1/(1+a_{1})$ +
+ +
+ +
+ +
+ + + + +
+Numerator after substitutions: $10 a_{1}^{3} y^{5} z^{3} + 30 a_{1}^{3} y^{5} z^{2} + 24 a_{1}^{3} y^{5} z + 8 a_{1}^{3} y^{5} + 9 a_{1}^{3} y^{4} z^{4} + 86 a_{1}^{3} y^{4} z^{3} + 195 a_{1}^{3} y^{4} z^{2} + 142 a_{1}^{3} y^{4} z + 44 a_{1}^{3} y^{4} + 36 a_{1}^{3} y^{3} z^{4} + 244 a_{1}^{3} y^{3} z^{3} + 480 a_{1}^{3} y^{3} z^{2} + 328 a_{1}^{3} y^{3} z + 96 a_{1}^{3} y^{3} + 54 a_{1}^{3} y^{2} z^{4} + 312 a_{1}^{3} y^{2} z^{3} + 558 a_{1}^{3} y^{2} z^{2} + 360 a_{1}^{3} y^{2} z + 100 a_{1}^{3} y^{2} + 30 a_{1}^{3} y z^{4} + 166 a_{1}^{3} y z^{3} + 282 a_{1}^{3} y z^{2} + 172 a_{1}^{3} y z + 46 a_{1}^{3} y + 7 a_{1}^{3} z^{4} + 38 a_{1}^{3} z^{3} + 63 a_{1}^{3} z^{2} + 38 a_{1}^{3} z + 10 a_{1}^{3} + 11 a_{1}^{2} y^{5} z^{4} + 62 a_{1}^{2} y^{5} z^{3} + 117 a_{1}^{2} y^{5} z^{2} + 78 a_{1}^{2} y^{5} z + 24 a_{1}^{2} y^{5} + 64 a_{1}^{2} y^{4} z^{4} + 346 a_{1}^{2} y^{4} z^{3} + 612 a_{1}^{2} y^{4} z^{2} + 384 a_{1}^{2} y^{4} z + 114 a_{1}^{2} y^{4} + 146 a_{1}^{2} y^{3} z^{4} + 764 a_{1}^{2} y^{3} z^{3} + 1278 a_{1}^{2} y^{3} z^{2} + 756 a_{1}^{2} y^{3} z + 216 a_{1}^{2} y^{3} + 162 a_{1}^{2} y^{2} z^{4} + 816 a_{1}^{2} y^{2} z^{3} + 1284 a_{1}^{2} y^{2} z^{2} + 700 a_{1}^{2} y^{2} z + 190 a_{1}^{2} y^{2} + 73 a_{1}^{2} y z^{4} + 370 a_{1}^{2} y z^{3} + 549 a_{1}^{2} y z^{2} + 258 a_{1}^{2} y z + 66 a_{1}^{2} y + 16 a_{1}^{2} z^{4} + 82 a_{1}^{2} z^{3} + 120 a_{1}^{2} z^{2} + 56 a_{1}^{2} z + 14 a_{1}^{2} + 16 a_{1} y^{5} z^{4} + 74 a_{1} y^{5} z^{3} + 120 a_{1} y^{5} z^{2} + 72 a_{1} y^{5} z + 22 a_{1} y^{5} + 75 a_{1} y^{4} z^{4} + 350 a_{1} y^{4} z^{3} + 543 a_{1} y^{4} z^{2} + 298 a_{1} y^{4} z + 90 a_{1} y^{4} + 140 a_{1} y^{3} z^{4} + 660 a_{1} y^{3} z^{3} + 972 a_{1} y^{3} z^{2} + 472 a_{1} y^{3} z + 140 a_{1} y^{3} + 126 a_{1} y^{2} z^{4} + 592 a_{1} y^{2} z^{3} + 798 a_{1} y^{2} z^{2} + 296 a_{1} y^{2} z + 84 a_{1} y^{2} + 42 a_{1} y z^{4} + 206 a_{1} y z^{3} + 228 a_{1} y z^{2} + 4 a_{1} y z + 9 a_{1} z^{4} + 46 a_{1} z^{3} + 51 a_{1} z^{2} + 2 a_{1} z + 9 y^{5} z^{4} + 38 y^{5} z^{3} + 57 y^{5} z^{2} + 34 y^{5} z + 10 y^{5} + 40 y^{4} z^{4} + 170 y^{4} z^{3} + 246 y^{4} z^{2} + 136 y^{4} z + 40 y^{4} + 70 y^{3} z^{4} + 300 y^{3} z^{3} + 414 y^{3} z^{2} + 204 y^{3} z + 60 y^{3} + 58 y^{2} z^{4} + 248 y^{2} z^{3} + 312 y^{2} z^{2} + 116 y^{2} z + 34 y^{2} + 19 y z^{4} + 82 y z^{3} + 81 y z^{2} - 2 y z + 4 z^{4} + 18 z^{3} + 18 z^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$2 y z \le y^{2}+z^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 11 a_{1}^{2} y^{5} z^{4}+16 a_{1} y^{5} z^{4}+9 y^{5} z^{4}+10 a_{1}^{3} y^{5} z^{3}+62 a_{1}^{2} y^{5} z^{3}+74 a_{1} y^{5} z^{3}+38 y^{5} z^{3}+30 a_{1}^{3} y^{5} z^{2}+117 a_{1}^{2} y^{5} z^{2}+120 a_{1} y^{5} z^{2}+57 y^{5} z^{2}+24 a_{1}^{3} y^{5} z+78 a_{1}^{2} y^{5} z+72 a_{1} y^{5} z+34 y^{5} z+8 a_{1}^{3} y^{5}+24 a_{1}^{2} y^{5}+22 a_{1} y^{5}+10 y^{5}+9 a_{1}^{3} y^{4} z^{4}+64 a_{1}^{2} y^{4} z^{4}+75 a_{1} y^{4} z^{4}+40 y^{4} z^{4}+86 a_{1}^{3} y^{4} z^{3}+346 a_{1}^{2} y^{4} z^{3}+350 a_{1} y^{4} z^{3}+170 y^{4} z^{3}+195 a_{1}^{3} y^{4} z^{2}+612 a_{1}^{2} y^{4} z^{2}+543 a_{1} y^{4} z^{2}+246 y^{4} z^{2}+142 a_{1}^{3} y^{4} z+384 a_{1}^{2} y^{4} z+298 a_{1} y^{4} z+136 y^{4} z+44 a_{1}^{3} y^{4}+114 a_{1}^{2} y^{4}+90 a_{1} y^{4}+40 y^{4}+36 a_{1}^{3} y^{3} z^{4}+146 a_{1}^{2} y^{3} z^{4}+140 a_{1} y^{3} z^{4}+70 y^{3} z^{4}+244 a_{1}^{3} y^{3} z^{3}+764 a_{1}^{2} y^{3} z^{3}+660 a_{1} y^{3} z^{3}+300 y^{3} z^{3}+480 a_{1}^{3} y^{3} z^{2}+1278 a_{1}^{2} y^{3} z^{2}+972 a_{1} y^{3} z^{2}+414 y^{3} z^{2}+328 a_{1}^{3} y^{3} z+756 a_{1}^{2} y^{3} z+472 a_{1} y^{3} z+204 y^{3} z+96 a_{1}^{3} y^{3}+216 a_{1}^{2} y^{3}+140 a_{1} y^{3}+60 y^{3}+54 a_{1}^{3} y^{2} z^{4}+162 a_{1}^{2} y^{2} z^{4}+126 a_{1} y^{2} z^{4}+58 y^{2} z^{4}+312 a_{1}^{3} y^{2} z^{3}+816 a_{1}^{2} y^{2} z^{3}+592 a_{1} y^{2} z^{3}+248 y^{2} z^{3}+558 a_{1}^{3} y^{2} z^{2}+1284 a_{1}^{2} y^{2} z^{2}+798 a_{1} y^{2} z^{2}+312 y^{2} z^{2}+360 a_{1}^{3} y^{2} z+700 a_{1}^{2} y^{2} z+296 a_{1} y^{2} z+116 y^{2} z+100 a_{1}^{3} y^{2}+190 a_{1}^{2} y^{2}+84 a_{1} y^{2}+33 y^{2}+30 a_{1}^{3} y z^{4}+73 a_{1}^{2} y z^{4}+42 a_{1} y z^{4}+19 y z^{4}+166 a_{1}^{3} y z^{3}+370 a_{1}^{2} y z^{3}+206 a_{1} y z^{3}+82 y z^{3}+282 a_{1}^{3} y z^{2}+549 a_{1}^{2} y z^{2}+228 a_{1} y z^{2}+81 y z^{2}+172 a_{1}^{3} y z+258 a_{1}^{2} y z+4 a_{1} y z+46 a_{1}^{3} y+66 a_{1}^{2} y+7 a_{1}^{3} z^{4}+16 a_{1}^{2} z^{4}+9 a_{1} z^{4}+4 z^{4}+38 a_{1}^{3} z^{3}+82 a_{1}^{2} z^{3}+46 a_{1} z^{3}+18 z^{3}+63 a_{1}^{3} z^{2}+120 a_{1}^{2} z^{2}+51 a_{1} z^{2}+17 z^{2}+38 a_{1}^{3} z+56 a_{1}^{2} z+2 a_{1} z+10 a_{1}^{3}+14 a_{1}^{2} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[23]:
+ + + + +
+
Counter({0: 8})
+
+ +
+ +
+
+ +
+
+
+
+

Now let's take a look at slightly another kind of the problem.

+

Problem

Let $f:R^3\to R$ be a convex function. Prove that +$$f(1,2,3)+f(2,3,1)+f(3,1,2)\le f(4,3,-1)+f(3,-1,4)+f(-1,4,3).$$

+

To create a proof, we will use provef function. It assumes that $f$ is convex and nonnegative, then it tries to find a proof. However, if the last inequality is $0\le 0$, then the proof works for any convex function.

+ +
+
+
+
+
+
In [24]:
+
+
+
provef('(-f(1,2,3)-f(2,3,1)-f(3,1,2)+f(4,3,-1)+f(3,-1,4)+f(-1,4,3))*21')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+numerator: $21 f{\left(-1,4,3 \right)} - 21 f{\left(1,2,3 \right)} - 21 f{\left(2,3,1 \right)} + 21 f{\left(3,-1,4 \right)} - 21 f{\left(3,1,2 \right)} + 21 f{\left(4,3,-1 \right)}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $1$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From Jensen inequality: +
+ +
+ +
+ +
+ + + + +
+$$21f(1, 2, 3) \le 11f(-1, 4, 3)+8f(3, -1, 4)+2f(4, 3, -1)$$ +
+ +
+ +
+ +
+ + + + +
+$$21f(2, 3, 1) \le 8f(-1, 4, 3)+2f(3, -1, 4)+11f(4, 3, -1)$$ +
+ +
+ +
+ +
+ + + + +
+$$21f(3, 1, 2) \le 2f(-1, 4, 3)+11f(3, -1, 4)+8f(4, 3, -1)$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 0 $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[24]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

Let's try to solve problem 6 from the finals of LXIII Polish Mathematical Olympiad. It was one of the hardest inequality in the history of this contest, solved only by 3 finalists.

+

Problem

Prove the inequality +$$\left(\frac{a - b}{c}\right)^2 + \left(\frac{b - c}{a}\right)^2 + \left(\frac{c - a}{b}\right)^2\ge 2 \sqrt{2} \left(\frac{a - b}{c} + \frac{b - c}{a}+ \frac{c-a}{b}\right)$$ +for any positive numbers $a,b,c$.

+

The first observation is that the formula is cyclic, so without loss of generality we may assume that $a\ge b,c$. We can go a step further and divide it into two cases: $a\ge b\ge c$ and $a\ge c\ge b$.

+ +
+
+
+
+
+
In [25]:
+
+
+
shiro.display=lambda x:None #turn off printing of proofs
+newproof()
+formula=cyclize('((a-b)/c)^2-2*sqrt(2)*(a-b)/c')
+
+ +
+
+
+ +
+
+
+
In [26]:
+
+
+
formula1=makesubs(formula,'[b,oo],[c,oo]',variables='a,b') #a>=b>=c
+prove(formula1) 
+
+ +
+
+
+ +
+
+ + +
+ +
Out[26]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
In [27]:
+
+
+
formula2=makesubs(formula,'[c,oo],[b,oo]',variables='a,c') #a>=c>=b
+prove(formula2) 
+
+ +
+
+
+ +
+
+ + +
+ +
Out[27]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

So the case $a\ge c\ge b$ is done, but $a\ge b\ge c$ is not. But maybe we can adjust values.

+ +
+
+
+
+
+
In [28]:
+
+
+
values=findvalues(formula1)
+values
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
Optimization terminated successfully.
+         Current function value: 1.000000
+         Iterations: 137
+         Function evaluations: 249
+
+
+
+ +
+ +
Out[28]:
+ + + + +
+
(1.7908873553542452e-10, 2.5326984818340415e-10, 7.129450063690368)
+
+ +
+ +
+
+ +
+
+
+
+

First and second value is approximately equal to 0, so we can try to replace 0 with 1.

+ +
+
+
+
+
+
In [29]:
+
+
+
prove(formula1,values='1,1,7')
+
+ +
+
+
+ +
+
+ + +
+ +
Out[29]:
+ + + + +
+
2
+
+ +
+ +
+
+ +
+
+
+
+

The key observation is that the formula1 is homogenous, so we can scale values.

+ +
+
+
+
+
+
In [30]:
+
+
+
newvalues=(1,values[1]/values[0],values[2]/values[0])
+newvalues
+
+ +
+
+
+ +
+
+ + +
+ +
Out[30]:
+ + + + +
+
(1, 1.4142142855953455, 39809595184.05965)
+
+ +
+ +
+
+ +
+
+
+
In [31]:
+
+
+
newvalues[1]**2
+
+ +
+
+
+ +
+
+ + +
+ +
Out[31]:
+ + + + +
+
2.000002045581953
+
+ +
+ +
+
+ +
+
+
+
+

Now the third value is very big. Technically we could use it, but it would run into overflow error, so we will use 1 instead of it. Second value is very close to $\sqrt{2}$, so this value will be our next try.

+ +
+
+
+
+
+
In [32]:
+
+
+
prove(formula1,values='1,sqrt(2),1')
+
+ +
+
+
+ +
+
+ + +
+ +
Out[32]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+
+

So after getting the code all together we have got the following proof.

+ +
+
+
+
+
+
In [33]:
+
+
+
newproof()
+shiro.display=lambda x:display(Latex(x)) #turn on printing proofs 
+formula=cyclize('((a-b)/c)^2-2*sqrt(2)*(a-b)/c')
+display(Latex('Case $a\ge c\ge b$'))
+formula1=makesubs(formula,'[c,oo],[b,oo]',variables='a,c,b')
+prove(formula1)
+display(Latex('Case $a\ge b\ge c$'))
+formula2=makesubs(formula,'[b,oo],[c,oo]')
+prove(formula2,values='1,2**(1/2),1')
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+Case $a\ge c\ge b$ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to c + d$ +
+ +
+ +
+ +
+ + + + +
+Substitute $c\to b + e$ +
+ +
+ +
+ +
+ + + + +
+numerator: $2 b^{4} d^{2} + 2 b^{4} d e + 2 b^{4} e^{2} + 4 b^{3} d^{3} + 2 \sqrt{2} b^{3} d^{2} e + 10 b^{3} d^{2} e + 2 \sqrt{2} b^{3} d e^{2} + 6 b^{3} d e^{2} + 4 b^{3} e^{3} + 2 b^{2} d^{4} + 2 \sqrt{2} b^{2} d^{3} e + 10 b^{2} d^{3} e + 6 \sqrt{2} b^{2} d^{2} e^{2} + 12 b^{2} d^{2} e^{2} + 4 b^{2} d e^{3} + 4 \sqrt{2} b^{2} d e^{3} + 2 b^{2} e^{4} + 2 b d^{4} e + 2 \sqrt{2} b d^{3} e^{2} + 6 b d^{3} e^{2} + 4 b d^{2} e^{3} + 4 \sqrt{2} b d^{2} e^{3} + 2 \sqrt{2} b d e^{4} + d^{4} e^{2} + 2 d^{3} e^{3} + d^{2} e^{4}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $b^{6} + 2 b^{5} d + 4 b^{5} e + b^{4} d^{2} + 6 b^{4} d e + 6 b^{4} e^{2} + 2 b^{3} d^{2} e + 6 b^{3} d e^{2} + 4 b^{3} e^{3} + b^{2} d^{2} e^{2} + 2 b^{2} d e^{3} + b^{2} e^{4}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 2 b^{4} d^{2}+2 b^{4} d e+2 b^{4} e^{2}+4 b^{3} d^{3}+2 \sqrt{2} b^{3} d^{2} e+10 b^{3} d^{2} e+2 \sqrt{2} b^{3} d e^{2}+6 b^{3} d e^{2}+4 b^{3} e^{3}+2 b^{2} d^{4}+2 \sqrt{2} b^{2} d^{3} e+10 b^{2} d^{3} e+6 \sqrt{2} b^{2} d^{2} e^{2}+12 b^{2} d^{2} e^{2}+4 \sqrt{2} b^{2} d e^{3}+4 b^{2} d e^{3}+2 b^{2} e^{4}+2 b d^{4} e+2 \sqrt{2} b d^{3} e^{2}+6 b d^{3} e^{2}+4 \sqrt{2} b d^{2} e^{3}+4 b d^{2} e^{3}+2 \sqrt{2} b d e^{4}+d^{4} e^{2}+2 d^{3} e^{3}+d^{2} e^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
+ + + + +
+Case $a\ge b\ge c$ +
+ +
+ +
+ +
+ + + + +
+Substitute $a\to b + f$ +
+ +
+ +
+ +
+ + + + +
+Substitute $b\to c + g$ +
+ +
+ +
+ +
+ + + + +
+Substitute $f\to \sqrt{2} h$ +
+ +
+ +
+ +
+ + + + +
+numerator: $2 c^{4} g^{2} + 2 \sqrt{2} c^{4} g h + 4 c^{4} h^{2} + 4 c^{3} g^{3} - 4 c^{3} g^{2} h + 6 \sqrt{2} c^{3} g^{2} h - 4 \sqrt{2} c^{3} g h^{2} + 20 c^{3} g h^{2} + 8 \sqrt{2} c^{3} h^{3} + 2 c^{2} g^{4} - 8 c^{2} g^{3} h + 4 \sqrt{2} c^{2} g^{3} h - 12 \sqrt{2} c^{2} g^{2} h^{2} + 24 c^{2} g^{2} h^{2} - 8 c^{2} g h^{3} + 20 \sqrt{2} c^{2} g h^{3} + 8 c^{2} h^{4} - 4 c g^{4} h - 8 \sqrt{2} c g^{3} h^{2} + 8 c g^{3} h^{2} - 8 c g^{2} h^{3} + 12 \sqrt{2} c g^{2} h^{3} + 8 c g h^{4} + 2 g^{4} h^{2} + 4 \sqrt{2} g^{3} h^{3} + 4 g^{2} h^{4}$ +
+ +
+ +
+ +
+ + + + +
+denominator: $c^{6} + 4 c^{5} g + 2 \sqrt{2} c^{5} h + 6 c^{4} g^{2} + 6 \sqrt{2} c^{4} g h + 2 c^{4} h^{2} + 4 c^{3} g^{3} + 6 \sqrt{2} c^{3} g^{2} h + 4 c^{3} g h^{2} + c^{2} g^{4} + 2 \sqrt{2} c^{2} g^{3} h + 2 c^{2} g^{2} h^{2}$ +
+ +
+ +
+ +
+ + + + +
+status: 0 +
+ +
+ +
+ +
+ + + + +
+From weighted AM-GM inequality: +
+ +
+ +
+ +
+ + + + +
+$$4 c^{3} g^{2} h \le 2 c^{4} g^{2}+2 c^{2} g^{2} h^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$4 \sqrt{2} c^{3} g h^{2} \le 2 \sqrt{2} c^{4} g h+\sqrt{2} c^{3} h^{3}+\sqrt{2} c g^{2} h^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$8 c^{2} g^{3} h \le 4 c^{3} g^{3}+4 c g^{3} h^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$12 \sqrt{2} c^{2} g^{2} h^{2} \le 6 \sqrt{2} c^{3} g^{2} h+6 \sqrt{2} c g^{2} h^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$8 c^{2} g h^{3} \le 4 c^{3} g h^{2}+2 c^{2} h^{4}+2 g^{2} h^{4}$$ +
+ +
+ +
+ +
+ + + + +
+$$4 c g^{4} h \le 2 c^{2} g^{4}+2 g^{4} h^{2}$$ +
+ +
+ +
+ +
+ + + + +
+$$8 \sqrt{2} c g^{3} h^{2} \le 4 \sqrt{2} c^{2} g^{3} h+4 \sqrt{2} g^{3} h^{3}$$ +
+ +
+ +
+ +
+ + + + +
+$$8 c g^{2} h^{3} \le 4 c g^{3} h^{2}+4 c g h^{4}$$ +
+ +
+ +
+ +
+ + + + +
+$$ 0 \le 4 c^{4} h^{2}+16 c^{3} g h^{2}+7 \sqrt{2} c^{3} h^{3}+22 c^{2} g^{2} h^{2}+20 \sqrt{2} c^{2} g h^{3}+6 c^{2} h^{4}+5 \sqrt{2} c g^{2} h^{3}+4 c g h^{4}+2 g^{2} h^{4} $$ +
+ +
+ +
+ +
+ + + + +
+The sum of all inequalities gives us a proof of the inequality. +
+ +
+ +
+ +
Out[33]:
+ + + + +
+
0
+
+ +
+ +
+
+ +
+
+
+ + + + + + diff --git a/examples.ipynb b/examples.ipynb index 4e27353..7453a7b 100644 --- a/examples.ipynb +++ b/examples.ipynb @@ -2556,6 +2556,9 @@ ], "source": [ "newproof()\n", + "#this is equivalent to\n", + "#prove(makesubs('(x-1)^4','[1,oo]'))\n", + "#prove(makesubs('(x-1)^4','[-oo,1]'))\n", "powerprove('(x-1)^4')" ] }, @@ -3406,6 +3409,15 @@ "source": [ "newproof()\n", "formula=Sm('-(3a + 2b + c)(2a^3 + 3b^2 + 6c + 1) + (4a + 4b + 4c)(a^4 + b^3 + c^2 + 3)')\n", + "#this is equivalent to\n", + "#prove(makesubs(formula,'[1,oo],[1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[-1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[-1,oo],[1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[1,oo],[-1,oo],[-1,oo]'))\n", + "#prove(makesubs(formula,'[-1,oo],[-1,oo],[-1,oo]'))\n", "powerprove(formula)" ] }, diff --git a/examples.pdf b/examples.pdf deleted file mode 100644 index f90f158..0000000 Binary files a/examples.pdf and /dev/null differ diff --git a/statistics.html b/statistics.html new file mode 100644 index 0000000..ddc8fb4 --- /dev/null +++ b/statistics.html @@ -0,0 +1,14995 @@ + + + + +statistics + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+

In this notebook several methods for proving inequalities have been compared.

+

First of all we need a dataset. 35 inequalities were selected from https://www.imomath.com/index.php?options=592&lmm=0. Each inequality is represented by a tuple: inequality (in LaTeX), inequality constraints (for example: $a\in [0,1]$, equality constraints (for example: $abc=1$) and a function which converts inequality to a formula which we want to prove it's nonnegativity. In most cases when this function is simply a difference between left and right-hand side, but sometimes it's better to use difference between squares of sides (to get rid of square roots). These tuples are used as parameters in parser function which converts them to equivalent inequalities with default constraints (i.e. all variables are positive).

+

Some tuples have less than 4 elements. In this case parser use default arguments.

+ +
+
+
+
+
+
In [1]:
+
+
+
from sympy import *
+import shiroindev
+from shiroindev import *
+from sympy.parsing.latex import parse_latex
+shiro.seed=1
+from IPython.display import Latex
+shiro.display=lambda x:display(Latex(x))
+
+ +
+
+
+ +
+
+
+
+

sympy has a parse_latex function which converts LaTeX formula to a sympy one. Unfortunately it doesn't deal with missing braces in the way that LaTeX do. For example \frac12 generates $\frac12$ which is the same as \frac{1}{2}, but parse_latex accepts only the second version. So here there is a boring function which adds missing braces.

+ +
+
+
+
+
+
In [2]:
+
+
+
def addbraces(s):
+    arg={r'\frac':2,r'\sqrt':1}
+    s2=''
+    p=0
+    while 1:
+        m=re.search(r"\\[a-zA-Z]+", s[p:])
+        if not m:
+            break
+        s2+=s[p:p+m.end()]
+        p+=m.end()
+        if m.group() in arg:
+            for i in range(arg[m.group()]):
+                sp=re.search('^ *',s[p:])
+                s2+=sp.group()
+                p+=sp.end()
+                if s[p]=='{':
+                    cb=re.search(r'^\{.*?\}',s[p:])
+                    ab=addbraces(cb.group())
+                    s2+=ab
+                    p+=cb.end()
+                else:
+                    s2+='{'+s[p]+'}'
+                    p+=1
+    s2+=s[p:]
+    return s2
+print(addbraces(r'\frac{ \sqrt 3}2'))
+print(addbraces(r'a^2+b^2+c^2\geq ab+bc+ca'))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
\frac{ \sqrt {3}}{2}
+a^2+b^2+c^2\geq ab+bc+ca
+
+
+
+ +
+
+ +
+
+
+
In [3]:
+
+
+
#(formula,intervals,subs,function)
+dif=lambda b,s:b-s
+dif2=lambda b,s:b*b-s*s
+ineqs=[
+    (r'a^2+b^2+c^2\geq ab+bc+ca',),
+    (r'a^2+b^2+c^2+d^2\geq a(b+c+d)',),
+    (r'1\leq\frac{a^2b^2}{c^2}+\frac{b^2c^2}{a^2}+\frac{c^2a^2}{b^2}',
+     '[0,1-f],[0,1]','[a,sqrt(1-e-f)],[b,sqrt(e)],[c,sqrt(f)]',),
+    (r'\frac1{1-x^2}+\frac1{1-y^2}\geq \frac2{1-xy}','[0,1],[0,1]'),
+    (r'a^3+b^3\geq a^2b+ab^2',),
+    (r'\frac a{b+c}+\frac b{c+a}+\frac c{a+b}\geq \frac32',),
+    (r'2a^3+b^3\geq 3a^2b',),
+    (r'a^3+b^3+c^3\geq a^2b+b^2c+c^2a',),
+    (r'\frac a{b+c}+\frac b{c+d}+ \frac c{d+a}+ \frac d{a+b}\geq 2',),
+    (r'\frac{a^3}{a^2+ab+b^2}+ \frac{b^3}{b^2+bc+c^2}+ \frac{c^3}{c^2+ca+a^2} \geq \frac{a+b+c}3',),
+    (r'\sqrt{ab}+\sqrt{cd}+\sqrt{ef}\leq\sqrt{(a+c+e)(b+d+f)}','','',dif2),
+    (r'\frac{5a^3-ab^2}{a+b}+\frac{5b^3-bc^2}{b+c}+\frac{5c^3-ca^2}{c+a}\geq 2(a^2+b^2+c^2)',),
+    #(r'\frac{a^2}{(1+b)(1-c)}+\frac{b^3}{(1+c)(1-d)}+\frac{c^3}{(1+d)(1-a)}+\frac{d^3}{(1+a)(1-b)}\geq\frac1{15}',
+    # '[0,1-c-d],[0,1-d],[0,1]','[a,1-b-c-d]'),
+    (r'\frac{x^3}{(1+y)(1+z)}+\frac{y^3}{(1+z)(1+x)}+\frac{z^3}{(1+x)(1+y)}\geq\frac{3}{4}','','[z,1/(x*y)]'),
+    (r'\frac ab+\frac bc+\frac ca\geq \frac{(a+b+c)^2}{ab+bc+ca}',),
+    (r'\frac{a^2}b+\frac{b^2}c+\frac{c^2}a\geq \frac{a^2+b^2+c^2}{a+b+c}',),
+    (r'\frac{a^2}b+\frac{b^2}c+\frac{c^2}a\geq a+b+c+\frac{4(a-b)^2}{a+b+c}',),
+    (r'\frac1{a^3+b^3+abc}+ \frac1{b^3+c^3+abc} +\frac1{c^3+a^3+ abc} \leq \frac1{abc}',),
+    (r'\frac1{a^3(b+c)}+ \frac1{b^3(c+a)}+ \frac1{c^3(a+b)} \geq \frac32','','[c,1/(a*b)]'),
+    (r'\frac{a^3}{b^2-bc+c^2}+\frac{b^3}{c^2-ca+a^2} + \frac{c^3}{a^2-ab+b^2} \geq 3 \cdot\frac{ab+bc+ca}{a+b+c}',),
+    (r'\frac{x^5-x^2}{x^5+y^2+z^2}+\frac{y^5-y^2}{y^5+z^2+x^2}+\frac{z^5-z^2}{z^5+x^2+y^2}\geq0','','[x,1/(y*z)]'),
+    (r'(a+b-c)(b+c-a)(c+a-b)\leq abc',),
+    (r'\frac1{1+xy}+\frac1{1+yz}+\frac1{1+zx}\leq \frac34','','[x,(y+z)/(y*z-1)]'),
+    (r'\frac{x\sqrt x}{y+z}+\frac{y\sqrt y}{z+x}+\frac{z\sqrt z}{x+y}\geq\frac{ \sqrt 3}2',
+     '[0,1-z],[0,1]','[x,1-y-z]'),
+    (r'a^4+b^4+c^4+d^4\geq 4abcd',),
+    (r'\frac{ab}{a+b}+\frac{bc}{b+c}+\frac{ca}{c+a}\leq\frac{3(ab+bc+ca)}{2(a+b+c)}',),
+    (r'\sqrt{a-1}+\sqrt{b-1}+ \sqrt{c-1} \leq \sqrt{c(ab+1)}','[1,oo],[1,oo],[1,oo]','',dif2),
+    (r'(x-1)(y-1)(z-1)\geq 8','[0,1-b-c],[0,1-c],[0,1]','[x,1/a],[y,1/b],[z,1/c]'),
+    (r'ay+bz+cx\leq s^2','[0,s],[0,s],[0,s]','[x,s-a],[y,s-b],[z,s-c]'),
+    (r'x_1^2+x_2^2+x_3^2+x_4^2+x_5^2\geq 2 (x_1x_2+x_2x_3+x_3x_4+x_4x_5)/\sqrt{3}',),
+    (r' xy+yz+zx - 2xyz \leq \frac7{27}', '[0,1-z],[0,1]','[x,1-y-z]'),
+    (r'0 \leq xy+yz+zx - 2xyz', '[0,1-z],[0,1]','[x,1-y-z]'),
+    (r'\sqrt{3+a+b+c}\geq\sqrt a+\sqrt b+\sqrt c','[1-z,1],[0,1]','[a,1/x-1],[b,1/y-1],[c,1/z-1],[x,2-y-z]',
+     dif2),
+    (r'\frac{2a^3}{a^2+b^2}+\frac{2b^3}{b^2+c^2}+\frac{2c^3}{c^2+a^2}\geq a+b+c',),
+    (r'\frac{a^2}{b+c}+\frac{b^2}{c+a}+\frac{c^2}{a+b}\geq \frac12','[0,1-c],[0,1]','[a,1-b-c]'),
+    (r'\frac{a+b}{2b+c}+\frac{b+c}{2c+a}+\frac{c+a}{2a+b}\geq 2',),
+    #(r'\frac x{5-y^2}+\frac y{5-z^2}+\frac z{5-x^2}\geq \frac34','[0,sqrt(5)],[0,sqrt(5)]','[x,1/(y*z)]')
+]
+
+ +
+
+
+ +
+
+
+
In [4]:
+
+
+
def parser(formula,intervals='[]',subs='[]',func=dif):
+    newproof()
+    shiro.display=lambda x:None
+    if intervals=='':
+        intervals='[]'
+    if subs=='':
+        subs='[]'
+    formula=addbraces(formula)
+    formula=Sm(str(parse_latex(formula)))
+    formula,_=fractioncancel(formula)
+    formula=formula.subs(shiroindev._smakeiterable2(subs))
+    formula=makesubs(formula,intervals)
+    b,s=formula.lhs,formula.rhs
+    if type(formula)==LessThan:
+        b,s=s,b
+    formula=func(b,s)
+    formula=simplify(formula)
+    num,den=fractioncancel(formula)
+    return num
+
+ +
+
+
+ +
+
+
+
In [5]:
+
+
+
from tqdm import tqdm
+ineqs2=[]
+for ineq in tqdm(ineqs):
+    ineqs2+=[parser(*ineq)]
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
100%|██████████| 35/35 [00:46<00:00,  1.32s/it]
+
+
+
+ +
+
+ +
+
+
+
+

Now let's look at the formulas when converted to polynomials.

+ +
+
+
+
+
+
In [6]:
+
+
+
for i,ineq in zip(range(len(ineqs2)),ineqs2):
+    print(i)
+    display(reducegens(assumeall(ineq,positive=True)))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
0
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{2} - ab - ac + b^{2} - bc + c^{2}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
1
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{2} - ab - ac - ad + b^{2} + c^{2} + d^{2}, a, b, c, d, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
2
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{4}b^{2} + a^{3}b^{2} - a^{3}b - 2 a^{2}b + a^{2} + ab^{2} - ab + b^{2}, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
3
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{3}b + a^{3} - 4 a^{2}b^{2} - a^{2}b + a^{2} + 2 ab^{3} - ab^{2} - 2 ab + b^{3} + b^{2}, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
4
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3} - a^{2}b - ab^{2} + b^{3}, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
5
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{3} - a^{2}b - a^{2}c - ab^{2} - ac^{2} + 2 b^{3} - b^{2}c - bc^{2} + 2 c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
6
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{3} - 3 a^{2}b + b^{3}, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
7
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3} - a^{2}b - ac^{2} + b^{3} - b^{2}c + c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
8
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3}c + a^{3}d + a^{2}b^{2} - a^{2}bd - 2 a^{2}c^{2} - a^{2}cd + a^{2}d^{2} + ab^{3} - ab^{2}c - ab^{2}d - abc^{2} + ac^{3} - acd^{2} + b^{3}d + b^{2}c^{2} - 2 b^{2}d^{2} + bc^{3} - bc^{2}d - bcd^{2} + bd^{3} + c^{2}d^{2} + cd^{3}, a, b, c, d, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
9
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{5}b^{2} + 2 a^{5}bc + 2 a^{5}c^{2} + a^{4}b^{3} - a^{4}b^{2}c - a^{4}bc^{2} + a^{4}c^{3} + a^{3}b^{4} - 2 a^{3}b^{3}c - 4 a^{3}b^{2}c^{2} - 2 a^{3}bc^{3} + a^{3}c^{4} + 2 a^{2}b^{5} - a^{2}b^{4}c - 4 a^{2}b^{3}c^{2} - 4 a^{2}b^{2}c^{3} - a^{2}bc^{4} + 2 a^{2}c^{5} + 2 ab^{5}c - ab^{4}c^{2} - 2 ab^{3}c^{3} - ab^{2}c^{4} + 2 abc^{5} + 2 b^{5}c^{2} + b^{4}c^{3} + b^{3}c^{4} + 2 b^{2}c^{5}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
10
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( ad + af - 2 \sqrt{a}\sqrt{b}\sqrt{c}\sqrt{d} - 2 \sqrt{a}\sqrt{b}\sqrt{e}\sqrt{f} + bc + be + cf - 2 \sqrt{c}\sqrt{d}\sqrt{e}\sqrt{f} + de, \sqrt{a}, \sqrt{b}, \sqrt{c}, \sqrt{d}, \sqrt{e}, \sqrt{f}, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
11
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 3 a^{4}b + 3 a^{4}c - 2 a^{3}b^{2} + 2 a^{3}c^{2} + 2 a^{2}b^{3} - 6 a^{2}b^{2}c - 6 a^{2}bc^{2} - 2 a^{2}c^{3} + 3 ab^{4} - 6 ab^{2}c^{2} + 3 ac^{4} + 3 b^{4}c - 2 b^{3}c^{2} + 2 b^{2}c^{3} + 3 bc^{4}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
12
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 4 x^{8}y^{4} + 4 x^{7}y^{4} - 3 x^{5}y^{5} - 3 x^{5}y^{4} + 4 x^{4}y^{8} + 4 x^{4}y^{7} - 3 x^{4}y^{5} - 6 x^{4}y^{4} - 3 x^{4}y^{3} - 3 x^{3}y^{4} - 3 x^{3}y^{3} + 4 xy + 4, x, y, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
13
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3}c^{2} + a^{2}b^{3} - a^{2}b^{2}c - a^{2}bc^{2} - ab^{2}c^{2} + b^{2}c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
14
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{4}c + a^{3}c^{2} + a^{2}b^{3} + ab^{4} + b^{2}c^{3} + bc^{4}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
15
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{4}c - 4 a^{3}bc + a^{3}c^{2} + a^{2}b^{3} + 6 a^{2}b^{2}c - 2 a^{2}bc^{2} + ab^{4} - 4 ab^{3}c - 2 ab^{2}c^{2} + b^{2}c^{3} + bc^{4}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
16
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{6}b^{3} + a^{6}c^{3} - 2 a^{5}b^{2}c^{2} + a^{3}b^{6} + a^{3}c^{6} - 2 a^{2}b^{5}c^{2} - 2 a^{2}b^{2}c^{5} + b^{6}c^{3} + b^{3}c^{6}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
17
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{8}b^{8} + 2 a^{7}b^{6} + 2 a^{6}b^{7} - 3 a^{6}b^{5} - 3 a^{5}b^{6} + 2 a^{5}b^{5} - 3 a^{5}b^{3} + 2 a^{5}b^{2} - 6 a^{4}b^{4} + 2 a^{4}b^{3} + 2 a^{4} - 3 a^{3}b^{5} + 2 a^{3}b^{4} - 3 a^{3}b^{2} + 2 a^{3}b + 2 a^{2}b^{5} - 3 a^{2}b^{3} + 2 ab^{3} + 2 b^{4}, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
18
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{8} - a^{6}bc - 2 a^{5}b^{3} + a^{5}b^{2}c + a^{5}bc^{2} - 2 a^{5}c^{3} + 3 a^{4}b^{4} - a^{4}b^{3}c + 2 a^{4}b^{2}c^{2} - a^{4}bc^{3} + 3 a^{4}c^{4} - 2 a^{3}b^{5} - a^{3}b^{4}c - a^{3}b^{3}c^{2} - a^{3}b^{2}c^{3} - a^{3}bc^{4} - 2 a^{3}c^{5} + a^{2}b^{5}c + 2 a^{2}b^{4}c^{2} - a^{2}b^{3}c^{3} + 2 a^{2}b^{2}c^{4} + a^{2}bc^{5} - ab^{6}c + ab^{5}c^{2} - ab^{4}c^{3} - ab^{3}c^{4} + ab^{2}c^{5} - abc^{6} + b^{8} - 2 b^{5}c^{3} + 3 b^{4}c^{4} - 2 b^{3}c^{5} + c^{8}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
19
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( y^{18}z^{9} + 2 y^{16}z^{14} - y^{15}z^{9} + 2 y^{14}z^{16} - y^{14}z^{13} - y^{13}z^{14} - y^{13}z^{11} - y^{12}z^{12} + y^{12}z^{9} - y^{11}z^{13} - y^{11}z^{7} + 2 y^{11}z^{4} - y^{10}z^{5} + y^{9}z^{18} - y^{9}z^{15} + y^{9}z^{12} - y^{9}z^{6} - y^{8}z^{4} - y^{7}z^{11} - y^{7}z^{5} + 2 y^{7}z^{2} - y^{6}z^{9} + y^{6}z^{6} - y^{5}z^{10} - y^{5}z^{7} + 2 y^{4}z^{11} - y^{4}z^{8} - y^{3}z^{3} + 2 y^{2}z^{7} + 1, y, z, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
20
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3} - a^{2}b - a^{2}c - ab^{2} + 3 abc - ac^{2} + b^{3} - b^{2}c - bc^{2} + c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
21
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 y^{4}z^{2} - y^{3}z^{3} - 5 y^{3}z + 2 y^{2}z^{4} - 9 y^{2}z^{2} + 5 y^{2} - 5 yz^{3} + 23 yz + 5 z^{2} - 9, y, z, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
22
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{\frac{5}{2}}b\frac{1}{\sqrt{a b + a + b + 1}} + 2 a^{\frac{5}{2}}\frac{1}{\sqrt{a b + a + b + 1}} + 2 a^{2}b^{\frac{7}{2}}\frac{1}{\sqrt{b + 1}} + 2 a^{2}b^{\frac{5}{2}}\frac{1}{\sqrt{b + 1}} + 2 a^{2}b^{2}\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - a^{2}b^{2}\sqrt{3} + 2 a^{2}b\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - a^{2}b\sqrt{3} + 2 a^{\frac{3}{2}}b\frac{1}{\sqrt{a b + a + b + 1}} + 4 ab^{\frac{7}{2}}\frac{1}{\sqrt{b + 1}} + 4 ab^{\frac{5}{2}}\frac{1}{\sqrt{b + 1}} + 4 ab^{2}\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - 2 ab^{2}\sqrt{3} + 2 ab^{\frac{3}{2}}\frac{1}{\sqrt{b + 1}} + 6 ab\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - 2 ab\sqrt{3} + 2 a\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - a\sqrt{3} + 2 b^{\frac{7}{2}}\frac{1}{\sqrt{b + 1}} + 2 b^{\frac{5}{2}}\frac{1}{\sqrt{b + 1}} + 2 b^{2}\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - b^{2}\sqrt{3} + 4 b\frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}} - b\sqrt{3} + 2 \frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}}, \sqrt{a}, \sqrt{b}, \frac{1}{a b \sqrt{a b + a + b + 1} + a \sqrt{a b + a + b + 1} + b \sqrt{a b + a + b + 1} + \sqrt{a b + a + b + 1}}, \frac{1}{\sqrt{a b + a + b + 1}}, \frac{1}{\sqrt{b + 1}}, \sqrt{3}, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
23
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{4} - 4 abcd + b^{4} + c^{4} + d^{4}, a, b, c, d, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
24
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{3}b^{2} + a^{3}c^{2} + a^{2}b^{3} - 2 a^{2}b^{2}c - 2 a^{2}bc^{2} + a^{2}c^{3} - 2 ab^{2}c^{2} + b^{3}c^{2} + b^{2}c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
25
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( def + de + df - 2 \sqrt{d}\sqrt{e} - 2 \sqrt{d}\sqrt{f} + ef - 2 \sqrt{e}\sqrt{f} + f + 2, \sqrt{d}, \sqrt{e}, \sqrt{f}, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
26
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( de^{2}f^{2} + de^{2}f + 2 def^{2} - 6 def + de + df^{2} + df + e^{2}f^{2} + e^{2}f + 2 ef^{2} + 3 ef + e + f^{2} + 2 f + 1, d, e, f, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
27
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( s^{2}def + s^{2}, s, d, e, f, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
28
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( -2 \sqrt{3}x_{1}x_{2} - 2 \sqrt{3}x_{2}x_{3} - 2 \sqrt{3}x_{3}x_{4} - 2 \sqrt{3}x_{4}x_{5} + 3 x_{1}^{2} + 3 x_{2}^{2} + 3 x_{3}^{2} + 3 x_{4}^{2} + 3 x_{5}^{2}, \sqrt{3}, x_{1}, x_{2}, x_{3}, x_{4}, x_{5}, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
29
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 7 a^{2}b^{3} - 6 a^{2}b^{2} - 6 a^{2}b + 7 a^{2} + 14 ab^{3} - 12 ab^{2} + 15 ab - 13 a + 7 b^{3} - 6 b^{2} - 6 b + 7, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
30
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{2}b^{2} + a^{2}b + 2 ab^{2} + ab + a + b^{2} + b, a, b, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
31
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( -2 \frac{1}{\sqrt{b}}\sqrt{\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}} - 2 \frac{1}{\sqrt{b}}\sqrt{\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}} - 2 \sqrt{\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}}\sqrt{\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}} + 3, \frac{1}{\sqrt{b}}, \sqrt{\frac{a^{2} b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a^{2} b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b^{2}}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1} + \frac{a b}{a^{2} b + a^{2} + a b^{2} + 3 a b + 2 a + b^{2} + 2 b + 1}}, \sqrt{\frac{a b}{a^{2} b + a^{2} + a b + 2 a + 1} + \frac{b}{a^{2} b + a^{2} + a b + 2 a + 1}}, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
32
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( a^{5}b^{2} + a^{5}c^{2} + a^{4}b^{3} - a^{4}b^{2}c - a^{4}bc^{2} - a^{4}c^{3} - a^{3}b^{4} + a^{3}c^{4} + a^{2}b^{5} - a^{2}b^{4}c - a^{2}bc^{4} + a^{2}c^{5} - ab^{4}c^{2} - ab^{2}c^{4} + b^{5}c^{2} + b^{4}c^{3} - b^{3}c^{4} + b^{2}c^{5}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
33
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{2}d^{3} - a^{2}d^{2} - a^{2}d + 2 a^{2} + 4 ad^{3} - 2 ad^{2} - 3 a + 2 d^{3} - d^{2} - d + 2, a, d, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+ +
+ + +
+
34
+
+
+
+ +
+ +
+ + + + +
+$\displaystyle \operatorname{Poly}{\left( 2 a^{3} - 3 a^{2}b + a^{2}c + ab^{2} - 3 ac^{2} + 2 b^{3} - 3 b^{2}c + bc^{2} + 2 c^{3}, a, b, c, domain=\mathbb{Z} \right)}$ +
+ +
+ +
+
+ +
+
+
+
+

Most formulas was converted to polynomials of independent variables. However formulas No. 22 and No. 31 were not. For this reason it's very unlikely that any method of proving these ones will succeed.

+

Now let's try some methods of proving these inequalities. The first one would be the simple prove.

+ +
+
+
+
+
+
In [7]:
+
+
+
tm=[0]*4
+
+ +
+
+
+ +
+
+
+
In [8]:
+
+
+
from collections import Counter
+from timeit import default_timer as timer
+start=timer()
+t=[]
+for ineq in ineqs2:
+    t+=[prove(ineq)]
+    print(t[-1],end=',')
+tm[0]=timer()-start
+print('\n',tm[0],sep='')
+Counter(t)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,2,0,2,2,0,2,0,2,0,
+20.714609994000057
+
+
+
+ +
+ +
Out[8]:
+ + + + +
+
Counter({0: 21, 2: 14})
+
+ +
+ +
+
+ +
+
+
+
+

Code 0 means that the proof was found, all other codes means that proof wasn't found. So this method has proved 21 inequalities.

+

The second method uses findvalues function, rationalizes the result numbers and gives them as additional parameter to prove function.

+ +
+
+
+
+
+
In [9]:
+
+
+
def cut(a):
+    if a<=0 or a>=100 or (a is None):
+        return 1
+    return a
+start=timer()
+t2=[]
+for ineq in ineqs2:
+    numvalues=findvalues(ineq,disp=0)
+    values=nsimplify(numvalues,tolerance=0.1,rational=True)
+    values=list(map(cut,values))
+    t2+=[prove(ineq,values=values)]
+    print(t2[-1],end=',')
+tm[1]=timer()-start
+print('\n',tm[1],sep='')
+Counter(t2)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,2,2,0,2,0,2,0,
+21.832711064998875
+
+
+
+ +
+ +
Out[9]:
+ + + + +
+
Counter({0: 24, 2: 11})
+
+ +
+ +
+
+ +
+
+
+
+

The third method is similar to the second one, but instead of rationalize values it squares, rationalizes and makes square roots of these values.

+ +
+
+
+
+
+
In [10]:
+
+
+
def cut(a):
+    if a<=0 or a>=1000 or (a is None):
+        return S(1)
+    return a
+    
+start=timer()
+t3=[]
+for ineq in ineqs2:
+    numvalues=findvalues(ineq,disp=0)
+    numvalues=tuple([x**2 for x in numvalues])
+    values=nsimplify(numvalues,tolerance=0.1,rational=True)
+    values=[sqrt(x) for x in values]
+    values=list(map(cut,values))
+    t3+=[prove(ineq,values=values)]
+    print(t3[-1],end=',')
+tm[2]=timer()-start
+print('\n',tm[2],sep='')
+Counter(t3)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,2,2,0,2,0,2,0,
+21.697120987002563
+
+
+
+ +
+ +
Out[10]:
+ + + + +
+
Counter({0: 23, 2: 12})
+
+ +
+ +
+
+ +
+
+
+
+

Finally, the fourth method is a slight modification to the third method. It does the same "findvalues, square, rationalize and make square roots" thing, but then it scales the values and runs it again. It can sometimes help with uniform formulas.

+ +
+
+
+
+
+
In [11]:
+
+
+
def betw(a):
+    return a>0.001 and a<1000 and a!=None
+def cut(a):
+    if betw(a):
+        return a
+    return S(1)
+
+start=timer()
+t4=[]
+for ineq in ineqs2:
+    numvalues=findvalues(ineq,disp=0)
+    n=1
+    numvalues2=[]
+    for i in numvalues:
+        if betw(i):
+            n=1/i
+            break
+    for i in numvalues:
+        if betw(i):
+            numvalues2+=[i*n]
+        else:
+            numvalues2+=[1]
+    numvalues3=findvalues(ineq,values=numvalues2,disp=0)
+    numvalues4=tuple([x**2 for x in numvalues3])
+    values=nsimplify(numvalues4,tolerance=0.1,rational=True)
+    values=[sqrt(x) for x in values]
+    values=list(map(cut,values))
+    t4+=[prove(ineq,values=values)]
+    print(t4[-1],end=',')
+tm[3]=timer()-start
+print('\n',tm[3],sep='')
+Counter(t4)
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
0,2,0,0,0,0,0,0,2,0,0,0,0,0,0,2,0,0,2,0,2,2,2,0,0,2,0,0,0,2,0,2,0,2,0,
+23.187820409999404
+
+
+
+ +
+ +
Out[11]:
+ + + + +
+
Counter({0: 24, 2: 11})
+
+ +
+ +
+
+ +
+
+
+
In [17]:
+
+
+
import matplotlib.pyplot as plt
+plt.bar(['1','2','3','4'],tm)
+plt.ylabel('time [seconds]')
+plt.xlabel('method')
+plt.show()
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+
+
In [13]:
+
+
+
import pandas as pd
+u=pd.DataFrame(zip(['']*len(ineqs),t,t2,t3,t4))
+
+ +
+
+
+ +
+
+
+
In [14]:
+
+
+
plt.bar(['1','2','3','4'],[sum(u[i]==0)/len(ineqs2)*100 for i in range(1,5)])
+plt.ylabel('inequalities proven [%]')
+plt.xlabel('method')
+plt.show()
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+
+
+

Down below there are contingency tables and McNemar test for every pair of methods.

+ +
+
+
+
+
+
In [15]:
+
+
+
for i in range(4):
+    for j in range(i+1,4):
+        display(pd.crosstab(u[i+1]==0, u[j+1]==0))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
2FalseTrue
1
False113
True021
+
+
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
3FalseTrue
1
False122
True021
+
+
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
4FalseTrue
1
False113
True021
+
+
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
3FalseTrue
2
False110
True123
+
+
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
4FalseTrue
2
False101
True123
+
+
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
4FalseTrue
3
False111
True023
+
+
+ +
+ +
+
+ +
+
+
+
In [16]:
+
+
+
from statsmodels.stats.contingency_tables import mcnemar
+for i in range(4):
+    for j in range(i+1,4):
+        print(mcnemar(pd.crosstab(u[i+1]==0, u[j+1]==0)))
+
+ +
+
+
+ +
+
+ + +
+ +
+ + +
+
pvalue      0.25
+statistic   0.0
+pvalue      0.5
+statistic   0.0
+pvalue      0.25
+statistic   0.0
+pvalue      1.0
+statistic   0.0
+pvalue      1.0
+statistic   1.0
+pvalue      1.0
+statistic   0.0
+
+
+
+ +
+
+ +
+
+
+
+

In all cases p-value is greater than 0.05, so there is no statistical difference between the methods.

+ +
+
+
+
+
+ + + + + + diff --git a/statistics.ipynb b/statistics.ipynb index fe47221..d65b5bc 100644 --- a/statistics.ipynb +++ b/statistics.ipynb @@ -17,7 +17,6 @@ "metadata": {}, "outputs": [], "source": [ - "from importlib import reload\n", "from sympy import *\n", "import shiroindev\n", "from shiroindev import *\n", @@ -58,25 +57,20 @@ " if not m:\n", " break\n", " s2+=s[p:p+m.end()]\n", - " #print('a',s[p:m.end()],p)\n", " p+=m.end()\n", " if m.group() in arg:\n", " for i in range(arg[m.group()]):\n", " sp=re.search('^ *',s[p:])\n", " s2+=sp.group()\n", - " #print('b',sp.group(),p)\n", " p+=sp.end()\n", " if s[p]=='{':\n", " cb=re.search(r'^\\{.*?\\}',s[p:])\n", " ab=addbraces(cb.group())\n", " s2+=ab\n", - " #print('c',ab,p)\n", " p+=cb.end()\n", " else:\n", " s2+='{'+s[p]+'}'\n", - " #print('d','{'+s[p]+'}',p)\n", " p+=1\n", - " #print('e',p)\n", " s2+=s[p:]\n", " return s2\n", "print(addbraces(r'\\frac{ \\sqrt 3}2'))\n", @@ -147,7 +141,6 @@ "def parser(formula,intervals='[]',subs='[]',func=dif):\n", " newproof()\n", " shiro.display=lambda x:None\n", - " #display=lambda x:None\n", " if intervals=='':\n", " intervals='[]'\n", " if subs=='':\n", diff --git a/statistics.pdf b/statistics.pdf deleted file mode 100644 index 5d30eec..0000000 Binary files a/statistics.pdf and /dev/null differ