def fit_0132
bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:833
import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
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
833def fit_0132(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 4n : Nat}, cl: {List.length(&2, Nat, coords) == 4n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(dims, coords) : Bool}:
834 match dims:
835 case Nil{}:
836 Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(Nil{}, coords) : Bool}, nat_clash(0n, 4n, dl, {==}))
837 case +d0 <> Nil{}:
838 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> Nil{}, coords) : Bool}, nat_clash(1n, 4n, dl, {==}))
839 case +d0 <> +d1 <> Nil{}:
840 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> Nil{}, coords) : Bool}, nat_clash(2n, 4n, dl, {==}))
841 case +d0 <> +d1 <> +d2 <> Nil{}:
842 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, coords) : Bool}, nat_clash(3n, 4n, dl, {==}))
843 case +d0 <> +d1 <> +d2 <> +d3 <> Nil{}:
844 match coords:
845 case Nil{}:
846 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, Nil{}, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, Nil{}) : Bool}, nat_clash(0n, 4n, cl, {==}))
847 case +c0 <> Nil{}:
848 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, c0 <> Nil{}, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> Nil{}) : Bool}, nat_clash(1n, 4n, cl, {==}))
849 case +c0 <> +c1 <> Nil{}:
850 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, c0 <> c1 <> Nil{}, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> Nil{}) : Bool}, nat_clash(2n, 4n, cl, {==}))
851 case +c0 <> +c1 <> +c2 <> Nil{}:
852 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, c0 <> c1 <> c2 <> Nil{}, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> c2 <> Nil{}) : Bool}, nat_clash(3n, 4n, cl, {==}))
853 case +c0 <> +c1 <> +c2 <> +c3 <> Nil{}:
854 Equal.trans(Bool, Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), Bool.and(Nat.is_lt(c2, d2), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Equal.cong(Bool, Bool, value => Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), value)), Bool.and(Nat.is_lt(c3, d3), Bool.and(Nat.is_lt(c2, d2), True{})), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})), and_swap(Nat.is_lt(c3, d3), Nat.is_lt(c2, d2), True{})), {==})
855 case +c0 <> +c1 <> +c2 <> +c3 <> +c4 <> +ct:
856 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [0n, 1n, 3n, 2n]), Axis.order(Nat, c0 <> c1 <> c2 <> c3 <> c4 <> ct, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> c2 <> c3 <> c4 <> ct) : Bool}, nat_clash(5n+List.length(&2, Nat, ct), 4n, cl, {==}))
857 case +d0 <> +d1 <> +d2 <> +d3 <> +d4 <> +dt:
858 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> d4 <> dt, [0n, 1n, 3n, 2n]), Axis.order(Nat, coords, [0n, 1n, 3n, 2n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> d4 <> dt, coords) : Bool}, nat_clash(5n+List.length(&2, Nat, dt), 4n, dl, {==}))