def held_checked_success
bendtorch-core@0.1.0.0 · src/autograd/gradient_PROOF.bend:727
import bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend as GradientPROOF
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/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout
import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformProof
import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient
import bendtorch-core@0.1.0.0/src/autograd/gradient_LAWS.bend as Laws
727def held_checked_success(+shape: Shape.Shape, contribution: Core.Dynamic, +total_shape: Shape.Shape, total: Core.Tensor<total_shape>, same: Bool,
728 -decided: {same == Layout.words_same(Shape.dimensions(total_shape), Shape.dimensions(shape)) : Bool},
729 -fits: {Shape.dimensions(total_shape) == Shape.dimensions(shape) : List<&2, U32>},
730 -agrees: {Totality.dimensions(contribution) == Shape.dimensions(shape) : List<&2, U32>}) ->
731 Laws.Success<Gradient.held_checked(contribution, total_shape, total, same)>:
732 match same:
733 case False{}:
734 Laws.Success{Empty.absurd({False{} == True{} : Bool},
735 Arith.clash(Equal.trans(Bool, False{}, Layout.words_same(Shape.dimensions(total_shape), Shape.dimensions(shape)), True{}, decided,
736 %fits : {Layout.words_same(Shape.dimensions(total_shape), _) == True{} : Bool}
737 TransformProof.words_same_refl(Shape.dimensions(total_shape)))))}
738 case True{}:
739 Laws.Success{{\{Holds: proof => proof} :
740 Holds<{Laws.accumulated(Gradient.loop(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total})) == True{} : Bool}> ->
741 {Laws.accumulated(Gradient.loop(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total})) == True{} : Bool}}(
742 loop_success(Shape.elements(total_shape), total_shape, 0n, Gradient.State{contribution, total},
743 Equal.trans(List<&2, U32>, Totality.dimensions(contribution), Shape.dimensions(shape), Shape.dimensions(total_shape), agrees,
744 Equal.sym(List<&2, U32>, Shape.dimensions(total_shape), Shape.dimensions(shape), fits)),
745 full_loop(total_shape)))}