manifolds-0.4.1.0: Coordinate-free hypersurfaces

Copyright(c) Justus Sagemüller 2015
LicenseGPL v3
Maintainer(@) sagemueller $ geo.uni-koeln.de
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Manifold.PseudoAffine

Contents

Description

This is the second prototype of a manifold class. It appears to give considerable advantages over Manifold, so that class will probably soon be replaced with the one we define here (though PseudoAffine does not follow the standard notion of a manifold very closely, it should work quite equivalently for pretty much all Haskell types that qualify as manifolds).

Manifolds are interesting as objects of various categories, from continuous to diffeomorphic. At the moment, we mainly focus on region-wise differentiable functions, which are a promising compromise between flexibility of definition and provability of analytic properties. In particular, they are well-suited for visualisation purposes.

The classes in this module are mostly aimed at manifolds without boundary. Manifolds with boundary (which we call MWBound, never manifold!) are more or less treated as a disjoint sum of the interior and the boundary. To understand how this module works, best first forget about boundaries – in this case, Interior x ~ x, fromInterior and toInterior are trivial, and .+~|, |-~. and betweenBounds are irrelevant. The manifold structure of the boundary itself is not considered at all here.

Synopsis

Manifold class

class (PseudoAffine m, LSpace (Needle m)) => Manifold m where Source

See Semimanifold and PseudoAffine for the methods.

Minimal complete definition

Nothing

Instances

(PseudoAffine m, LSpace (Needle m), (~) * (Interior m) m) => Manifold m Source 

class AdditiveGroup (Needle x) => Semimanifold x where

Minimal complete definition

((.+~^) | fromInterior), toInterior, translateP

Associated Types

type Needle x :: *

type Interior x :: *

Methods

(.+~^) :: Interior x -> Needle x -> x

fromInterior :: Interior x -> x

toInterior :: x -> Maybe (Interior x)

translateP :: Tagged * x (Interior x -> Needle x -> Interior x)

(.-~^) :: Interior x -> Needle x -> x

semimanifoldWitness :: SemimanifoldWitness x

Instances

