Locus of unequal values of finitely supported functions #
Let α N
be two Types, assume that N
has a 0
and let f g : α →₀ N
be finitely supported
functions.
Main definition #
Finsupp.neLocus f g : Finset α
, the finite subset ofα
wheref
andg
differ.
In the case in which N
is an additive group, Finsupp.neLocus f g
coincides with
Finsupp.support (f - g)
.
def
Finsupp.neLocus
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)
(g : α →₀ N)
:
Finset α
Given two finitely supported functions f g : α →₀ N
, Finsupp.neLocus f g
is the Finset
where f
and g
differ. This generalizes (f - g).support
to situations without subtraction.
Equations
- f.neLocus g = Finset.filter (fun (x : α) => f x ≠ g x) (f.support ∪ g.support)
Instances For
@[simp]
theorem
Finsupp.mem_neLocus
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f : α →₀ N}
{g : α →₀ N}
{a : α}
:
theorem
Finsupp.not_mem_neLocus
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f : α →₀ N}
{g : α →₀ N}
{a : α}
:
@[simp]
theorem
Finsupp.coe_neLocus
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_eq_empty
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f : α →₀ N}
{g : α →₀ N}
:
@[simp]
theorem
Finsupp.nonempty_neLocus_iff
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f : α →₀ N}
{g : α →₀ N}
:
theorem
Finsupp.neLocus_comm
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)
(g : α →₀ N)
:
f.neLocus g = g.neLocus f
@[simp]
theorem
Finsupp.neLocus_zero_right
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)
:
f.neLocus 0 = f.support
@[simp]
theorem
Finsupp.neLocus_zero_left
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f : α →₀ N)
:
Finsupp.neLocus 0 f = f.support
theorem
Finsupp.subset_mapRange_neLocus
{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
[DecidableEq M]
[Zero M]
(f : α →₀ N)
(g : α →₀ N)
{F : N → M}
(F0 : F 0 = 0)
:
(Finsupp.mapRange F F0 f).neLocus (Finsupp.mapRange F F0 g) ⊆ f.neLocus g
theorem
Finsupp.zipWith_neLocus_eq_left
{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[DecidableEq α]
[DecidableEq N]
[Zero M]
[DecidableEq P]
[Zero P]
[Zero N]
{F : M → N → P}
(F0 : F 0 0 = 0)
(f : α →₀ M)
(g₁ : α →₀ N)
(g₂ : α →₀ N)
(hF : ∀ (f : M), Function.Injective fun (g : N) => F f g)
:
(Finsupp.zipWith F F0 f g₁).neLocus (Finsupp.zipWith F F0 f g₂) = g₁.neLocus g₂
theorem
Finsupp.zipWith_neLocus_eq_right
{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[DecidableEq α]
[DecidableEq M]
[Zero M]
[DecidableEq P]
[Zero P]
[Zero N]
{F : M → N → P}
(F0 : F 0 0 = 0)
(f₁ : α →₀ M)
(f₂ : α →₀ M)
(g : α →₀ N)
(hF : ∀ (g : N), Function.Injective fun (f : M) => F f g)
:
(Finsupp.zipWith F F0 f₁ g).neLocus (Finsupp.zipWith F F0 f₂ g) = f₁.neLocus f₂
theorem
Finsupp.mapRange_neLocus_eq
{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[DecidableEq M]
[Zero M]
[Zero N]
(f : α →₀ N)
(g : α →₀ N)
{F : N → M}
(F0 : F 0 = 0)
(hF : Function.Injective F)
:
(Finsupp.mapRange F F0 f).neLocus (Finsupp.mapRange F F0 g) = f.neLocus g
@[simp]
theorem
Finsupp.neLocus_add_left
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddLeftCancelMonoid N]
(f : α →₀ N)
(g : α →₀ N)
(h : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_add_right
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddRightCancelMonoid N]
(f : α →₀ N)
(g : α →₀ N)
(h : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_neg_neg
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
theorem
Finsupp.neLocus_neg
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
theorem
Finsupp.neLocus_eq_support_sub
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_sub_left
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g₁ : α →₀ N)
(g₂ : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_sub_right
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f₁ : α →₀ N)
(f₂ : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_self_add_right
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_self_add_left
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_self_sub_right
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
:
@[simp]
theorem
Finsupp.neLocus_self_sub_left
{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[AddGroup N]
(f : α →₀ N)
(g : α →₀ N)
: