Query Bounds for Iteration Constructs #
This file lifts the structural query-bound predicates (IsTotalQueryBound,
IsQueryBoundP, IsPerIndexQueryBound) across the iteration combinators
OracleComp.replicate, OracleComp.replicateTR, List.mapM, and List.foldlM.
For the fixed-body case replicate n oa, the bound is exactly multiplicative —
we get an iff between the loop bound n * k and the body bound k (when
0 < n) for IsTotalQueryBound and IsQueryBoundP. The reverse direction
goes through isTotalQueryBound_iff_counting_total_le /
isQueryBoundP_iff_counting_filter_le and a witness lemma showing every
counting-oracle support point of oa lifts to an n-fold copy in
replicate n oa.
For the variable-body case (List.mapM / List.foldlM), only the forward
direction is available: the loop bound is the element-wise sum of body bounds.
Forward replicate bounds #
Divide-trick iff for the fixed-body case #
When the body oa is fixed, the loop bound n * k is exactly characterized by the body
bound k: forward by isTotalQueryBound_replicate, reverse by lifting any
counting-oracle support point of oa to an n-fold copy in replicate n oa.