Locus of unequal values of finitely supported dependent functions #
Let N : α → Type*
be a type family, assume that N a
has a 0
for all a : α
and let
f g : Π₀ a, N a
be finitely supported dependent functions.
Main definition #
DFinsupp.neLocus f g : Finset α
, the finite subset ofα
wheref
andg
differ. In the case in whichN a
is an additive group for alla
,DFinsupp.neLocus f g
coincides withDFinsupp.support (f - g)
.
def
DFinsupp.neLocus
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
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
DFinsupp.mem_neLocus
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
{f : Π₀ (a : α), N a}
{g : Π₀ (a : α), N a}
{a : α}
:
theorem
DFinsupp.not_mem_neLocus
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
{f : Π₀ (a : α), N a}
{g : Π₀ (a : α), N a}
{a : α}
:
@[simp]
theorem
DFinsupp.coe_neLocus
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_eq_empty
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
{f : Π₀ (a : α), N a}
{g : Π₀ (a : α), N a}
:
@[simp]
theorem
DFinsupp.nonempty_neLocus_iff
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
{f : Π₀ (a : α), N a}
{g : Π₀ (a : α), N a}
:
theorem
DFinsupp.neLocus_comm
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
f.neLocus g = g.neLocus f
@[simp]
theorem
DFinsupp.neLocus_zero_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
(f : Π₀ (a : α), N a)
:
f.neLocus 0 = f.support
@[simp]
theorem
DFinsupp.neLocus_zero_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → Zero (N a)]
(f : Π₀ (a : α), N a)
:
DFinsupp.neLocus 0 f = f.support
theorem
DFinsupp.subset_mapRange_neLocus
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
{M : α → Type u_3}
[(a : α) → Zero (N a)]
[(a : α) → Zero (M a)]
[(a : α) → DecidableEq (N a)]
[(a : α) → DecidableEq (M a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
{F : (a : α) → N a → M a}
(F0 : ∀ (a : α), F a 0 = 0)
:
(DFinsupp.mapRange F F0 f).neLocus (DFinsupp.mapRange F F0 g) ⊆ f.neLocus g
theorem
DFinsupp.zipWith_neLocus_eq_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
{M : α → Type u_3}
{P : α → Type u_4}
[(a : α) → Zero (N a)]
[(a : α) → Zero (M a)]
[(a : α) → Zero (P a)]
[(a : α) → DecidableEq (N a)]
[(a : α) → DecidableEq (P a)]
{F : (a : α) → M a → N a → P a}
(F0 : ∀ (a : α), F a 0 0 = 0)
(f : Π₀ (a : α), M a)
(g₁ : Π₀ (a : α), N a)
(g₂ : Π₀ (a : α), N a)
(hF : ∀ (a : α) (f : M a), Function.Injective fun (g : N a) => F a f g)
:
(DFinsupp.zipWith F F0 f g₁).neLocus (DFinsupp.zipWith F F0 f g₂) = g₁.neLocus g₂
theorem
DFinsupp.zipWith_neLocus_eq_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
{M : α → Type u_3}
{P : α → Type u_4}
[(a : α) → Zero (N a)]
[(a : α) → Zero (M a)]
[(a : α) → Zero (P a)]
[(a : α) → DecidableEq (M a)]
[(a : α) → DecidableEq (P a)]
{F : (a : α) → M a → N a → P a}
(F0 : ∀ (a : α), F a 0 0 = 0)
(f₁ : Π₀ (a : α), M a)
(f₂ : Π₀ (a : α), M a)
(g : Π₀ (a : α), N a)
(hF : ∀ (a : α) (g : N a), Function.Injective fun (f : M a) => F a f g)
:
(DFinsupp.zipWith F F0 f₁ g).neLocus (DFinsupp.zipWith F F0 f₂ g) = f₁.neLocus f₂
theorem
DFinsupp.mapRange_neLocus_eq
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
{M : α → Type u_3}
[(a : α) → Zero (N a)]
[(a : α) → Zero (M a)]
[(a : α) → DecidableEq (N a)]
[(a : α) → DecidableEq (M a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
{F : (a : α) → N a → M a}
(F0 : ∀ (a : α), F a 0 = 0)
(hF : ∀ (a : α), Function.Injective (F a))
:
(DFinsupp.mapRange F F0 f).neLocus (DFinsupp.mapRange F F0 g) = f.neLocus g
@[simp]
theorem
DFinsupp.neLocus_add_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddLeftCancelMonoid (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
(h : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_add_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddRightCancelMonoid (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
(h : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_neg_neg
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
theorem
DFinsupp.neLocus_neg
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
theorem
DFinsupp.neLocus_eq_support_sub
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_sub_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g₁ : Π₀ (a : α), N a)
(g₂ : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_sub_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f₁ : Π₀ (a : α), N a)
(f₂ : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_self_add_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_self_add_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_self_sub_right
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
:
@[simp]
theorem
DFinsupp.neLocus_self_sub_left
{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f : Π₀ (a : α), N a)
(g : Π₀ (a : α), N a)
: