1-- Multiplication of monomial terms and structural polynomial induction (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.Terms8import Unit9import CoefficientInduction1011theorem polynomialTerm.support (I A zero a m : Set)12requires zeroIn : zero ∈ A13requires coefficient : a ∈ A14shows functionSupport(polynomialTerm(I, A, zero, a, m), monomials(I), zero) ⊆ {m}15proof16unfold polynomialTerm17exact coefficientSingle.support with*1819theorem polynomialProduct.terms (I A add zero neg mul one a b m n : Set)20requiresring : IsCommRing(A, add, zero, neg, mul, one)21requires coefficientA : a ∈ A22requires coefficientB : b ∈ A23requires monomialM : m ∈ monomials(I)24requires monomialN : n ∈ monomials(I)25shows polynomialProduct(I, A, add, zero, neg, mul, one, polynomialTerm(I, A, zero, a, m), polynomialTerm(I, A, zero, b, n)) = polynomialTerm(I, A, zero, call2(mul, a, b), monomialProduct(I, m, n))26proof27have ordinary := IsCommRing.ring withring28have zeroIn := IsRing.zero_in_carrier with ordinary29have memberP := polynomialTerm.member at I, A, zero, a, m with*30have memberQ := polynomialTerm.member at I, A, zero, b, n with*31have supportP := polynomialTerm.support at I, A, zero, a, m with*32have supportQ := polynomialTerm.support at I, A, zero, b, n with*33have singletons : {m} × {n} = {(m, n)}34ext t35constructor36 . intro ht37obtain⟨bound, u, hu, v, hv, shape⟩:= product.membership.forward with ht38have equalU := singleton.membership.forward with hu39have equalV := singleton.membership.forward with hv40apply singleton.membership.backward41cc42 . intro ht43have shape := singleton.membership.forward with ht44rw shape45have hm := singleton.self at m46have hn := singleton.self at n47exact product.pair with hm, hn48have covers : convolutionPairs(I, zero, polynomialTerm(I, A, zero, a, m), polynomialTerm(I, A, zero, b, n)) ⊆ {(m, n)}49unfold convolutionPairs50rw← singletons51exact product.monotone with supportP, supportQ52have pair := product.pair at m, n, monomials(I), monomials(I) with*53have domain : {(m, n)} ⊆ monomials(I) × monomials(I) bysimp [Subset, singleton.membership]54have finite := Finite.singleton at (m, n)55have weights := boundedConvolutionWeights.function at I, {(m, n)}, A, add, zero, neg, mul, one, polynomialTerm(I, A, zero, a, m), polynomialTerm(I, A, zero, b, n) with*56have bounded := polynomialProduct.on_domain withring, memberP, memberQ, domain, finite, covers57have pushed := finitePushforward.singleton at monomials(I), A, add, zero, neg, mul, one, monomialMul(I), boundedConvolutionWeights(I, {(m, n)}, A, add, zero, neg, mul, one, polynomialTerm(I, A, zero, a, m), polynomialTerm(I, A, zero, b, n)), (m, n) with*58have singleton := singleton.self at (m, n)59have weight := boundedConvolutionWeights.pair at I, {(m, n)}, A, add, zero, neg, mul, one, polynomialTerm(I, A, zero, a, m), polynomialTerm(I, A, zero, b, n), m, n with*60have valueP := polynomialTerm.same at I, A, zero, a, m with*61have valueQ := polynomialTerm.same at I, A, zero, b, n with*62have index := monomialMul.apply at I, m, n with*63unfold call2 at index64rw [← bounded, pushed, weight, valueP, valueQ, index]65unfold polynomialTerm66rfl6768-- The property is represented by a set S; no extra induction axiom is used.69theorem polynomials.induction (I A add zero neg mul one S p : Set)70requiresring : IsCommRing(A, add, zero, neg, mul, one)71requires member : p ∈ polynomials(I, A, zero)72requires base : constantFunction(monomials(I), A, zero) ∈ S73requires terms : ∀ a ∈ A, ∀ m ∈ monomials(I), polynomialTerm(I, A, zero, a, m) ∈ S74requires sums : ∀ f ∈ S, ∀ g ∈ S, coefficientAdd(monomials(I), A, add, zero, neg, mul, one, f, g) ∈ S75shows p ∈ S76proof77have map := polynomials.map with member78have step : ∀ a ∈ A, ∀ m ∈ monomials(I), ∀ f ∈ S, coefficientAdd(monomials(I), A, add, zero, neg, mul, one, coefficientSingle(monomials(I), A, zero, a, m), f) ∈ S79intros a ha m hm f hf80have term := terms with a, ha, m, hm81have result := sums with polynomialTerm(I, A, zero, a, m), term, f, hf82unfold polynomialTerm at result83exact result84exact coefficientMaps.induction with*85