Skip to main content
added 39 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAllForAll[{x, y}, Equivalent[expr1, expr2]] // Resolve);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 
   3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
   Abs[x] + Abs[y] == 1, x == 3 || x == 2};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 
    1, (x - 3) (x - 2) == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1, x == 3 || x == 2}

  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAll);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 
   3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
   Abs[x] + Abs[y] == 1, x == 3 || x == 2};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 
    1, (x - 3) (x - 2) == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1, x == 3 || x == 2}

  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or ForAll[{x, y}, Equivalent[expr1, expr2]] // Resolve);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 
   3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
   Abs[x] + Abs[y] == 1, x == 3 || x == 2};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 
    1, (x - 3) (x - 2) == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1, x == 3 || x == 2}

added 64 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAll);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"]; 
list1 = {x - y == 0, x + 2 y == 0, 
   3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
   Abs[x] + Abs[y] == 1, x == 3 || x == 2};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 
    1, (x - 3) (x - 2) == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;;RegionEqual][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1, x == 3 || x == 2}

  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAll);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"]; 
list1 = {x - y == 0, x + 2 y == 0, 
  3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
  Abs[x] + Abs[y] == 1};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 1};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1}

  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAll);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 
   3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
   Abs[x] + Abs[y] == 1, x == 3 || x == 2};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 
    1, (x - 3) (x - 2) == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1, x == 3 || x == 2}

Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179

  • Follow the idea by @Daniel Lichtblau ( +1 );
  • Using RegionEqual( or maybe ForAll);
Clear["Global`*"];
list1 = {x - y == 0, x + 2 y == 0, 3 x - y == 0};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{x - y == 0, 3 x - y == 0, x + 2 y == 0}

  • test another example.
Clear["Global`*"]; 
list1 = {x - y == 0, x + 2 y == 0, 
  3 x - y == 0, (x - 1)^2 + 2 (y - 3)^2 - 1 == 0, 
  Abs[x] + Abs[y] == 1};
list2 = {-x + y == 0, -x - 2 y == 0, 3 x - y == 0, 3 x - 2 y == 0, 
   18 - 2 x + x^2 - 12 y + 2 y^2 == 0, (Abs[x] + Abs[y])^2 == 1};
list1 = ImplicitRegion[#, {x, y}] & /@ list1;
list2 = ImplicitRegion[#, {x, y}] & /@ list2;
Intersection[list1, list2, SameTest -> RegionEqual ][[;; , 1]]

{-1 + (-1 + x)^2 + 2 (-3 + y)^2 == 0, x - y == 0, 3 x - y == 0, x + 2 y == 0, Abs[x] + Abs[y] == 1}