AxisAlgebra.fit_01: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra Lines 392-409 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=392&end_line=409 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis def fit_01(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 2n : Nat}, cl: {List.length(&2, Nat, coords) == 2n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, [0n, 1n]), Axis.order(Nat, coords, [0n, 1n])) == Shape.fit(dims, coords) : Bool}: match dims: case Nil{}: Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, [0n, 1n]), Axis.order(Nat, coords, [0n, 1n])) == Shape.fit(Nil{}, coords) : Bool}, nat_clash(0n, 2n, dl, {==})) case +d0 <> Nil{}: Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> Nil{}, [0n, 1n]), Axis.order(Nat, coords, [0n, 1n])) == Shape.fit(d0 <> Nil{}, coords) : Bool}, nat_clash(1n, 2n, dl, {==})) case +d0 <> +d1 <> Nil{}: match coords: case Nil{}: Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [0n, 1n]), Axis.order(Nat, Nil{}, [0n, 1n])) == Shape.fit(d0 <> d1 <> Nil{}, Nil{}) : Bool}, nat_clash(0n, 2n, cl, {==})) case +c0 <> Nil{}: Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [0n, 1n]), Axis.order(Nat, c0 <> Nil{}, [0n, 1n])) == Shape.fit(d0 <> d1 <> Nil{}, c0 <> Nil{}) : Bool}, nat_clash(1n, 2n, cl, {==})) case +c0 <> +c1 <> Nil{}: {==} case +c0 <> +c1 <> +c2 <> +ct: Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [0n, 1n]), Axis.order(Nat, c0 <> c1 <> c2 <> ct, [0n, 1n])) == Shape.fit(d0 <> d1 <> Nil{}, c0 <> c1 <> c2 <> ct) : Bool}, nat_clash(3n+List.length(&2, Nat, ct), 2n, cl, {==})) case +d0 <> +d1 <> +d2 <> +dt: Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> dt, [0n, 1n]), Axis.order(Nat, coords, [0n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> dt, coords) : Bool}, nat_clash(3n+List.length(&2, Nat, dt), 2n, dl, {==})) Uses (8): 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=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=bendtorch-core@0.1.0.0/src/shape/core.bend&name=fit https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&name=nat_clash https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=order