MatmulPROOF.right_flat: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF Lines 1351-1366 of bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&start_line=1351&end_line=1366 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as ShapeLaws import bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend as MatrixIndex def right_flat(+right: Shape.Shape, +inner: U32, +right_inner: U32, +columns: U32, +column: Nat, +k: Nat, +re: {Shape.dimensions(right) == [right_inner, columns] : List<&2, U32>}, +compatible: {U32.to_nat(inner) == U32.to_nat(right_inner) : Nat}, +column_below: {Nat.is_lt(column, U32.to_nat(columns)) == True{} : Bool}, +below: {Nat.is_lt(k, U32.to_nat(inner)) == True{} : Bool}) -> {ShapeLaws.index_result(right, Shape.flatten_checked(right, [U32.from_nat(k), U32.from_nat(column)])) == Some{Matrix.right_index(U32.to_nat(columns), column, k)} : Maybe<&2, U32>}: +k_exact = MatrixIndex.word_below(k, inner, below) +column_exact = MatrixIndex.word_below(column, columns, column_below) Equal.trans(Maybe<&2, U32>, ShapeLaws.index_result(right, Shape.flatten_checked(right, [U32.from_nat(k), U32.from_nat(column)])), Some{U32.from_nat(Nat.add(Nat.mul(U32.to_nat(U32.from_nat(k)), U32.to_nat(columns)), U32.to_nat(U32.from_nat(column))))}, Some{U32.from_nat(Nat.add(Nat.mul(k, U32.to_nat(columns)), column))}, MatrixIndex.flat_pair(right, right_inner, columns, U32.from_nat(k), U32.from_nat(column), re, MatrixIndex.lt_same(U32.to_nat(U32.from_nat(k)), k, U32.to_nat(right_inner), k_exact, MatrixIndex.lt_bound(k, U32.to_nat(inner), U32.to_nat(right_inner), compatible, below)), MatrixIndex.lt_same(U32.to_nat(U32.from_nat(column)), column, U32.to_nat(columns), column_exact, column_below)), MatrixIndex.index_same(U32.to_nat(U32.from_nat(k)), U32.to_nat(U32.from_nat(column)), k, column, U32.to_nat(columns), k_exact, column_exact)) Uses (21): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Maybe 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/LAWS.bend&name=index_result 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=flatten_checked https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=right_index https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=flat_pair https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=index_same https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=lt_bound https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=lt_same https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matrix_index_proof.bend&name=word_below