0
$\begingroup$

first of all I didn't know what could be the proper title for this question, you may edit it if you find better, thanks.

I am making some relations dynamically, relations will return based on two type of variables. {x,y,z,....} and {xP,yP,zP}. something like a function. but the problem is I get every time a different format for output. please look at the sample:

Simplify[Solve[((x < 10 && 
       Exists[{xPP, yPP, zPP}, 
        Exists[{xP, yP, zP},  xP == xPP && yP == yPP && zP == zPP && xP == x + 3 &&  yP == y && zP == z] && 
         Exists[{x, y, z},  x == xPP && y == yPP && z == zPP && yP == y + x && xP == x &&
            zP == z]]) || (!x < 10 && ((x >= 10 && xP == y - x && yP == y && 
           zP == z) || (! x >= 10 && xP == x && yP == y &&  zP == z))))], Element[{x, y, z, xP, yP, zP}, Integers]] /. 
 ConditionalExpression :> And

This looks a bit long but no matter, now look at the output:

{{x -> -xP + yP && yP >= 10 + xP, y -> yP && yP >= 10 + xP, zP -> z && yP >= 10 + xP}, {xP -> 3 + x && x < 10,  yP -> 3 + x + y && x < 10, zP -> z && x < 10}}

what I really need and it MUST be is, I need a format like function of xP,x. means xP -> x+ ..., yP->y+... . the Primed variable must be in left side and all right side must be NON primed. Also the conditions must be NON Prime. This works fine for some simple relations but not for all. As you see in the example , {x -> -xP + yP && yP >= 10 + xP, y -> yP && yP >= 10 + xP}. I don't want this. this must be xP-> y-x && x>=10. I got this manually by replacing yP,xP. is there any command I can use to make this. I believe it is possible because it returns sometimes in my desired format, no matter solve or reduce.

EDITED: This is another example different form above There is solution but it does not work for all. sometimes it return empty set and suggested to use Reduce instead of Solve. Reduce might return but it is not in my desired format. any idea about empty relation?

     Simplify[Solve[(((x == xP && y == yP && 
         z == zP) || ((x < 10 && 
          Exists[{xPP, yPP, zPP}, 
           Exists[{xP, yP, zP}, 
             xP == xPP && yP == yPP && zP == zPP && xPP < 10] && 
            Exists[{x, y, z}, 
             x == xPP && y == yPP && z == zPP && 
              Exists[{x, y, z}, 
               x == xPP && y == yPP && z == zPP && 
                Exists[{xPP, yPP, zPP}, 
                 Exists[{xP, yP, zP}, 
                   xP == xPP && yP == yPP && zP == zPP && 
                    xP == x + 3 && yP == y && zP == z] && 
                  Exists[{x, y, z}, 
                   x == xPP && y == yPP && z == zPP && yP == y + x && 
                    xP == x && zP == z]]]]])))) && ! xP < 10 , {xP, 
    yP, zP} ], Element[{x, y, z, xP, yP, zP}, Integers]] /. 
 ConditionalExpression :> And

and the answer is {}: Solve::fdimc: When parameter values satisfy the condition x<10, the solution set contains a full-dimensional component; use Reduce for complete solution information.

$\endgroup$
2
  • 1
    $\begingroup$ Will: "Solve[((x < 10 && Exists[{xPP, yPP, zPP}, Exists[{xP, yP, zP}, xP == xPP && yP == yPP && zP == zPP && xP == x + 3 && yP == y && zP == z] && Exists[{x, y, z}, x == xPP && y == yPP && z == zPP && yP == y + x && xP == x && zP == z]]) || (! x < 10 && ((x >= 10 && xP == y - x && yP == y && zP == z) || (! x >= 10 && xP == x && yP == y && zP == z)))), {xP, yP, zP}]" do what you want? $\endgroup$ Oct 27 '21 at 16:57
  • $\begingroup$ @DanielHuber please see my Edited. for another example your solution returns empty set and suggested to use Reudce. Reduce does not return what we want. I need something that works for any relation, in returned relation there must be all variables and along with primed ones. but reduce returns incomplete. to me Solve is the best option. Thanks for the help $\endgroup$
    – Azzurro94
    Oct 27 '21 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.