Centroid of a Finite Set of Points in Affine Space #
This file defines the centroid of a finite set of points in an affine space over a division ring.
Main definitions #
centroidWeights
: A constant weight function assigning to each index in aFinset
the same weight, equal to the reciprocal of the number of elements.centroid
: the centroid of aFinset
of points, defined as the affine combination usingcentroidWeights
.
The weights for the centroid of some points.
Equations
- Finset.centroidWeights k s = Function.const ι (↑s.card)⁻¹
Instances For
centroidWeights
at any point.
centroidWeights
equals a constant function.
The weights in the centroid sum to 1, if the number of points,
converted to k
, is not zero.
In the characteristic zero case, the weights in the centroid sum to 1 if the number of points is not zero.
In the characteristic zero case, the weights in the centroid sum to 1 if the set is nonempty.
In the characteristic zero case, the weights in the centroid sum
to 1 if the number of points is n + 1
.
The centroid of some points. Although defined for any s
, this
is intended to be used in the case where the number of points,
converted to k
, is not zero.
Equations
- Finset.centroid k s p = (Finset.affineCombination k s p) (Finset.centroidWeights k s)
Instances For
The definition of the centroid.
The centroid of a single point.
The centroid of two points, expressed directly as adding a vector to a point.
The centroid of two points indexed by Fin 2
, expressed directly
as adding a vector to the first point.
A centroid, over the image of an embedding, equals a centroid with
the same points and weights over the original Finset
.
centroidWeights
gives the weights for the centroid as a
constant function, which is suitable when summing over the points
whose centroid is being taken. This function gives the weights in a
form suitable for summing over a larger set of points, as an indicator
function that is zero outside the set whose centroid is being taken.
In the case of a Fintype
, the sum may be over univ
.
Equations
- Finset.centroidWeightsIndicator k s = (↑s).indicator (Finset.centroidWeights k s)
Instances For
The definition of centroidWeightsIndicator
.
The sum of the weights for the centroid indexed by a Fintype
.
In the characteristic zero case, the weights in the centroid
indexed by a Fintype
sum to 1 if the number of points is not
zero.
In the characteristic zero case, the weights in the centroid
indexed by a Fintype
sum to 1 if the set is nonempty.
In the characteristic zero case, the weights in the centroid
indexed by a Fintype
sum to 1 if the number of points is n + 1
.
The centroid as an affine combination over a Fintype
.
An indexed family of points that is injective on the given
Finset
has the same centroid as the image of that Finset
. This is
stated in terms of a set equal to the image to provide control of
definitional equality for the index type used for the centroid of the
image.
Two indexed families of points that are injective on the given
Finset
s and with the same points in the image of those Finset
s
have the same centroid.
The centroid lies in the affine span if the number of points,
converted to k
, is not zero.
In the characteristic zero case, the centroid lies in the affine span if the number of points is not zero.
In the characteristic zero case, the centroid lies in the affine span if the set is nonempty.
In the characteristic zero case, the centroid lies in the affine
span if the number of points is n + 1
.