Miscellaneous definitions, lemmas, and constructions using finsupp #
Main declarations #
Finsupp.graph
: the finset of input and output pairs with non-zero outputs.Finsupp.mapRange.equiv
:Finsupp.mapRange
as an equiv.Finsupp.mapDomain
: maps the domain of aFinsupp
by a function and by summing.Finsupp.comapDomain
: postcomposition of aFinsupp
with a function injective on the preimage of its support.Finsupp.some
: restrict a finitely supported function onOption α
to a finitely supported function onα
.Finsupp.filter
:filter p f
is the finitely supported function that isf a
ifp a
is true and 0 otherwise.Finsupp.frange
: the image of a finitely supported function on its support.Finsupp.subtype_domain
: the restriction of a finitely supported functionf
to a subtype.
Implementation notes #
This file is a noncomputable theory
and uses classical logic throughout.
TODO #
-
This file is currently ~1600 lines long and is quite a miscellany of definitions and lemmas, so it should be divided into smaller pieces.
-
Expand the list of definitions and important lemmas to the module docstring.
The graph of a finitely supported function over its support, i.e. the finset of input and output pairs with non-zero outputs.
Equations
- Finsupp.graph f = Finset.map { toFun := fun a => (a, ↑f a), inj' := (_ : ∀ (x x_1 : α), (fun a => (a, ↑f a)) x = (fun a => (a, ↑f a)) x_1 → x = x_1) } f.support
Instances For
Declarations about mapRange
#
Composition with a fixed zero-preserving homomorphism is itself a zero-preserving homomorphism on functions.
Equations
- Finsupp.mapRange.zeroHom f = { toFun := Finsupp.mapRange ↑f (_ : ↑f 0 = 0), map_zero' := (_ : Finsupp.mapRange ↑f (_ : ↑f 0 = 0) 0 = 0) }
Instances For
Composition with a fixed additive homomorphism is itself an additive homomorphism on functions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Finsupp.mapRange.AddMonoidHom
as an equiv.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Declarations about equivCongrLeft
#
Given f : α ≃ β
, we can map l : α →₀ M
to equivMapDomain f l : β →₀ M
(computably)
by mapping the support forwards and the function backwards.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given f : α ≃ β
, the finitely supported function spaces are also in bijection:
(α →₀ M) ≃ (β →₀ M)
.
This is the finitely-supported version of Equiv.piCongrLeft
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given f : α → β
and v : α →₀ M
, mapDomain f v : β →₀ M
is the finitely supported function whose value at a : β
is the sum
of v x
over all x
such that f x = a
.
Equations
- Finsupp.mapDomain f v = Finsupp.sum v fun a => Finsupp.single (f a)
Instances For
Finsupp.mapDomain
is an AddMonoidHom
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A version of sum_mapDomain_index
that takes a bundled AddMonoidHom
,
rather than separate linearity hypotheses.
When f
is an embedding we have an embedding (α →₀ ℕ) ↪ (β →₀ ℕ)
given by mapDomain
.
Equations
- Finsupp.mapDomainEmbedding f = { toFun := Finsupp.mapDomain ↑f, inj' := (_ : Function.Injective (Finsupp.mapDomain ↑f)) }
Instances For
When g
preserves addition, mapRange
and mapDomain
commute.
Declarations about comapDomain
#
Given f : α → β
, l : β →₀ M
and a proof hf
that f
is injective on
the preimage of l.support
, comapDomain f l hf
is the finitely supported function
from α
to M
given by composing l
with f
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A version of Finsupp.comapDomain_add
that's easier to use.
Finsupp.comapDomain
is an AddMonoidHom
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Restrict a finitely supported function on Option α
to a finitely supported function on α
.
Equations
Instances For
Declarations about Finsupp.filter
#
Finsupp.filter p f
is the finitely supported function that is f a
if p a
is true and 0
otherwise.
Equations
- One or more equations did not get rendered due to their size.
Instances For
frange f
is the image of f
on the support of f
.
Equations
- Finsupp.frange f = Finset.image (↑f) f.support
Instances For
Declarations about Finsupp.subtypeDomain
#
subtypeDomain p f
is the restriction of the finitely supported function f
to subtype p
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
subtypeDomain
but as an AddMonoidHom
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Finsupp.filter
as an AddMonoidHom
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a finitely supported function f
from a product type α × β
to γ
,
curry f
is the "curried" finitely supported function from α
to the type of
finitely supported functions from β
to γ
.
Equations
- Finsupp.curry f = Finsupp.sum f fun p c => fun₀ | p.fst => fun₀ | p.snd => c
Instances For
Given a finitely supported function f
from α
to the type of
finitely supported functions from β
to M
,
uncurry f
is the "uncurried" finitely supported function from α × β
to M
.
Equations
- Finsupp.uncurry f = Finsupp.sum f fun a g => Finsupp.sum g fun b c => fun₀ | (a, b) => c
Instances For
finsuppProdEquiv
defines the Equiv
between ((α × β) →₀ M)
and (α →₀ (β →₀ M))
given by
currying and uncurrying.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The equivalence between (α ⊕ β) →₀ γ
and (α →₀ γ) × (β →₀ γ)
.
This is the Finsupp
version of Equiv.sum_arrow_equiv_prod_arrow
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The additive equivalence between (α ⊕ β) →₀ M
and (α →₀ M) × (β →₀ M)
.
This is the Finsupp
version of Equiv.sum_arrow_equiv_prod_arrow
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Declarations about scalar multiplication #
Scalar multiplication acting on the domain.
This is not an instance as it would conflict with the action on the range.
See the instance_diamonds
test for examples of such conflicts.
Equations
- Finsupp.comapSMul = { smul := fun g => Finsupp.mapDomain ((fun x x_1 => x • x_1) g) }
Instances For
Finsupp.comapSMul
is multiplicative
Equations
Instances For
Finsupp.comapSMul
is distributive
Equations
Instances For
When G
is a group, Finsupp.comapSMul
acts by precomposition with the action of g⁻¹
.
Equations
- Finsupp.smulZeroClass = SMulZeroClass.mk (_ : ∀ (a : R), a • 0 = 0)
Throughout this section, some Monoid
and Semiring
arguments are specified with {}
instead of
[]
. See note [implicit instance arguments].
Equations
- Finsupp.distribSMul α M = DistribSMul.mk (_ : ∀ (x : R) (x_1 x_2 : α →₀ M), x • (x_1 + x_2) = x • x_1 + x • x_2)
Equations
- Finsupp.distribMulAction α M = let src := Finsupp.distribSMul α M; DistribMulAction.mk (_ : ∀ (a : R), a • 0 = 0) (_ : ∀ (a : R) (x y : α →₀ M), a • (x + y) = a • x + a • y)
A version of Finsupp.comapDomain_smul
that's easier to use.
A version of Finsupp.sum_smul_index'
for bundled additive maps.
Finsupp.single
as a DistribMulActionHom
.
See also Finsupp.lsingle
for the version as a linear map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
See note [partially-applied ext lemmas].
The Finsupp
version of Pi.unique
.
Equations
- Finsupp.uniqueOfRight = Function.Injective.unique (_ : Function.Injective fun f => ↑f)
The Finsupp
version of Pi.uniqueOfIsEmpty
.
Equations
- Finsupp.uniqueOfLeft = Function.Injective.unique (_ : Function.Injective fun f => ↑f)
Given an AddCommMonoid M
and s : Set α
, restrictSupportEquiv s M
is the Equiv
between the subtype of finitely supported functions with support contained in s
and
the type of finitely supported functions from s
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given AddCommMonoid M
and e : α ≃ β
, domCongr e
is the corresponding Equiv
between
α →₀ M
and β →₀ M
.
This is Finsupp.equivCongrLeft
as an AddEquiv
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Declarations about sigma types #
Given l
, a finitely supported function from the sigma type Σ (i : ι), αs i
to M
and
an index element i : ι
, split l i
is the i
th component of l
,
a finitely supported function from as i
to M
.
This is the Finsupp
version of Sigma.curry
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given l
, a finitely supported function from the sigma type Σ (i : ι), αs i
to β
,
split_support l
is the finset of indices in ι
that appear in the support of l
.
Equations
- Finsupp.splitSupport l = Finset.image Sigma.fst l.support
Instances For
Given l
, a finitely supported function from the sigma type Σ i, αs i
to β
and
an ι
-indexed family g
of functions from (αs i →₀ β)
to γ
, split_comp
defines a
finitely supported function from the index type ι
to γ
given by composing g i
with
split l i
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
On a Fintype η
, Finsupp.split
is an equivalence between (Σ (j : η), ιs j) →₀ α
and Π j, (ιs j →₀ α)
.
This is the Finsupp
version of Equiv.Pi_curry
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
On a Fintype η
, Finsupp.split
is an additive equivalence between
(Σ (j : η), ιs j) →₀ α
and Π j, (ιs j →₀ α)
.
This is the AddEquiv
version of Finsupp.sigmaFinsuppEquivPiFinsupp
.
Equations
- One or more equations did not get rendered due to their size.