Dependent functions with finite support
For a non-dependent version see data/finsupp.lean
.
Equations
- dfinsupp.inhabited_pre ι β = {default := {to_fun := λ (i : ι), 0, pre_support := ∅, zero := _}}
Equations
- dfinsupp.setoid ι β = {r := λ (x y : dfinsupp.pre ι β), ∀ (i : ι), x.to_fun i = y.to_fun i, iseqv := _}
Equations
- dfinsupp.has_coe_to_fun = {F := λ (_x : Π₀ (i : ι), β i), Π (i : ι), β i, coe := λ (f : Π₀ (i : ι), β i), quotient.lift_on f dfinsupp.pre.to_fun dfinsupp.has_coe_to_fun._proof_1}
Equations
- dfinsupp.inhabited = {default := 0}
The composition of f : β₁ → β₂
and g : Π₀ i, β₁ i
is
map_range f hf g : Π₀ i, β₂ i
, well defined when f 0 = 0
.
Equations
- dfinsupp.map_range f hf g = quotient.lift_on g (λ (x : dfinsupp.pre ι (λ (i : ι), β₁ i)), ⟦{to_fun := λ (i : ι), f i (x.to_fun i), pre_support := x.pre_support, zero := _}⟧) _
Let f i
be a binary operation β₁ i → β₂ i → β i
such that f i 0 0 = 0
.
Then zip_with f hf
is a binary operation Π₀ i, β₁ i → Π₀ i, β₂ i → Π₀ i, β i
.
Equations
- dfinsupp.zip_with f hf g₁ g₂ = quotient.lift_on₂ g₁ g₂ (λ (x : dfinsupp.pre ι (λ (i : ι), β₁ i)) (y : dfinsupp.pre ι (λ (i : ι), β₂ i)), ⟦{to_fun := λ (i : ι), f i (x.to_fun i) (y.to_fun i), pre_support := x.pre_support + y.pre_support, zero := _}⟧) _
Equations
- dfinsupp.has_add = {add := dfinsupp.zip_with (λ (_x : ι), has_add.add) dfinsupp.has_add._proof_1}
Equations
- dfinsupp.add_monoid = {add := has_add.add dfinsupp.has_add, add_assoc := _, zero := 0, zero_add := _, add_zero := _}
Equations
Equations
- dfinsupp.has_neg = {neg := λ (f : Π₀ (i : ι), β i), dfinsupp.map_range (λ (_x : ι), has_neg.neg) dfinsupp.has_neg._proof_1 f}
Equations
- dfinsupp.add_comm_monoid = {add := add_monoid.add dfinsupp.add_monoid, add_assoc := _, zero := add_monoid.zero dfinsupp.add_monoid, zero_add := _, add_zero := _, add_comm := _}
Equations
- dfinsupp.add_group = {add := add_monoid.add dfinsupp.add_monoid, add_assoc := _, zero := add_monoid.zero dfinsupp.add_monoid, zero_add := _, add_zero := _, neg := has_neg.neg infer_instance, add_left_neg := _}
Equations
- dfinsupp.add_comm_group = {add := add_group.add dfinsupp.add_group, add_assoc := _, zero := add_group.zero dfinsupp.add_group, zero_add := _, add_zero := _, neg := add_group.neg dfinsupp.add_group, add_left_neg := _, add_comm := _}
Dependent functions with finite support inherit a semiring action from an action on each coordinate.
Equations
- dfinsupp.to_has_scalar = {smul := λ (c : γ) (v : Π₀ (i : ι), β i), dfinsupp.map_range (λ (_x : ι), has_scalar.smul c) _ v}
Dependent functions with finite support inherit a semimodule structure from such a structure on each coordinate.
Equations
- dfinsupp.to_semimodule = semimodule.of_core {to_has_scalar := {smul := has_scalar.smul infer_instance}, smul_add := _, add_smul := _, mul_smul := _, one_smul := _}
filter p f
is the function which is f i
if p i
is true and 0 otherwise.
Equations
- dfinsupp.filter p f = quotient.lift_on f (λ (x : dfinsupp.pre ι (λ (i : ι), β i)), ⟦{to_fun := λ (i : ι), ite (p i) (x.to_fun i) 0, pre_support := x.pre_support, zero := _}⟧) _
subtype_domain p f
is the restriction of the finitely supported function
f
to the subtype p
.
Equations
- dfinsupp.subtype_domain p f = quotient.lift_on f (λ (x : dfinsupp.pre ι (λ (i : ι), β i)), ⟦{to_fun := λ (i : subtype p), x.to_fun ↑i, pre_support := multiset.map (λ (j : {x_1 // x_1 ∈ multiset.filter p x.pre_support}), ⟨↑j, _⟩) (multiset.filter p x.pre_support).attach, zero := _}⟧) _
Equations
Create an element of Π₀ i, β i
from a finset s
and a function x
defined on this finset
.
The function single i b : Π₀ i, β i
sends i
to b
and all other points to 0
.
Equations
- dfinsupp.single i b = dfinsupp.mk {i} (λ (j : ↥↑{i}), _.rec_on b)
Redefine f i
to be 0
.
Equations
- dfinsupp.erase i f = quotient.lift_on f (λ (x : dfinsupp.pre ι (λ (i : ι), β i)), ⟦{to_fun := λ (j : ι), ite (j = i) 0 (x.to_fun j), pre_support := x.pre_support, zero := _}⟧) _
Equations
dfinsupp.mk
as a linear_map
.
Equations
- dfinsupp.lmk β γ s = {to_fun := dfinsupp.mk s, map_add' := _, map_smul' := _}
dfinsupp.single
as a linear_map
Equations
- dfinsupp.lsingle β γ i = {to_fun := dfinsupp.single i, map_add' := _, map_smul' := _}
Set {i | f x ≠ 0}
as a finset
.
Equations
- f.support = quotient.lift_on f (λ (x : dfinsupp.pre ι (λ (i : ι), β i)), finset.filter (λ (i : ι), x.to_fun i ≠ 0) x.pre_support.to_finset) dfinsupp.support._proof_1
Equations
- dfinsupp.decidable_zero = λ (f : Π₀ (i : ι), β i), decidable_of_iff (f.support = ∅) _
sum f g
is the sum of g i (f i)
over the support of f
.
prod f g
is the product of g i (f i)
over the support of f
.