TransposePROOF.transposed_index_exact: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/transpose_PROOF.bend as TransposePROOF Lines 237-252 of bendtorch-core@0.1.0.0/src/tensor/transpose_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/transpose_PROOF.bend&start_line=237&end_line=252 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend as MatrixIndex import bendtorch-core@0.1.0.0/src/shape/nat_proofs.bend as Nats # j * rows + l < rows * columns, so the output index is its own word. def transposed_index_exact(+input: Shape.Shape, +rows: U32, +columns: U32, +matrix: {Shape.dimensions(input) == [rows, columns] : List<&2, U32>}, +j: Nat, +j_below: {Nat.is_lt(j, U32.to_nat(columns)) == True{} : Bool}, +l: Nat, +l_below: {Nat.is_lt(l, U32.to_nat(rows)) == True{} : Bool}) -> {U32.to_nat(U32.from_nat(Nat.add(Nat.mul(j, U32.to_nat(rows)), l))) == Nat.add(Nat.mul(j, U32.to_nat(rows)), l) : Nat}: +r = U32.to_nat(rows) +c = U32.to_nat(columns) MatrixIndex.word_exact(Nat.add(Nat.mul(j, r), l), input, %Equal.sym(List<&2, U32>, Shape.dimensions(input), [rows, columns], matrix) : {Nat.is_lt(Nat.add(Nat.mul(j, r), l), Shape.logical_numel(_)) == True{} : Bool} %Equal.sym(Nat, Nat.mul(c, 1n), c, Nats.mul_one_right(c)) : {Nat.is_lt(Nat.add(Nat.mul(j, r), l), Nat.mul(r, _)) == True{} : Bool} %Nats.mul_comm(c, r) : {Nat.is_lt(Nat.add(Nat.mul(j, r), l), _) == True{} : Bool} MatrixIndex.lt_mul_add(j, c, l, r, j_below, l_below)) Uses (17): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.from_nat 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=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/nat_proofs.bend&name=mul_comm https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/nat_proofs.bend&name=mul_one_right https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=lt_mul_add https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=word_exact