manifolds-core-0.4.1.0: The basic classes for the manifolds hierarchy.

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

Math.Manifold.Core.PseudoAffine

Description

 

Synopsis

Documentation

data SemimanifoldWitness x where Source

This is the reified form of the property that the interior of a semimanifold is a manifold. These constraints would ideally be expressed directly as superclass constraints, but that would require the UndecidableSuperclasses extension, which is not reliable yet.

Also, if all those equality constraints are in scope, GHC tends to infer needlessly complicated types like Interior (Interior (Needle (Interior x))), which is the same as just Needle x.

class AdditiveGroup (Needle x) => Semimanifold x where Source

Minimal complete definition

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

Associated Types

type Needle x :: * Source

The space of “natural” ways starting from some reference point and going to some particular target point. Hence, the name: like a compass needle, but also with an actual length. For affine spaces, Needle is simply the space of line segments (aka vectors) between two points, i.e. the same as Diff. The AffineManifold constraint makes that requirement explicit.

This space should be isomorphic to the tangent space (and is in fact used somewhat synonymously).

type Interior x :: * Source

Manifolds with boundary are a bit tricky. We support such manifolds, but carry out most calculations only in “the fleshy part” – the interior, which is an “infinite space”, so you can arbitrarily scale paths.

The default implementation is Interior x = x, which corresponds to a manifold that has no boundary to begin with.

Methods

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

Generalised translation operation. Note that the result will always also be in the interior; scaling up the needle can only get you ever closer to a boundary.

fromInterior :: Interior x -> x Source

id sans boundary.

toInterior :: x -> Maybe (Interior x) Source

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

The signature of .+~^ should really be Interior x -> Needle x -> Interior x, only, this is not possible because it only consists of non-injective type families. The solution is this tagged signature, which is of course rather unwieldy. That's why .+~^ has the stronger, but easier usable signature. Without boundary, these functions should be equivalent, i.e. translateP = Tagged (.+~^).

(.-~^) :: Interior x -> Needle x -> x infixl 6 Source

Shorthand for \p v -> p .+~^ negateV v, which should obey the asymptotic law

p .-~^ v .+~^ v ≅ p

Meaning: if v is scaled down with sufficiently small factors η, then the difference (p.-~^v.+~^v) .-~. p should scale down even faster: as O (η²). For large vectors, it will however behave differently, except in flat spaces (where all this should be equivalent to the AffineSpace instance).

semimanifoldWitness :: SemimanifoldWitness x Source

class Semimanifold x => PseudoAffine x where Source

This is the class underlying manifolds. (Manifold only precludes boundaries and adds an extra constraint that would be circular if it was in a single class. You can always just use Manifold as a constraint in your signatures, but you must define only PseudoAffine for manifold types – the Manifold instance follows universally from this, if 'Interior x ~ x.)

The interface is (boundaries aside) almost identical to the better-known AffineSpace class, but we don't require associativity of .+~^ with ^+^ – except in an asymptotic sense for small vectors.

That innocent-looking change makes the class applicable to vastly more general types: while an affine space is basically nothing but a vector space without particularly designated origin, a pseudo-affine space can have nontrivial topology on the global scale, and yet be used in practically the same way as an affine space. At least the usual spheres and tori make good instances, perhaps the class is in fact equivalent to manifolds in their usual maths definition (with an atlas of charts: a family of overlapping regions of the topological space, each homeomorphic to the Needle vector space or some simply-connected subset thereof).

Minimal complete definition

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

Methods

(.-~.) :: x -> x -> Maybe (Needle x) infix 6 Source

The path reaching from one point to another. Should only yield Nothing if

  • The points are on disjoint segments of a non–path-connected space.
  • Either of the points is on the boundary. Use |-~. to deal with this.

On manifolds, the identity

p .+~^ (q.-~.p) ≡ q

should hold, at least save for floating-point precision limits etc..

.-~. and .+~^ only really work in manifolds without boundary. If you consider the path between two points, one of which lies on the boundary, it can't really be possible to scale this path any longer – it would have to reach “out of the manifold”. To adress this problem, these functions basically consider only the interior of the space.

(.-~!) :: x -> x -> Needle x infix 6 Source

Unsafe version of .-~.. If the two points lie in disjoint regions, the behaviour is undefined.

pseudoAffineWitness :: PseudoAffineWitness x Source

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

Interpolate between points, approximately linearly. For points that aren't close neighbours (i.e. lie in an almost flat region), the pathway is basically undefined – save for its end points.

A proper, really well-defined (on global scales) interpolation only makes sense on a Riemannian manifold, as Geodesic.

palerpB :: forall x. (PseudoAffine x, VectorSpace (Needle x), Scalar (Needle x) ~ ) => x -> x -> Maybe ( -> x) Source

Like palerp, but actually restricted to the interval between the points, with a signature like geodesicBetween rather than alerp.

alerpB :: forall x. (AffineSpace x, VectorSpace (Diff x), Scalar (Diff x) ~ ) => x -> x -> -> x Source

Like alerp, but actually restricted to the interval between the points.