def fit_021
bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:527
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
527def fit_021(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 3n : Nat}, cl: {List.length(&2, Nat, coords) == 3n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, [0n, 2n, 1n]), Axis.order(Nat, coords, [0n, 2n, 1n])) == Shape.fit(dims, coords) : Bool}:
528 match dims:
529 case Nil{}:
530 Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, [0n, 2n, 1n]), Axis.order(Nat, coords, [0n, 2n, 1n])) == Shape.fit(Nil{}, coords) : Bool}, nat_clash(0n, 3n, dl, {==}))
531 case +d0 <> Nil{}:
532 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, coords, [0n, 2n, 1n])) == Shape.fit(d0 <> Nil{}, coords) : Bool}, nat_clash(1n, 3n, dl, {==}))
533 case +d0 <> +d1 <> Nil{}:
534 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, coords, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> Nil{}, coords) : Bool}, nat_clash(2n, 3n, dl, {==}))
535 case +d0 <> +d1 <> +d2 <> Nil{}:
536 match coords:
537 case Nil{}:
538 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, Nil{}, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, Nil{}) : Bool}, nat_clash(0n, 3n, cl, {==}))
539 case +c0 <> Nil{}:
540 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, c0 <> Nil{}, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, c0 <> Nil{}) : Bool}, nat_clash(1n, 3n, cl, {==}))
541 case +c0 <> +c1 <> Nil{}:
542 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, c0 <> c1 <> Nil{}, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, c0 <> c1 <> Nil{}) : Bool}, nat_clash(2n, 3n, cl, {==}))
543 case +c0 <> +c1 <> +c2 <> Nil{}:
544 Equal.trans(Bool, Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), True{}))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), 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), True{}))), Equal.cong(Bool, Bool, value => Bool.and(Nat.is_lt(c0, d0), value), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), True{})), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), True{})), and_swap(Nat.is_lt(c2, d2), Nat.is_lt(c1, d1), True{})), {==})
545 case +c0 <> +c1 <> +c2 <> +c3 <> +ct:
546 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [0n, 2n, 1n]), Axis.order(Nat, c0 <> c1 <> c2 <> c3 <> ct, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, c0 <> c1 <> c2 <> c3 <> ct) : Bool}, nat_clash(4n+List.length(&2, Nat, ct), 3n, cl, {==}))
547 case +d0 <> +d1 <> +d2 <> +d3 <> +dt:
548 Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> dt, [0n, 2n, 1n]), Axis.order(Nat, coords, [0n, 2n, 1n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> dt, coords) : Bool}, nat_clash(4n+List.length(&2, Nat, dt), 3n, dl, {==}))