AxisAlgebra.facts_2: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra Lines 2134-2157 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=2134&end_line=2157 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis def facts_2(+axes: List<&2, Nat>, accepted: {True{} == Axis.valid(2n, axes) : Bool}) -> Facts<2n, axes>: match axes: case Nil{}: Empty.absurd(Facts<2n, Nil{}>, Shape.clash(accepted)) case +a0 <> Nil{}: Empty.absurd(Facts<2n, a0 <> Nil{}>, Shape.clash(accepted)) case 0n <> 0n <> Nil{}: Empty.absurd(Facts<2n, [0n, 0n]>, Shape.clash(accepted)) case 0n <> 1n <> Nil{}: Certified{{==}, {==}, {==}, A => items => length => lists_01(A, items, length), dims => length => product_01(dims, length), dims => coords => dl => cl => fit_01(dims, coords, dl, cl)} case 0n <> (2n+p) <> Nil{}: Empty.absurd(Facts<2n, 0n <> (2n+p) <> Nil{}>, Arith.lt_zero(p, Arith.and_left(Nat.is_lt(2n+p, 2n), Axis.bounded(Nil{}, 2n), Arith.and_left(Axis.bounded(0n <> (2n+p) <> Nil{}, 2n), Axis.unique(0n <> (2n+p) <> Nil{}), Equal.sym(Bool, True{}, Axis.valid(2n, 0n <> (2n+p) <> Nil{}), accepted))))) case 1n <> 0n <> Nil{}: Certified{{==}, {==}, {==}, A => items => length => lists_10(A, items, length), dims => length => product_10(dims, length), dims => coords => dl => cl => fit_10(dims, coords, dl, cl)} case 1n <> 1n <> Nil{}: Empty.absurd(Facts<2n, [1n, 1n]>, Shape.clash(accepted)) case 1n <> (2n+p) <> Nil{}: Empty.absurd(Facts<2n, 1n <> (2n+p) <> Nil{}>, Arith.lt_zero(p, Arith.and_left(Nat.is_lt(2n+p, 2n), Axis.bounded(Nil{}, 2n), Arith.and_left(Axis.bounded(1n <> (2n+p) <> Nil{}, 2n), Axis.unique(1n <> (2n+p) <> Nil{}), Equal.sym(Bool, True{}, Axis.valid(2n, 1n <> (2n+p) <> Nil{}), accepted))))) case (2n+p) <> a0 <> Nil{}: Empty.absurd(Facts<2n, (2n+p) <> a0 <> Nil{}>, Arith.lt_zero(p, Arith.and_left(Nat.is_lt(2n+p, 2n), Axis.bounded(a0 <> Nil{}, 2n), Arith.and_left(Axis.bounded((2n+p) <> a0 <> Nil{}, 2n), Axis.unique((2n+p) <> a0 <> Nil{}), Equal.sym(Bool, True{}, Axis.valid(2n, (2n+p) <> a0 <> Nil{}), accepted))))) case +a0 <> +a1 <> +a2 <> +tail: Empty.absurd(Facts<2n, a0 <> a1 <> a2 <> tail>, Shape.clash(accepted)) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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.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.is_lt https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=clash https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=and_left https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=lt_zero https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=Facts https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=fit_01 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=fit_10 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=lists_01 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=lists_10 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=product_01 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=product_10 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=bounded 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/axis_spec.bend&name=valid