Surjection operad and interval cuts
SimplicialSets.Surjection — TypeSurjection{K}
Surjection{K}(u [; check = true]) where K
Surjection(u)
(surj::Surjection)(x::T) where T <: AbstractSimplex -> Linear{T}The type Surjection{K} represents elements of arity K in the surjection operad.
The first constructor return the surjection given by u TODO. If the optional keyword argument check is set to false, then it is not checked that u is indeed a surjection. The second constructor is equivalent to the first with K set to maximum(u; init = 0).
When a Surjection is applied to a simplex, the result is the corresponding interval cut operation. This evaluation is linear and supports the keyword arguments coefftype, addto, coeff and is_filtered as described for the macro @linear.
See also arity, deg(::Surjection), diff(::Surjection), SimplicialSets.is_surjection, LinearCombinations.linear_filter(::Surjection), LinearCombinations.@linear.
Examples
Surjection operad
julia> Surjection([1, 2, 3, 1])
Surjection{3}([1, 2, 3, 1])
julia> Surjection(Int[])
Surjection{0}(Int64[])Interval cuts
julia> using LinearCombinations: diff, deg
julia> surj = Surjection([1, 2, 1])
Surjection{2}([1, 2, 1])
julia> x = SymbolicSimplex(:x, 2)
x[0,1,2]
julia> surj(x)
Linear{Tensor{Tuple{SymbolicSimplex{Symbol}, SymbolicSimplex{Symbol}}}, Int64} with 3 terms:
-x[0,1,2]⊗x[0,1]-x[0,1,2]⊗x[1,2]+x[0,2]⊗x[0,1,2]
julia> diff(surj(x)) == diff(surj)(x) + (-1)^deg(surj) * surj(diff(x))
trueSimplicialSets.arity — Functionarity(surj::Surjection{K}) where K -> KReturn the arity of the surjection surj.
LinearCombinations.deg — Methoddeg(surj::Surjection) -> IntReturn the degree of surj, which is the number of repetitions in the sequence of values.
SimplicialSets.is_surjection — FunctionSimplicialSets.is_surjection(k::Integer, u::AbstractVector{<:Integer}) -> BoolReturn true if u defines a surjection of arity k, that is, if it contains all values between 1 and k and no other values. In this case the call Surjection{k}(u) would return successfully.
See also Surjection, arity.
SimplicialSets.isdegenerate — Methodisdegenerate(surj::Surjection) -> BoolA surjection is degenerate if two adjacent values are equal.
Examples
julia> isdegenerate(Surjection([1, 2, 1]))
false
julia> isdegenerate(Surjection([1, 1, 2]))
trueLinearCombinations.linear_filter — MethodLinearCombinations.linear_filter(surj::Surjection) -> BoolReturn true if surj is not degenerate.
See also LinearCombinations.linear_filter.
LinearCombinations.diff — Methoddiff(surj::Surjection{K}) where K -> Linear{Surjection{K}}Return the differential (or boundary) of surj in the surjection operad.
This function is linear and supports the keyword arguments coefftype, addto, coeff and is_filtered as described for the macro @linear.
See also LinearCombinations.@linear.
Example
julia> using LinearCombinations: diff
julia> surj = Surjection([1, 2, 1, 3, 1])
Surjection{3}([1, 2, 1, 3, 1])
julia> diff(surj)
Linear{Surjection{3}, Int64} with 3 terms:
Surjection{3}([1, 2, 1, 3])-Surjection{3}([1, 2, 3, 1])+Surjection{3}([2, 1, 3, 1])