AxisAlgebra.unique: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra Lines 110-119 of bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&start_line=110&end_line=119 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis def unique(+axes: List<&2, U32>) -> {Layout.unique(axes) == Axis.unique(Shape.naturals(axes)) : Bool}: match axes: case Nil{}: {==} case +head <> +tail: %Equal.sym(Bool, Layout.contains(head, tail), Axis.contains(U32.to_nat(head), Shape.naturals(tail)), contains(tail, head)) : {Bool.and(Bool.not(_), Layout.unique(tail)) == Axis.unique(Shape.naturals(head <> tail)) : Bool} %Equal.sym(Bool, Layout.unique(tail), Axis.unique(Shape.naturals(tail)), unique(tail)) : {Bool.and(Bool.not(Axis.contains(U32.to_nat(head), Shape.naturals(tail))), _) == Axis.unique(Shape.naturals(head <> tail)) : Bool} {==} Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=naturals https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=contains https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=contains https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=unique https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=contains https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=unique