Semilinear sets are closed under intersection, set difference and complement #
This file proves that the semilinear sets in any commutative monoid are closed under intersection
and set difference. They are also closed under complement if the monoid is finitely generated. We
prove these results on ℕ ^ k first (which are private APIs in this file) and then generalize to
any commutative monoid.
Main Results #
isSemilinearSet_setOf_eq: the set of solutions to a linear equationa + f x = b + g yis semilinear.IsSemilinearSet.inter,IsSemilinearSet.diff: semilinear sets are closed under intersection and set difference.IsSemilinearSet.compl: semilinear sets in a finitely generated commutative monoid are closed under complement.
References #
Semilinearity from slice property #
A set s is said to have slice property if a + b + c ∈ s whenever a ∈ s, a + b ∈ s and
a + c ∈ s. In ℕ ^ k, any set that has slice property is a semilinear set. This is an important
lemma to prove the semilinearity of linear equation solutions.
Semilinearity of linear equations and preimages #
The set of solutions to a linear equation a + f x = b + g y in a finitely generated monoid is
semilinear.
The preimage of a semilinear set under an homomorphism in a finitely generated monoid is semilinear.
Semilinear sets are included in finitely generated submonoids #
Semilinearity of intersection #
Semilinear sets are closed under intersection.
Semilinearity of complement and set difference #
We first show that the complement of a proper linear set s in ℕ ^ k is semilinear, through
several private definitions:
base,periods: the base vector and the set of periods of the proper linear sets.basisSet,basis: the linearly independent periods ofscan be extended to a basis ofℚ ^ k.fundamentalDomain: the set of vectors inℕ ^ k, starting frombase, with coordinates underbasisin[0, 1) ^ k.floor,fract: every vector inℕ ^ kcan be decomposed into aℤ-linear combination ofbasisSetand a vector infundamentalDomain.setOfFractNe,setOfFloorNeg,setOfFloorPos: the complement ofsis decomposed into three semilinear sets.
Closure of semilinear sets under complement and set difference follows.
Semilinear sets are closed under set difference.
Semilinear sets in a finitely generated monoid are closed under complement.