Semimanifold Double 
Semimanifold Rational 
Semimanifold S⁰ 
Semimanifold  
Semimanifold  
Semimanifold (ZeroDim k) 
AffineManifold x => Semimanifold (Shade' x) 
PseudoAffine x => Semimanifold (Shade x) 
AffineManifold x => Semimanifold (ShadeTree x)

Experimental. There might be a more powerful instance possible.

(Semimanifold a, Semimanifold b) => Semimanifold (a, b) 
(TensorSpace v, (~) * (Scalar v) s) => Semimanifold (SymmetricTensor s v) 
Semimanifold x => Semimanifold (WithAny x y) 
(Semimanifold a, Semimanifold b, Semimanifold c) => Semimanifold (a, b, c) 
(TensorSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => Semimanifold (Tensor s v w) 
(LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => Semimanifold (LinearMap s v w) 
VectorSpace w => Semimanifold (LinearFunction s v w) 
(Atlas x, HasTrie (ChartIndex x), LinearSpace (Needle x), (~) * (Scalar (Needle x)) s, Manifold y, (~) * (Scalar (Needle y)) s) => Semimanifold (Affine s x y) 

type Needle' x = DualVector (Needle x) Source

A co-needle can be understood as a “paper stack”, with which you can measure the length that a needle reaches in a given direction by counting the number of holes punched through them.

class Semimanifold x => PseudoAffine x where

Minimal complete definition

(.-~.) | (.-~!)

Methods

(.-~.) :: x -> x -> Maybe (Needle x)

(.-~!) :: x -> x -> Needle x

pseudoAffineWitness :: PseudoAffineWitness x

Instances

PseudoAffine Double 
PseudoAffine Rational 
PseudoAffine S⁰ 
PseudoAffine  
PseudoAffine  
PseudoAffine (ZeroDim k) 
(PseudoAffine a, PseudoAffine b) => PseudoAffine (a, b) 
(TensorSpace v, (~) * (Scalar v) s) => PseudoAffine (SymmetricTensor s v) 
PseudoAffine x => PseudoAffine (WithAny x y) 
(PseudoAffine a, PseudoAffine b, PseudoAffine c) => PseudoAffine (a, b, c) 
(TensorSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => PseudoAffine (Tensor s v w) 
(LinearSpace v, TensorSpace w, (~) * (Scalar v) s, (~) * (Scalar w) s) => PseudoAffine (LinearMap s v w) 
VectorSpace w => PseudoAffine (LinearFunction s v w) 
(Atlas x, HasTrie (ChartIndex x), LinearSpace (Needle x), (~) * (Scalar (Needle x)) s, Manifold y, (~) * (Scalar (Needle y)) s) => PseudoAffine (Affine s x y) 

Type definitions

Needles

newtype Local x Source

A point on a manifold, as seen from a nearby reference point.

Constructors

Local 

Fields

getLocalOffset :: Needle x
 

Instances

Show (Needle x) => Show (Local x) Source 

Metrics

type Metric x = Norm (Needle x) Source

The word “metric” is used in the sense as in general relativity. Actually this is just the type of scalar products on the tangent space. The actual metric is the function x -> x -> Scalar (Needle x) defined by

\p q -> m |$| (p.-~!q)

type Metric' x = Variance (Needle x) Source

type RieMetric x = x -> Metric x Source

A Riemannian metric assigns each point on a manifold a scalar product on the tangent space. Note that this association is not continuous, because the charts/tangent spaces in the bundle are a priori disjoint. However, for a proper Riemannian metric, all arising expressions of scalar products from needles between points on the manifold ought to be differentiable.

type RieMetric' x = x -> Metric' x Source

Constraints

data SemimanifoldWitness x :: * -> * where

Constructors

SemimanifoldWitness :: (Semimanifold (Needle x), (~) * (Needle (Interior x)) (Needle x), (~) * (Needle (Needle x)) (Needle x), (~) * (Interior (Needle x)) (Needle x)) => BoundarylessWitness (Interior x) -> SemimanifoldWitness x 

data BoundarylessWitness m :: * -> * where

Constructors

BoundarylessWitness :: (Semimanifold m, (~) * (Interior m) m) => BoundarylessWitness m 

type DualNeedleWitness x = DualSpaceWitness (Needle x) Source

type WithField s c x = (c x, s ~ Scalar (Needle x), s ~ Scalar (Needle' x)) Source

Require some constraint on a manifold, and also fix the type of the manifold's underlying field. For example, WithField ℝ HilbertManifold v constrains v to be a real (i.e., Double-) Hilbert space. Note that for this to compile, you will in general need the -XLiberalTypeSynonyms extension (except if the constraint is an actual type class (like Manifold): only those can always be partially applied, for type constraints this is by default not allowed).

type LocallyScalable s x = (PseudoAffine x, LSpace (Needle x), s ~ Scalar (Needle x), s ~ Scalar (Needle' x), Num' s) Source

Local functions

type LocalBilinear x y = LinearMap (Scalar (Needle x)) (SymmetricTensor (Scalar (Needle x)) (Needle x)) (Needle y) Source

type LocalAffine x y = (Needle y, LocalLinear x y) Source

Misc

alerpB :: (AffineSpace x, VectorSpace (Diff x), (~) * (Scalar (Diff x)) ) => x -> x -> -> x

palerp :: (PseudoAffine x, VectorSpace (Needle x)) => x -> x -> Maybe (Scalar (Needle x) -> x)

palerpB :: (PseudoAffine x, VectorSpace (Needle x), (~) * (Scalar (Needle x)) ) => x -> x -> Maybe ( -> x)

class (Semimanifold x, Semimanifold ξ, LSpace (Needle x), LSpace (Needle ξ), Scalar (Needle x) ~ Scalar (Needle ξ)) => LocallyCoercible x ξ where Source

Instances of this class must be diffeomorphic manifolds, and even have canonically isomorphic tangent spaces, so that fromPackedVector . asPackedVector :: Needle x -> Needle ξ defines a meaningful “representational identity“ between these spaces.

Methods

locallyTrivialDiffeomorphism :: x -> ξ Source

Must be compatible with the isomorphism on the tangent spaces, i.e. locallyTrivialDiffeomorphism (p .+~^ v) ≡ locallyTrivialDiffeomorphism p .+~^ coerceNeedle v

coerceNeedle :: Functor p (->) (->) => p (x, ξ) -> Needle x -+> Needle ξ Source

coerceNeedle' :: Functor p (->) (->) => p (x, ξ) -> Needle' x -+> Needle' ξ Source

oppositeLocalCoercion :: CanonicalDiffeomorphism ξ x Source

interiorLocalCoercion :: Functor p (->) (->) => p (x, ξ) -> CanonicalDiffeomorphism (Interior x) (Interior ξ) Source

Instances

LocallyCoercible Source 
LocallyCoercible (V1 ) Source 
LocallyCoercible (V1 ) Source 
NumPrime s => LocallyCoercible (V4 s) (V4 s) Source 
NumPrime s => LocallyCoercible (V3 s) (V3 s) Source 
NumPrime s => LocallyCoercible (V2 s) (V2 s) Source 
NumPrime s => LocallyCoercible (V1 s) (V1 s) Source 
NumPrime s => LocallyCoercible (V0 s) (ZeroDim s) Source 
NumPrime s => LocallyCoercible (V0 s) (V0 s) Source 
NumPrime s => LocallyCoercible (ZeroDim s) (V0 s) Source 
NumPrime s => LocallyCoercible (ZeroDim s) (ZeroDim s) Source 
LocallyCoercible (V4 ) ((, ), (, )) Source 
LocallyCoercible (V3 ) ((, ), ) Source 
LocallyCoercible (V3 ) (, (, )) Source 
LocallyCoercible (V2 ) (, ) Source 
LocallyCoercible ((, ), (, )) (V4 ) Source 
LocallyCoercible ((, ), ) (V3 ) Source 
LocallyCoercible (, (, )) (V3 ) Source 
LocallyCoercible (, ) (V2 ) Source 
(Semimanifold a, Semimanifold b, Semimanifold c, LSpace (Needle a), LSpace (Needle b), LSpace (Needle c), (~) * (Scalar (Needle a)) (Scalar (Needle b)), (~) * (Scalar (Needle b)) (Scalar (Needle c)), (~) * (Scalar (Needle' a)) (Scalar (Needle a)), (~) * (Scalar (Needle' b)) (Scalar (Needle b)), (~) * (Scalar (Needle' c)) (Scalar (Needle c))) => LocallyCoercible ((a, b), c) (a, (b, c)) Source 
LocallyCoercible ((, ), ) ((, ), ) Source 
(Semimanifold a, Semimanifold b, Semimanifold c, LSpace (Needle a), LSpace (Needle b), LSpace (Needle c), (~) * (Scalar (Needle a)) (Scalar (Needle b)), (~) * (Scalar (Needle b)) (Scalar (Needle c)), (~) * (Scalar (Needle' a)) (Scalar (Needle a)), (~) * (Scalar (Needle' b)) (Scalar (Needle b)), (~) * (Scalar (Needle' c)) (Scalar (Needle c))) => LocallyCoercible (a, (b, c)) ((a, b), c) Source 
LocallyCoercible (, (, )) (, (, )) Source 
LocallyCoercible (, ) (, ) Source 

coerceMetric :: forall x ξ. (LocallyCoercible x ξ, LSpace (Needle ξ)) => RieMetric ξ -> RieMetric x Source

coerceMetric' :: forall x ξ. (LocallyCoercible x ξ, LSpace (Needle ξ)) => RieMetric' ξ -> RieMetric' x Source