1-- Convolution over arbitrary finite bounds containing every support pair (ZF).2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.Algebra.Polynomial.ConvolutionBounds8import ConvolutionLaws910theorem polynomialPairCoefficient.pair (I A add zero neg mul one p q u v : Set)11requiresring : IsCommRing(A, add, zero, neg, mul, one)12requires memberP : p ∈ polynomials(I, A, zero)13requires memberQ : q ∈ polynomials(I, A, zero)14requires monomialU : u ∈ monomials(I)15requires monomialV : v ∈ monomials(I)16shows polynomialPairCoefficient(I, A, add, zero, neg, mul, one, p, q, (u, v)) = call2(mul, p(u), q(v))17proof18have pair := product.pair at u, v, monomials(I), monomials(I) with*19have selected := polynomialPairCoefficient.selected at I, A, add, zero, neg, mul, one, p, q, (u, v) with*20obtain⟨a, ha, b, hb, shape, output⟩:= selected.right21have coordinates := orderedPair.injective with shape22cc2324defgraph boundedConvolutionWeights (I D A add zero neg mul one p q : Set) (t ∈ D) : A :=25 polynomialPairCoefficient(I, A, add, zero, neg, mul, one, p, q, t)26requiresring : IsCommRing(A, add, zero, neg, mul, one)27requires memberP : p ∈ polynomials(I, A, zero)28requires memberQ : q ∈ polynomials(I, A, zero)29requires domain : D ⊆ monomials(I) × monomials(I)30proof31have pair := domain with t, member32have selected := polynomialPairCoefficient.selected at I, A, add, zero, neg, mul, one, p, q, t with*33exact selected.left3435section Bounds36variable (I D A add zero neg mul one p q : Set)37hypothesisring : IsCommRing(A, add, zero, neg, mul, one)38hypothesis memberP : p ∈ polynomials(I, A, zero)39hypothesis memberQ : q ∈ polynomials(I, A, zero)40hypothesis domain : D ⊆ monomials(I) × monomials(I)41notationring R := (A, add, zero, neg, mul, one)4243theorem boundedConvolutionWeights.pair (u v : Set)44requires pair : (u, v) ∈ D45requires monomialU : u ∈ monomials(I)46requires monomialV : v ∈ monomials(I)47shows boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q)((u, v)) = p(u) * q(v)48proof49have value := boundedConvolutionWeights.value at I, D, A, add, zero, neg, mul, one, p, q, (u, v) with*50have coefficient := polynomialPairCoefficient.pair at I, A, add, zero, neg, mul, one, p, q, u, v with*51cc5253theorem boundedConvolutionWeights.outside (t : Set)54requires pair : t ∈ D55requires outside : ¬(t ∈ convolutionPairs(I, zero, p, q))56shows boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q)(t) = zero57proof58have included := domain59have inProduct := included with t, pair60obtain⟨bound, u, hu, v, hv, shape⟩:= product.membership.forward with inProduct61have inD : (u, v) ∈ D by rwa ← shape62have coefficientP := polynomials.coefficient at I, A, zero, p, u with*63have coefficientQ := polynomials.coefficient at I, A, zero, q, v with*64have value := boundedConvolutionWeights.pair at I, D, A, add, zero, neg, mul, one, p, q, u, v with*65have alternatives : u ∈ functionSupport(p, monomials(I), zero) ∨¬(u ∈ functionSupport(p, monomials(I), zero))66tauto67have productZero : p(u) * q(v) =068cases alternatives with supportP | absentP69 . have absentQ : ¬(v ∈ functionSupport(q, monomials(I), zero))70intro supportQ71have pairIn := product.pair with supportP, supportQ72have supported : t ∈ convolutionPairs(I, zero, p, q)73unfold convolutionPairs74 rwa shape75exact outside with supported76have vanishes := functionSupport.outside with*77rw vanishes78ring79 . have vanishes := functionSupport.outside with*80rw vanishes81ring82cc8384theorem polynomialProduct.on_domain85requires finite : Finite(D)86requires covers : convolutionPairs(I, zero, p, q) ⊆ D87shows finitePushforward(D, monomials(I), A, add, zero, neg, mul, one, monomialMul(I), boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q)) = polynomialProduct(I, A, add, zero, neg, mul, one, p, q)88proof89have weights := boundedConvolutionWeights.function at I, D, A, add, zero, neg, mul, one, p, q with*90have original := convolutionWeights.function at I, A, add, zero, neg, mul, one, p, q with*91have agreement : ∀ t ∈ convolutionPairs(I, zero, p, q), boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q)(t) = convolutionWeights(I, A, add, zero, neg, mul, one, p, q)(t)92intros t ht93have included := covers94have inD := included with t, ht95haveleft:= boundedConvolutionWeights.value at I, D, A, add, zero, neg, mul, one, p, q, t with*96haveright:= convolutionWeights.value at I, A, add, zero, neg, mul, one, p, q, t with*97cc98have vanishes : ∀ t ∈ D, ¬(t ∈ convolutionPairs(I, zero, p, q)) → boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q)(t) = zero99intros t ht outside100exact boundedConvolutionWeights.outside with*101have extended := finitePushforward.zero_extension at D, convolutionPairs(I, zero, p, q), monomials(I), A, add, zero, neg, mul, one, monomialMul(I), boundedConvolutionWeights(I, D, A, add, zero, neg, mul, one, p, q), convolutionWeights(I, A, add, zero, neg, mul, one, p, q) with*102unfold polynomialProduct103cc104105end Bounds106