GradientPROOF.contribution_retains: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend as GradientPROOF Lines 182-199 of bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend&start_line=182&end_line=199 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core import bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend as Totality import bendtorch-core@0.1.0.0/src/tensor/elementwise_PROOF.bend as ElementwiseProof import bendtorch-core@0.1.0.0/src/autograd/gradient.bend as Gradient def contribution_retains(-shape: Shape.Shape, +index: U32, total: Core.Tensor, -original: Core.Dynamic, pair: Core.Dynamic & Result<&2, &2, Core.Error, F32>, -same: Totality.SameSource(original, ElementwiseProof.dynamic_read_owner(pair))) -> Holds: (contribution, result) = pair match result: case Fail{error}: Holds{same} case Done{value}: Holds{property => Equal.trans(Totality.Inspection, Totality.inspect(property, step_owner(shape, Gradient.step_total(shape, index, contribution, value, Core.read_flat(shape, total, index)))), Totality.inspect(property, contribution), Totality.inspect(property, original), Equal.cong(Core.Dynamic, Totality.Inspection, owner => Totality.inspect(property, owner), step_owner(shape, Gradient.step_total(shape, index, contribution, value, Core.read_flat(shape, total, index))), contribution, {\{Holds: proof => proof} : Holds<{step_owner(shape, Gradient.step_total(shape, index, contribution, value, Core.read_flat(shape, total, index))) == contribution : Core.Dynamic}> -> {step_owner(shape, Gradient.step_total(shape, index, contribution, value, Core.read_flat(shape, total, index))) == contribution : Core.Dynamic}}( total_owner(shape, index, contribution, value, Core.read_flat(shape, total, index)))), same(property))} Uses (21): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient.bend&name=step_contribution https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient.bend&name=step_total https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend&name=Holds https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend&name=step_owner https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/gradient_PROOF.bend&name=total_owner https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Dynamic https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=Tensor https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/core.bend&name=read_flat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_PROOF.bend&name=dynamic_read_owner https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend&name=Inspection https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend&name=SameSource https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_totality.bend&name=inspect