The objective remaining at a backward-sweep frontier #
Processed rows remain in the executable coefficient array. The invariant sums only unprocessed nodes and the designated input, so those stale rows are never counted twice.
The designated input remains live after its position has passed in the reverse sweep.
Instances For
def
NN.MLTheory.CROWN.Graph.DirectedBackward.Represents
{α : Type}
[TorchLean.Storage α]
[Context α]
[BoundOps α]
[LawfulBoundOps α]
(dims : ℕ → ℕ)
(v : ℕ → ℕ → ℝ)
(input k : ℕ)
(st : Internal.DirectedBackwardState α)
(z : ℝ)
:
The executable state encloses coefficients of one exact remaining objective.
Instances For
theorem
NN.MLTheory.CROWN.Graph.DirectedBackward.frontier_succ
{dims : ℕ → ℕ}
{v : ℕ → ℕ → ℝ}
{input k : ℕ}
(hk : k ≠ input)
(f : ℕ → ℕ → ℝ)
(c : ℝ)
:
frontierValue dims v input (k + 1) f c = frontierValue dims v input k f c + dot (dims k) (f k) (v k)
Dropping a non-input frontier row subtracts precisely that row's objective.
theorem
NN.MLTheory.CROWN.Graph.DirectedBackward.represents_add
{α : Type}
[TorchLean.Storage α]
[Context α]
[BoundOps α]
[LawfulBoundOps α]
{dims : ℕ → ℕ}
{v : ℕ → ℕ → ℝ}
{input k : ℕ}
{st : Internal.DirectedBackwardState α}
{z : ℝ}
(h : Represents dims v input k st z)
(pid : ℕ)
(hp : pid < st.coeffs.size)
(hlive : pid ∈ pending input k)
(box : FlatBox α)
(a : ℕ → ℝ)
(ha : RowEncloses box (dims pid) a)
:
Represents dims v input k (Internal.addDirectedCoeff st pid box) (z + dot (dims pid) a (v pid))
Adding an enclosed coefficient contribution preserves the exact objective relation.
theorem
NN.MLTheory.CROWN.Graph.DirectedBackward.represents_addConstant
{α : Type}
[TorchLean.Storage α]
[Context α]
[BoundOps α]
[LawfulBoundOps α]
{dims : ℕ → ℕ}
{v : ℕ → ℕ → ℝ}
{input k : ℕ}
{st : Internal.DirectedBackwardState α}
{z : ℝ}
(h : Represents dims v input k st z)
(lo hi : α)
(d : ℝ)
(hd : LawfulBoundOps.toReal lo ≤ d ∧ d ≤ LawfulBoundOps.toReal hi)
:
Represents dims v input k (Internal.addDirectedConstant st lo hi) (z + d)
Adding an enclosed constant changes the represented objective by its exact real value.
theorem
NN.MLTheory.CROWN.Graph.DirectedBackward.represents_drop_none
{α : Type}
[TorchLean.Storage α]
[Context α]
[BoundOps α]
[LawfulBoundOps α]
{dims : ℕ → ℕ}
{v : ℕ → ℕ → ℝ}
{input k : ℕ}
{st : Internal.DirectedBackwardState α}
{z : ℝ}
(h : Represents dims v input (k + 1) st z)
(hk : k ≠ input)
(hsize : k < st.coeffs.size)
(hnone : st.coeffs[k]! = none)
:
Represents dims v input k st z
An absent non-input row contributes zero when its position passes the frontier.
theorem
NN.MLTheory.CROWN.Graph.DirectedBackward.represents_drop_some
{α : Type}
[TorchLean.Storage α]
[Context α]
[BoundOps α]
[LawfulBoundOps α]
{dims : ℕ → ℕ}
{v : ℕ → ℕ → ℝ}
{input k : ℕ}
{st : Internal.DirectedBackwardState α}
{z : ℝ}
(h : Represents dims v input (k + 1) st z)
(hk : k ≠ input)
(hsize : k < st.coeffs.size)
{box : FlatBox α}
(hsome : st.coeffs[k]! = some box)
:
∃ (a : ℕ → ℝ), RowEncloses box (dims k) a ∧ Represents dims v input k st (z - dot (dims k) a (v k))
A present row supplies the exact coefficient consumed by the next backward step.