AxisAlgebra.permutation_product: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra Lines 3067-3073 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=3067&end_line=3073 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 permutation_product(+shape: Shape.Shape, +axes: List<&2, U32>, accepted: {True{} == Layout.bijective(shape, axes) : Bool}) -> {Shape.logical_numel(Axis.order(U32, Shape.dimensions(shape), Shape.naturals(axes))) == Shape.logical_numel(Shape.dimensions(shape)) : Nat}: Equal.trans(Nat, Shape.logical_numel(Axis.order(U32, Shape.dimensions(shape), Shape.naturals(axes))), Shape.numel(Axis.order(Nat, Shape.naturals(Shape.dimensions(shape)), Shape.naturals(axes))), Shape.logical_numel(Shape.dimensions(shape)), Equal.cong(List<&2, Nat>, Nat, dims => Shape.numel(dims), Shape.naturals(Axis.order(U32, Shape.dimensions(shape), Shape.naturals(axes))), Axis.order(Nat, Shape.naturals(Shape.dimensions(shape)), Shape.naturals(axes)), order_naturals(Shape.naturals(axes), Shape.dimensions(shape))), facts_product(Shape.rank_dimensions(Shape.dimensions(shape)), Shape.naturals(axes), Shape.naturals(Shape.dimensions(shape)), Equal.sym(Nat, Shape.rank_dimensions(Shape.dimensions(shape)), List.length(&2, Nat, Shape.naturals(Shape.dimensions(shape))), Shape.rank_naturals(Shape.dimensions(shape))), shape_facts(shape, axes, accepted))) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=logical_numel 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/shape/core.bend&name=numel https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=rank_dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=rank_naturals https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=facts_product https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=order_naturals https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=shape_facts https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=order https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=bijective