Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data Kan
- data Open (k :: Kan) a
- lower :: Open k a -> a
- upper :: Open k a -> a
- omap :: Trip a b -> Open k a -> Open k b
- type Inf = Open L
- inf :: UpperBounded a => a -> Inf a
- (.?) :: Preorder a => Inf a -> a -> Bool
- filterL :: Lattice a => a -> Inf a -> Inf a
- type Sup = Open R
- sup :: LowerBounded a => a -> Sup a
- (?.) :: Preorder a => a -> Sup a -> Bool
- filterR :: Lattice a => a -> Sup a -> Sup a
Left and right separated Alexandrov topologies
data Open (k :: Kan) a Source #
A pointed open set in a separated left or right Alexandrov topology.
Instances
The left (Inf) topology
inf :: UpperBounded a => a -> Inf a Source #
Create an upper set: \( X_\geq(x) = \{ y \in X | y \geq x \} \)
Upper sets are the open sets of the left Alexandrov topology.
This function is monotone:
x <~ y <=> inf x <~ inf y
by the Yoneda lemma for preorders.
filterL :: Lattice a => a -> Inf a -> Inf a infixr 5 Source #
Filter an Inf with an anti-filter.
The resulting set is open in the separated left Alexandrov topology.
Intersecting with an incomparable element cuts out everything larger than its join with the base point:
>>>
p = inf pi :: Inf Double
>>>
p .? 1/0
True>>>
filterL (0/0) p .? 1/0
False
An example w/ the set inclusion lattice: >>> x = Set.fromList [6,40] :: Set.Set Word8 >>> y = Set.fromList [1,6,9] :: Set.Set Word8 >>> z = filterL y $ inf x fromList [6,40] ... fromList [1,6,9,40] >>> z .? Set.fromList [1,6,40] True >>> z .? Set.fromList [6,9,40] True >>> z .? Set.fromList [1,6,9,40] False