Complement of a set

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 603
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Complement of a set

Message par compsystems » mer. nov. 27, 2024 4:50 pm

Hello,
To obtain the complement of a set with respect to another set you can use the MINUS command, but it would be nice to create a separate command

Please add this command as a function as it is a fundamental command in set theory

A := set[2,3,5,7,11];
B := set[1,2,3,4,5,6,7,8,9,10,11];
C:= set[];

complement(A,B) [enter] set[1,4,6,8,9,10] // B minus A;
complement(B,A) [enter] set[ ] // A minus B;
complement(A,A) [enter] set[ ] // A minus A;
complement(C,A) [enter] set[2,3,5,7,11] // A minus C;

D:=complement(A,B);
complement(A,D); set[1,4,6,8,9,10] // (A')'

A:=set[a,ee,ii];
B:=[a ,b , c];
U:=[a,b,c,d,ee,f,g,h,ii,j,k,l,m,n,o,p,q,r,s,t,u,v, w,x,y,z];
U minus (A union B) ; [enter] set[g,h,ii,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
(U minus A) intersect (U minus B) ; [enter] set[g,h,ii,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
(U minus (A union B) ) == (U minus A) intersect (U minus B); [enter] // true, Morgan law

with complement function
Complement((A union B) , U); [enter] set[g,h,ii,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
Complement(A,U) intersect Complement(A,U) ; [enter] set[g,h,ii,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
With the complement function it helps us to demonstrate set laws in a much more readable way.. =)

Répondre