Copyright | (c) Justus Sagemüller 2013 |
---|---|
License | GPL v3 |
Maintainer | (@) sagemueller $ geo.uni-koeln.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
This is something of a first attempt at formalising manifolds and continuous mappings thereon. They work (check out http://hackage.haskell.org/package/dynamic-plot-0.1.0.0 for a use case), but aren't very efficient. The interface might well change considerably in the future.
- data domain :--> codomain where
- Continuous :: (Manifold d, Manifold c, v ~ TangentSpace d, u ~ TangentSpace c, δ ~ Metric v, ε ~ Metric u) => {
- runContinuous :: Chart d -> v -> (Chart c, u, ε -> Option δ)
- Continuous :: (Manifold d, Manifold c, v ~ TangentSpace d, u ~ TangentSpace c, δ ~ Metric v, ε ~ Metric u) => {
- continuous_id' :: Manifold m => m :--> m
- const__ :: (Manifold c, Manifold d) => c -> d :--> c
- flatContinuous :: (FlatManifold v, FlatManifold w, δ ~ Metric v, ε ~ Metric w) => (v -> (w, ε -> Option δ)) -> v :--> w
- runFlatContinuous :: (FlatManifold v, FlatManifold w, δ ~ Metric v, ε ~ Metric w) => (v :--> w) -> v -> (w, ε -> Option δ)
- data Chart :: * -> * where
- IdChart :: FlatManifold v => Chart v
- Chart :: (Manifold m, v ~ TangentSpace m, FlatManifold v) => {
- chartInMap :: v :--> m
- chartOutMap :: m -> Maybe (m :--> v)
- chartKind :: ChartKind
- data ChartKind
- type FlatManifold v = (MetricSpace v, Manifold v, v ~ TangentSpace v)
- type EuclidSpace v = (HasBasis v, EqFloating (Scalar v), Eq v)
- isInUpperHemi :: EuclidSpace v => v -> Bool
- type Atlas m = [Chart m]
- class (MetricSpace (TangentSpace m), Metric (TangentSpace m) ~ ℝ) => Manifold m where
- type TangentSpace m :: *
- localAtlas :: m -> Atlas m
- vectorSpaceAtlas :: FlatManifold v => v -> Atlas v
- type Representsℝ r = (EqFloating r, FlatManifold r, r ~ Scalar r, r ~ Metric r)
- continuousFlatFunction :: (FlatManifold d, FlatManifold c, ε ~ Metric c, δ ~ Metric d) => (d -> (c, ε -> Option δ)) -> d :--> c
- type CntnRealFunction = Representsℝ r => r :--> r
- sin__ :: CntnRealFunction
- cos__ :: CntnRealFunction
- atan__ :: CntnRealFunction
- exp__ :: CntnRealFunction
- sinh__ :: CntnRealFunction
- cosh__ :: CntnRealFunction
- tanh__ :: CntnRealFunction
- asinh__ :: CntnRealFunction
- cntnFuncsCombine :: forall d v c c' c'' ε ε' ε''. (FlatManifold c, FlatManifold c', FlatManifold c'', ε ~ Metric c, ε' ~ Metric c', ε'' ~ Metric c'', ε ~ ε', ε ~ ε'') => (c' -> c'' -> (c, ε -> (ε', ε''))) -> (d :--> c') -> (d :--> c'') -> d :--> c
- data CntnFuncValue d c
- = CntnFuncValue {
- runCntnFuncValue :: d :--> c
- | CntnFuncConst c
- = CntnFuncValue {
- cntnFnValsFunc :: (FlatManifold c, FlatManifold c', Manifold d, ε ~ Metric c, ε ~ Metric c') => (c' -> (c, ε -> Option ε)) -> CntnFuncValue d c' -> CntnFuncValue d c
- cntnFnValsCombine :: forall d c c' c'' ε ε' ε''. (FlatManifold c, FlatManifold c', FlatManifold c'', Manifold d, ε ~ Metric c, ε' ~ Metric c', ε'' ~ Metric c'', ε ~ ε', ε ~ ε'') => (c' -> c'' -> (c, ε -> (ε', (ε', ε''), ε''))) -> CntnFuncValue d c' -> CntnFuncValue d c'' -> CntnFuncValue d c
- finiteGraphContinℝtoℝ :: GraphWindowSpec -> (Double :--> Double) -> [(Double, Double)]
- finiteGraphContinℝtoℝ² :: GraphWindowSpec -> (Double :--> (Double, Double)) -> [[(Double, Double)]]
- midBetween :: (VectorSpace v, Fractional (Scalar v)) => [v] -> v
- (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
- just :: a -> Option a
- nothing :: Option a
- class (RealFloat (Metric v), InnerSpace v) => MetricSpace v where
- type Real0 = ℝ⁰
- type Real1 = ℝ
- type RealPlus = ℝay
- type Real2 = ℝ²
- type Real3 = ℝ³
- type Sphere0 = S⁰
- type Sphere1 = S¹
- type Sphere2 = S²
- type Projective1 = ℝP¹
- type Projective2 = ℝP²
- type Disk1 = D¹
- type Disk2 = D²
- type Cone = CD¹
- type OpenCone = Cℝay
- data ZeroDim k = Origin
- isoAttachZeroDim :: (WellPointed c, UnitObject c ~ (), ObjectPair c a (), Object c (ZeroDim k), ObjectPair c a (ZeroDim k), PointObject c (ZeroDim k)) => Isomorphism c a (a, ZeroDim k)
- type ℝ⁰ = ZeroDim ℝ
- type ℝ = Double
- type ℝ² = (ℝ, ℝ)
- type ℝ³ = (ℝ², ℝ)
- data S⁰
- otherHalfSphere :: S⁰ -> S⁰
- newtype S¹ = S¹ {}
- data S² = S² {}
- type ℝP¹ = S¹
- data ℝP² = ℝP² {}
- newtype D¹ = D¹ {}
- data D² = D² {}
- type ℝay = Cℝay ℝ⁰
- data CD¹ x = CD¹ {}
- data Cℝay x = Cℝay {
- hParamCℝay :: !Double
- pParamCℝay :: !x
- newtype x ⊗ y = DensTensProd {
- getDensTensProd :: Matrix (Scalar y)
- class NaturallyEmbedded m v where
- data GraphWindowSpec = GraphWindowSpec {
- lBound, rBound, bBound, tBound :: Double
- xResolution, yResolution :: Int
- type Endomorphism a = a -> a
- (^) :: Num a => a -> Int -> a
- (^.) :: s -> (forall f. Functor f => (a -> f a) -> s -> f s) -> a
- type EqFloating f = (Eq f, Ord f, Floating f)
- empty :: Alternative f => forall a. f a
Documentation
data domain :--> codomain where Source
Continuous mapping.
Continuous :: (Manifold d, Manifold c, v ~ TangentSpace d, u ~ TangentSpace c, δ ~ Metric v, ε ~ Metric u) => (Chart d -> v -> (Chart c, u, ε -> Option δ)) -> d :--> c | |
|
HasAgent (:-->) Source | |
Category (:-->) Source | |
Cartesian (:-->) Source | |
PreArrow (:-->) Source | |
Morphism (:-->) Source | |
CartesianAgent (:-->) Source | |
EnhancedCat (->) (:-->) Source | |
PointAgent CntnFuncValue (:-->) d c Source | |
type UnitObject (:-->) = () | |
type Object (:-->) t = Manifold t Source | |
type AgentVal (:-->) d c = CntnFuncValue d c Source | |
type PairObjects (:-->) a b = (FlatManifold a, FlatManifold b, Manifold (a, b)) Source |
continuous_id' :: Manifold m => m :--> m Source
flatContinuous :: (FlatManifold v, FlatManifold w, δ ~ Metric v, ε ~ Metric w) => (v -> (w, ε -> Option δ)) -> v :--> w Source
runFlatContinuous :: (FlatManifold v, FlatManifold w, δ ~ Metric v, ε ~ Metric w) => (v :--> w) -> v -> (w, ε -> Option δ) Source
data Chart :: * -> * where Source
A chart is a homeomorphism from a connected, open subset Q ⊂ M of
an n-manifold M to either the open unit disk Dⁿ ⊂ V ≃ ℝⁿ, or
the half-disk Hⁿ = {x ∊ Dⁿ: x₀≥0}. In e.g. the former case, chartInMap
is thus defined ∀ v ∊ V : |v| < 1, while 'chartOutMap p' will yield Just x
with x ∊ Dⁿ provided p is in Q, and Nothing
otherwise.
Obviously, fromJust .
should be equivalent to chartOutMap
. chartInMap
id
on Dⁿ, and
to chartInMap
. fromJust . chartOutMap
id
on Q.
IdChart :: FlatManifold v => Chart v | |
Chart :: (Manifold m, v ~ TangentSpace m, FlatManifold v) => (v :--> m) -> (m -> Maybe (m :--> v)) -> ChartKind -> Chart m | |
|
LandlockedChart | A M ⇆ Dⁿ chart, for ordinary manifolds |
RimChart | A M ⇆ Hⁿ chart, for manifolds with a rim |
type FlatManifold v = (MetricSpace v, Manifold v, v ~ TangentSpace v) Source
type EuclidSpace v = (HasBasis v, EqFloating (Scalar v), Eq v) Source
isInUpperHemi :: EuclidSpace v => v -> Bool Source
class (MetricSpace (TangentSpace m), Metric (TangentSpace m) ~ ℝ) => Manifold m where Source
type TangentSpace m :: * Source
localAtlas :: m -> Atlas m Source
Manifold Double Source | |
Manifold () Source | |
(FlatManifold v₁, FlatManifold v₂, (~) * (Scalar v₁) (Scalar v₂), MetricSpace (Scalar v₁), (~) * (Metric (Scalar v₁)) ℝ, VectorSpace (v₁, v₂), (~) * (Scalar (v₁, v₂)) (Scalar v₁)) => Manifold (v₁, v₂) Source |
vectorSpaceAtlas :: FlatManifold v => v -> Atlas v Source
type Representsℝ r = (EqFloating r, FlatManifold r, r ~ Scalar r, r ~ Metric r) Source
continuousFlatFunction :: (FlatManifold d, FlatManifold c, ε ~ Metric c, δ ~ Metric d) => (d -> (c, ε -> Option δ)) -> d :--> c Source
type CntnRealFunction = Representsℝ r => r :--> r Source
cntnFuncsCombine :: forall d v c c' c'' ε ε' ε''. (FlatManifold c, FlatManifold c', FlatManifold c'', ε ~ Metric c, ε' ~ Metric c', ε'' ~ Metric c'', ε ~ ε', ε ~ ε'') => (c' -> c'' -> (c, ε -> (ε', ε''))) -> (d :--> c') -> (d :--> c'') -> d :--> c Source
data CntnFuncValue d c Source
CntnFuncValue | |
| |
CntnFuncConst c |
PointAgent CntnFuncValue (:-->) d c Source | |
(Representsℝ r, Manifold d) => Floating (CntnFuncValue d r) Source | |
(Representsℝ r, Manifold d) => Fractional (CntnFuncValue d r) Source | |
(Representsℝ r, Manifold d) => Num (CntnFuncValue d r) Source | |
(FlatManifold v, MetricSpace v, (~) * (Metric v) ℝ, FlatManifold (Scalar v), MetricSpace (Scalar v), (~) * (Metric (Scalar v)) ℝ, Manifold d) => VectorSpace (CntnFuncValue d v) Source | |
(FlatManifold v, Manifold d) => AdditiveGroup (CntnFuncValue d v) Source | |
type Scalar (CntnFuncValue d v) = CntnFuncValue d (Scalar v) Source |
cntnFnValsFunc :: (FlatManifold c, FlatManifold c', Manifold d, ε ~ Metric c, ε ~ Metric c') => (c' -> (c, ε -> Option ε)) -> CntnFuncValue d c' -> CntnFuncValue d c Source
cntnFnValsCombine :: forall d c c' c'' ε ε' ε''. (FlatManifold c, FlatManifold c', FlatManifold c'', Manifold d, ε ~ Metric c, ε' ~ Metric c', ε'' ~ Metric c'', ε ~ ε', ε ~ ε'') => (c' -> c'' -> (c, ε -> (ε', (ε', ε''), ε''))) -> CntnFuncValue d c' -> CntnFuncValue d c'' -> CntnFuncValue d c Source
finiteGraphContinℝtoℝ :: GraphWindowSpec -> (Double :--> Double) -> [(Double, Double)] Source
finiteGraphContinℝtoℝ² :: GraphWindowSpec -> (Double :--> (Double, Double)) -> [[(Double, Double)]] Source
midBetween :: (VectorSpace v, Fractional (Scalar v)) => [v] -> v Source
class (RealFloat (Metric v), InnerSpace v) => MetricSpace v where Source
metric :: v -> Metric v Source
metricSq :: v -> Metric v Source
(|*^) :: Metric v -> v -> v Source
metricToScalar :: v -> Metric v -> Scalar v Source
MetricSpace () Source | |
MetricSpace ℝ Source | |
(RealFloat r, MetricSpace r, (~) * (Scalar (Complex r)) (Metric r)) => MetricSpace (Complex r) Source | |
(MetricSpace v, MetricSpace (Scalar v), MetricSpace w, (~) * (Scalar v) (Scalar w), (~) * (Metric v) (Metric (Scalar v)), (~) * (Metric w) (Metric v), (~) * (Metric (Scalar w)) (Metric v), RealFloat (Metric v)) => MetricSpace (v, w) Source |
Index / ASCII names
type Projective1 = ℝP¹ Source
type Projective2 = ℝP² Source
Linear manifolds
A single point. Can be considered a zero-dimensional vector space, WRT any scalar.
Eq (ZeroDim k) Source | |
Show (ZeroDim k) Source | |
Monoid (ZeroDim k) Source | |
VectorSpace (ZeroDim k) Source | |
AdditiveGroup (ZeroDim k) Source | |
AffineSpace (ZeroDim k) Source | |
HasBasis (ZeroDim k) Source | |
SmoothScalar k => FiniteDimensional (ZeroDim k) Source | |
MetricScalar k => HasMetric' (ZeroDim k) Source | |
PseudoAffine (ZeroDim k) Source | |
Semimanifold (ZeroDim k) Source | |
IntervalLike (Cℝay ℝ⁰) Source | |
IntervalLike (CD¹ ℝ⁰) Source | |
Geodesic (Cℝay ℝ⁰) Source | |
Geodesic (CD¹ ℝ⁰) Source | |
Geodesic (ZeroDim ℝ) Source | |
type Scalar (ZeroDim k) = k Source | |
type Diff (ZeroDim k) = ZeroDim k Source | |
type Basis (ZeroDim k) = Void Source | |
type DualSpace (ZeroDim k) = ZeroDim k | |
type Needle (ZeroDim k) = ZeroDim k Source | |
type Interior (ZeroDim k) = ZeroDim k |
isoAttachZeroDim :: (WellPointed c, UnitObject c ~ (), ObjectPair c a (), Object c (ZeroDim k), ObjectPair c a (ZeroDim k), PointObject c (ZeroDim k)) => Isomorphism c a (a, ZeroDim k) Source
Hyperspheres
The zero-dimensional sphere is actually just two points. Implementation might
therefore change to ℝ⁰
: the disjoint sum of two
single-point spaces.+
ℝ⁰
otherHalfSphere :: S⁰ -> S⁰ Source
The unit circle.
The ordinary unit sphere.
Projective spaces
The two-dimensional real projective space, implemented as a unit disk with opposing points on the rim glued together.
Intervals/disks/cones
The “one-dimensional disk” – really just the line segment between the two points -1 and 1 of 'S⁰', i.e. this is simply a closed interval.
The standard, closed unit disk. Homeomorphic to the cone over 'S¹', but not in the the obvious, “flat” way. (And not at all, despite the identical ADT definition, to the projective space 'ℝP²'!)
Better known as ℝ⁺ (which is not a legal Haskell name), the ray of positive numbers (including zero, i.e. closed on one end).
A (closed) cone over a space x
is the product of x
with the closed interval 'D¹'
of “heights”,
except on its “tip”: here, x
is smashed to a single point.
This construct becomes (homeomorphic-to-) an actual geometric cone (and to 'D²') in the
special case x = 'S¹'
.
IntervalLike (CD¹ ℝ⁰) Source | |
IntervalLike (CD¹ S⁰) Source | |
(WithField ℝ HilbertSpace a, WithField ℝ HilbertSpace b, Geodesic (a, b)) => Geodesic (CD¹ (a, b)) Source | |
Geodesic (CD¹ ℝ) Source | |
Geodesic (CD¹ ℝ⁰) Source | |
Geodesic (CD¹ S²) Source | |
Geodesic (CD¹ S¹) Source | |
Geodesic (CD¹ S⁰) Source | |
type Needle (CD¹ m) Source | |
type Interior (CD¹ m) Source |
An open cone is homeomorphic to a closed cone without the “lid”,
i.e. without the “last copy” of x
, at the far end of the height
interval. Since that means the height does not include its supremum, it is actually
more natural to express it as the entire real ray, hence the name.
Cℝay | |
|
IntervalLike (Cℝay ℝ⁰) Source | |
IntervalLike (Cℝay S⁰) Source | |
(WithField ℝ HilbertSpace a, WithField ℝ HilbertSpace b, Geodesic (a, b)) => Geodesic (Cℝay (a, b)) Source | |
Geodesic (Cℝay ℝ) Source | |
Geodesic (Cℝay ℝ⁰) Source | |
Geodesic (Cℝay S²) Source | |
Geodesic (Cℝay S¹) Source | |
Geodesic (Cℝay S⁰) Source | |
NaturallyEmbedded x p => NaturallyEmbedded (Cℝay x) (p, ℝ) Source | |
type Needle (Cℝay m) Source | |
type Interior (Cℝay m) Source |
Tensor products
Dense tensor product of two vector spaces.
DensTensProd | |
|
(FiniteDimensional a, FiniteDimensional b, (~) * (Scalar a) (Scalar b)) => FiniteDimensional ((⊗) a b) Source | |
(HasMetric a, FiniteDimensional b, (~) * (Scalar a) (Scalar b)) => PseudoAffine ((⊗) a b) Source | |
(HasMetric a, FiniteDimensional b, (~) * (Scalar a) (Scalar b)) => Semimanifold ((⊗) a b) Source | |
type Scalar ((⊗) x y) = Scalar y | |
type Basis ((⊗) x y) = (Basis x, Basis y) | |
type Needle ((⊗) a b) = (⊗) a b Source | |
type Interior ((⊗) a b) = (⊗) a b |
Utility (deprecated)
class NaturallyEmbedded m v where Source
NaturallyEmbedded D¹ ℝ Source | |
NaturallyEmbedded ℝP² ℝ³ Source | |
NaturallyEmbedded S² ℝ³ Source | |
NaturallyEmbedded S¹ ℝ² Source | |
NaturallyEmbedded S⁰ ℝ Source | |
(VectorSpace y, VectorSpace z) => NaturallyEmbedded x ((x, y), z) Source | |
VectorSpace y => NaturallyEmbedded x (x, y) Source | |
NaturallyEmbedded x p => NaturallyEmbedded (Cℝay x) (p, ℝ) Source |
data GraphWindowSpec Source
GraphWindowSpec | |
|
type Endomorphism a = a -> a Source
type EqFloating f = (Eq f, Ord f, Floating f) Source
empty :: Alternative f => forall a. f a
The identity of <|>