I’d like to understand the ideas behind the way Bijectors handles simplices.

First, something I think I understand, for comparison:

# TransformVariables

```
julia> using TransformVariables
julia> t = UnitSimplex(4)
UnitSimplex(4)
julia> t(ones(3))
4-element Vector{Float64}:
0.4753668864186717
0.3022499950414722
0.16257508655105501
0.05980803198880098
```

A space with four numbers that add to one has three degrees of freedom, so the input here takes `ones(3)`

. Giving it more throws an error:

```
julia> t(ones(4))
ERROR: ArgumentError: dimension(t) == length(x) must hold. Got
dimension(t) => 3
length(x) => 4
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/ArgCheck/5xEDR/src/checks.jl:243 [inlined]
[2] transform
@ ~/.julia/packages/TransformVariables/N5VYB/src/generic.jl:228 [inlined]
[3] (::UnitSimplex)(x::Vector{Float64})
@ TransformVariables ~/.julia/packages/TransformVariables/N5VYB/src/generic.jl:123
[4] top-level scope
@ REPL[14]:1
```

This is all as I would expect.

# Bijectors

The corresponding code in Bijectors seems to be

```
julia> using Bijectors
julia> t = Bijectors.SimplexBijector()
Bijectors.SimplexBijector{1, true}()
julia> inv(t)(ones(4))
4-element Vector{Float64}:
0.4753668864186717
0.30224999504147226
0.16257508655105507
0.059808031988801025
```

It’s the same result (up to what looks like maybe rounding error). But it requires one more dimension than is needed! To confirm this,

```
julia> inv(t)(ones(4)) |> t
4-element Vector{Float64}:
1.0000000000000002
1.0
1.0
0.0
```

This shows that the `t`

is not a bijection. Given that it’s possible to set up so it *is* a bijection, what’s behind this design choice?