RegularChains
ConstructibleSetTools[Difference]
compute the difference of two constructible sets
SemiAlgebraicSetTools[Difference]
compute the difference of two semi-algebraic sets
Calling Sequence
Parameters
Description
Examples
References
Compatibility
Difference(cs1, cs2, R)
Difference(lrsas1, lrsas2, R)
cs1, cs2
-
constructible sets
lrsas1
list of regular semi-algebraic systems
lrsas2
R
polynomial ring
This command computes the set-theoretic difference of two constructible sets or two semi-algebraic sets, depending on the input type.
A constructible set must be encoded as an constructible_set object; see the type definition in ConstructibleSetTools.
A semi-algebraic set must be encoded by a list of regular_semi_algebraic_system, see the type definition of RealTriangularize.
The command Difference(cs1, cs2, R) returns a constructible set which is the set theoretic difference of two constructible sets. The polynomial ring may have characteristic zero or a prime characteristic.
The command Difference(lrsas1, lrsas2, R) returns a list of regular semi-algebraic systems, encoding the set-theoretic difference of two semi-algebraic sets. The polynomial ring must have characteristic zero.
The output may contain certain redundancy among the defining regular systems.
This command is available once RegularChains[ConstructibleSetTools] submodule or RegularChains[SemiAlgebraicSetTools] submodule have been loaded. It can always be accessed through one of the following long forms: RegularChains:-ConstructibleSetTools:-Difference or RegularChains:-SemiAlgebraicSetTools:-Difference.
with⁡RegularChains:
with⁡ChainTools:
with⁡ConstructibleSetTools:
with⁡SemiAlgebraicSetTools:
First, define a polynomial ring.
R≔PolynomialRing⁡x,y
R≔polynomial_ring
Use Triangularize to solve the polynomial equations given by F and G below.
F≔2⁢x2+3⁢x⁢y+y2−3⁢x−3⁢y
G≔x⁢y2−x
dec≔Triangularize⁡F,G,R,output=lazard
dec≔regular_chain,regular_chain,regular_chain,regular_chain,regular_chain,regular_chain
map⁡Equations,dec,R
x−2,y+1,x−1,y−1,x+1,y−1,x,y−3,x−1,y+1,x,y
Now remove points which cancel the following H.
H≔y3−y
First, build the common solution set of F and G as a constructible set and also build one with H.
rcH≔Chain⁡H,Empty⁡R,R
rcH≔regular_chain
cs1≔ConstructibleSet⁡RegularSystem⁡rcH,R,R
cs1≔constructible_set
cs2≔ConstructibleSet⁡map⁡RegularSystem,dec,R,R
cs2≔constructible_set
Then use Difference to find a new constructible set which encodes those points that cancel F and G, but do not cancel H.
cs3≔Difference⁡cs2,cs1,R
cs3≔constructible_set
You can check the result using the Info command: cs2 consists of six points, and five of them cancel H.
Info⁡cs2,R
x−2,y+1,1,x−1,y−1,1,x+1,y−1,1,x,y−3,1,x−1,y+1,1,x,y,1
The set cs3 consists of a single point which does not cancel H.
Info⁡cs3,R
x,y−3,1
An example on semi-algebraic set difference: to check whether or not two formula/conditions are equivalent. # Semi-algebraic Difference, verifying results
C1≔0<a,0<b,0<c,a<b+c,b<a+c,c<a+b,b2+a2−c2≤0:
C2≔0<a,0<b,0<c,a<b+c,b<a+c,c<a+b,c⁢b2+a2−c22<a⁢b2⁢2⁢a⁢c−c2+a2−b2:
S1≔C1,C2
S1≔0<a,0<b,0<c,a<b+c,b<a+c,c<a+b,a2+b2−c2≤0,0<a,0<b,0<c,a<b+c,b<a+c,c<a+b,c⁢a2+b2−c22<a⁢b2⁢−a2+2⁢a⁢c+b2−c2
S2≔a−c<0,0<a,0<b,0<c,a<b+c,b<a+c,c<a+b
R≔PolynomialRing⁡a,b,c:
dec1≔map⁡op,map⁡RealTriangularize,S1,R
dec1≔regular_semi_algebraic_system,regular_semi_algebraic_system,regular_semi_algebraic_system
dec2≔RealTriangularize⁡S2,R
dec2≔regular_semi_algebraic_system
Verify dec1 = dec2 as set of points by Difference.
Difference⁡dec1,dec2,R
Difference⁡dec2,dec1,R
Chen, C.; Golubitsky, O.; Lemaire, F.; Moreno Maza, M.; and Pan, W. "Comprehensive Triangular Decomposition". Proc. CASC 2007, LNCS, Vol. 4770: 73-101. Springer, 2007.
Chen, C.; Davenport, J.-D.; Moreno Maza, M.; Xia, B.; and Xiao, R. "Computing with semi-algebraic sets represented by triangular decomposition". Proceedings of 2011 International Symposium on Symbolic and Algebraic Computation (ISSAC 2011), ACM Press, pp. 75--82, 2011.
The RegularChains[SemiAlgebraicSetTools][Difference] command was introduced in Maple 16.
The lrsas1 and lrsas2 parameters were introduced in Maple 16.
For more information on Maple 16 changes, see Updates in Maple 16.
See Also
ConstructibleSet
ConstructibleSetTools
GeneralConstruct
Intersection
IsContained
IsEmpty
MakePairwiseDisjoint
Projection
RealTriangularize
Download Help Document