MatmulPROOF.inner_right: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF Lines 1220-1244 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=1220&end_line=1244 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/storage/arith.bend as Arith def inner_right(-left: Shape.Shape, +right: Shape.Shape, +rows: U32, +inner: U32, -le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}, +dims: List<&2, U32>, -same: {dims == Shape.dimensions(right) : List<&2, U32>}, -wanted_inner: U32, -right_inner: U32, -columns: U32, right_matrix: {dims == [right_inner, columns] : List<&2, U32>}, inner_same: {U32.to_nat(inner) == U32.to_nat(wanted_inner) : Nat}, mismatch: {U32.to_nat(wanted_inner) != U32.to_nat(right_inner) : Nat}) -> {Matrix.plan_right(left, right, rows, inner, le, dims, same) == Fail{Matrix.InnerDimensionMismatch{}} : Result<&2, &2, Matrix.Error, Matrix.Plan>}: match dims: case +ri <> +c <> Nil{}: compatible_inner(left, right, rows, inner, ri, c, le, Equal.sym(List<&2, U32>, [ri, c], Shape.dimensions(right), same), equal => mismatch(Equal.trans(Nat, U32.to_nat(wanted_inner), U32.to_nat(inner), U32.to_nat(right_inner), Equal.sym(Nat, U32.to_nat(inner), U32.to_nat(wanted_inner), inner_same), Equal.trans(Nat, U32.to_nat(inner), U32.to_nat(ri), U32.to_nat(right_inner), equal, Equal.cong(List<&2, U32>, Nat, first_nat, [ri, c], [right_inner, columns], right_matrix)))), Shape.bool_case(Nat.is_eq(U32.to_nat(inner), U32.to_nat(ri)))) case Nil{}: Empty.absurd({Matrix.plan_right(left, right, rows, inner, le, Nil{}, same) == Fail{Matrix.InnerDimensionMismatch{}} : Result<&2, &2, Matrix.Error, Matrix.Plan>}, Arith.clash(Equal.cong(List<&2, U32>, Bool, xs => Nat.is_eq(Shape.rank_dimensions(xs), 2n), Nil{}, [right_inner, columns], right_matrix))) case +x <> Nil{}: Empty.absurd({Matrix.plan_right(left, right, rows, inner, le, [x], same) == Fail{Matrix.InnerDimensionMismatch{}} : Result<&2, &2, Matrix.Error, Matrix.Plan>}, Arith.clash(Equal.cong(List<&2, U32>, Bool, xs => Nat.is_eq(Shape.rank_dimensions(xs), 2n), [x], [right_inner, columns], right_matrix))) case +x <> +y <> +z <> +t: Empty.absurd({Matrix.plan_right(left, right, rows, inner, le, x <> y <> z <> t, same) == Fail{Matrix.InnerDimensionMismatch{}} : Result<&2, &2, Matrix.Error, Matrix.Plan>}, Arith.clash(Equal.cong(List<&2, U32>, Bool, xs => Nat.is_eq(Shape.rank_dimensions(xs), 2n), x <> y <> z <> t, [right_inner, columns], right_matrix))) Uses (22): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Empty.absurd 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result 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=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=bool_case 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=rank_dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=clash https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=plan_right https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=compatible_inner https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=first_nat