TensorBackwardPROOF.operands_bounded: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/tensor_backward_PROOF.bend as TensorBackwardPROOF Lines 296-330 of bendtorch-core@0.1.0.0/src/autograd/tensor_backward_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_PROOF.bend&start_line=296&end_line=330 import Base import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward import bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend as Laws def operands_bounded(+node: Backward.Node, +bound: Nat) -> {Backward.operands_below(node, bound) == Laws.bounded(Laws.targets(node), bound) : Bool}: match node: case Backward.Leaf{}: {==} case Backward.Add{a, b, left, right}: pair_bounded(a, b, bound) case Backward.Sub{a, b, left, right}: pair_bounded(a, b, bound) case Backward.Mul{a, b, left, right}: pair_bounded(a, b, bound) case Backward.Sum{a, input}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.SumDims{a, input, kept}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.Matmul{a, b, left, right}: pair_bounded(a, b, bound) case Backward.MatmulNT{a, b, left, right}: pair_bounded(a, b, bound) case Backward.Relu{a, input}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.MseLoss{a, b, left, right}: pair_bounded(a, b, bound) case Backward.CrossEntropy{a, input}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.BatchedMatmul{a, b, left, right}: pair_bounded(a, b, bound) case Backward.Slice{a, input, kept, plan}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.Gathered{a, input, plan, entries}: Equal.sym(Bool, Bool.and(Nat.is_lt(a, bound), True{}), Nat.is_lt(a, bound), and_true(Nat.is_lt(a, bound))) case Backward.Constant{}: {==} case Backward.Frozen{id, inner}: operands_bounded(inner, bound) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym 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/autograd/tensor_backward.bend&name=Node https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=operands_below https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend&name=bounded https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_LAWS.bend&name=targets https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_PROOF.bend&name=and_true https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward_PROOF.bend&name=pair_bounded