Module docstring
{"# Support of a function
In this file we define Function.support f = {x | f x ≠ 0} and prove its basic properties.
We also define Function.mulSupport f = {x | f x ≠ 1}.
"}
{"# Support of a function
In this file we define Function.support f = {x | f x ≠ 0} and prove its basic properties.
We also define Function.mulSupport f = {x | f x ≠ 1}.
"}
Function.mulSupport
definition
(f : α → M) : Set α
/-- `mulSupport` of a function is the set of points `x` such that `f x ≠ 1`. -/
@[to_additive "`support` of a function is the set of points `x` such that `f x ≠ 0`."]
def mulSupport (f : α → M) : Set α := {x | f x ≠ 1}
Function.mulSupport_eq_preimage
theorem
(f : α → M) : mulSupport f = f ⁻¹' { 1 }ᶜ
@[to_additive]
theorem mulSupport_eq_preimage (f : α → M) : mulSupport f = f ⁻¹' {1}ᶜ :=
rfl
Function.nmem_mulSupport
theorem
{f : α → M} {x : α} : x ∉ mulSupport f ↔ f x = 1
@[to_additive]
theorem nmem_mulSupport {f : α → M} {x : α} : x ∉ mulSupport fx ∉ mulSupport f ↔ f x = 1 :=
not_not
Function.compl_mulSupport
theorem
{f : α → M} : (mulSupport f)ᶜ = {x | f x = 1}
@[to_additive]
theorem compl_mulSupport {f : α → M} : (mulSupport f)ᶜ = { x | f x = 1 } :=
ext fun _ => nmem_mulSupport
Function.mem_mulSupport
theorem
{f : α → M} {x : α} : x ∈ mulSupport f ↔ f x ≠ 1
@[to_additive (attr := simp)]
theorem mem_mulSupport {f : α → M} {x : α} : x ∈ mulSupport fx ∈ mulSupport f ↔ f x ≠ 1 :=
Iff.rfl
Function.mulSupport_subset_iff
theorem
{f : α → M} {s : Set α} : mulSupport f ⊆ s ↔ ∀ x, f x ≠ 1 → x ∈ s
@[to_additive (attr := simp)]
theorem mulSupport_subset_iff {f : α → M} {s : Set α} : mulSupportmulSupport f ⊆ smulSupport f ⊆ s ↔ ∀ x, f x ≠ 1 → x ∈ s :=
Iff.rfl
Function.mulSupport_subset_iff'
theorem
{f : α → M} {s : Set α} : mulSupport f ⊆ s ↔ ∀ x ∉ s, f x = 1
@[to_additive]
theorem mulSupport_subset_iff' {f : α → M} {s : Set α} :
mulSupportmulSupport f ⊆ smulSupport f ⊆ s ↔ ∀ x ∉ s, f x = 1 :=
forall_congr' fun _ => not_imp_comm
Function.mulSupport_eq_iff
theorem
{f : α → M} {s : Set α} : mulSupport f = s ↔ (∀ x, x ∈ s → f x ≠ 1) ∧ ∀ x, x ∉ s → f x = 1
@[to_additive]
theorem mulSupport_eq_iff {f : α → M} {s : Set α} :
mulSupportmulSupport f = s ↔ (∀ x, x ∈ s → f x ≠ 1) ∧ ∀ x, x ∉ s → f x = 1 := by
simp +contextual only [Set.ext_iff, mem_mulSupport, ne_eq, iff_def,
not_imp_comm, and_comm, forall_and]
Function.ext_iff_mulSupport
theorem
{f g : α → M} : f = g ↔ f.mulSupport = g.mulSupport ∧ ∀ x ∈ f.mulSupport, f x = g x
@[to_additive]
theorem ext_iff_mulSupport {f g : α → M} :
f = g ↔ f.mulSupport = g.mulSupport ∧ ∀ x ∈ f.mulSupport, f x = g x :=
⟨fun h ↦ h ▸ ⟨rfl, fun _ _ ↦ rfl⟩, fun ⟨h₁, h₂⟩ ↦ funext fun x ↦ by
if hx : x ∈ f.mulSupport then exact h₂ x hx
else rw [nmem_mulSupport.1 hx, nmem_mulSupport.1 (mt (Set.ext_iff.1 h₁ x).2 hx)]⟩
Function.mulSupport_update_of_ne_one
theorem
[DecidableEq α] (f : α → M) (x : α) {y : M} (hy : y ≠ 1) : mulSupport (update f x y) = insert x (mulSupport f)
@[to_additive]
theorem mulSupport_update_of_ne_one [DecidableEq α] (f : α → M) (x : α) {y : M} (hy : y ≠ 1) :
mulSupport (update f x y) = insert x (mulSupport f) := by
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
Function.mulSupport_update_one
theorem
[DecidableEq α] (f : α → M) (x : α) : mulSupport (update f x 1) = mulSupport f \ { x }
@[to_additive]
theorem mulSupport_update_one [DecidableEq α] (f : α → M) (x : α) :
mulSupport (update f x 1) = mulSupportmulSupport f \ {x} := by
ext a; rcases eq_or_ne a x with rfl | hne <;> simp [*]
Function.mulSupport_update_eq_ite
theorem
[DecidableEq α] [DecidableEq M] (f : α → M) (x : α) (y : M) :
mulSupport (update f x y) = if y = 1 then mulSupport f \ { x } else insert x (mulSupport f)
@[to_additive]
theorem mulSupport_update_eq_ite [DecidableEq α] [DecidableEq M] (f : α → M) (x : α) (y : M) :
mulSupport (update f x y) = if y = 1 then mulSupport f \ {x} else insert x (mulSupport f) := by
rcases eq_or_ne y 1 with rfl | hy <;> simp [mulSupport_update_one, mulSupport_update_of_ne_one, *]
Function.mulSupport_extend_one_subset
theorem
{f : α → M'} {g : α → N} : mulSupport (f.extend g 1) ⊆ f '' mulSupport g
@[to_additive]
theorem mulSupport_extend_one_subset {f : α → M'} {g : α → N} :
mulSupportmulSupport (f.extend g 1) ⊆ f '' mulSupport g :=
mulSupport_subset_iff'.mpr fun x hfg ↦ by
by_cases hf : ∃ a, f a = x
· rw [extend, dif_pos hf, ← nmem_mulSupport]
rw [← Classical.choose_spec hf] at hfg
exact fun hg ↦ hfg ⟨_, hg, rfl⟩
· rw [extend_apply' _ _ _ hf]; rfl
Function.mulSupport_extend_one
theorem
{f : α → M'} {g : α → N} (hf : f.Injective) : mulSupport (f.extend g 1) = f '' mulSupport g
@[to_additive]
theorem mulSupport_extend_one {f : α → M'} {g : α → N} (hf : f.Injective) :
mulSupport (f.extend g 1) = f '' mulSupport g :=
mulSupport_extend_one_subset.antisymm <| by
rintro _ ⟨x, hx, rfl⟩; rwa [mem_mulSupport, hf.extend_apply]
Function.mulSupport_disjoint_iff
theorem
{f : α → M} {s : Set α} : Disjoint (mulSupport f) s ↔ EqOn f 1 s
@[to_additive]
theorem mulSupport_disjoint_iff {f : α → M} {s : Set α} :
DisjointDisjoint (mulSupport f) s ↔ EqOn f 1 s := by
simp_rw [← subset_compl_iff_disjoint_right, mulSupport_subset_iff', not_mem_compl_iff, EqOn,
Pi.one_apply]
Function.disjoint_mulSupport_iff
theorem
{f : α → M} {s : Set α} : Disjoint s (mulSupport f) ↔ EqOn f 1 s
@[to_additive]
theorem disjoint_mulSupport_iff {f : α → M} {s : Set α} :
DisjointDisjoint s (mulSupport f) ↔ EqOn f 1 s := by
rw [disjoint_comm, mulSupport_disjoint_iff]
Function.mulSupport_eq_empty_iff
theorem
{f : α → M} : mulSupport f = ∅ ↔ f = 1
@[to_additive (attr := simp)]
theorem mulSupport_eq_empty_iff {f : α → M} : mulSupportmulSupport f = ∅ ↔ f = 1 := by
rw [← subset_empty_iff, mulSupport_subset_iff', funext_iff]
simp
Function.mulSupport_nonempty_iff
theorem
{f : α → M} : (mulSupport f).Nonempty ↔ f ≠ 1
@[to_additive (attr := simp)]
theorem mulSupport_nonempty_iff {f : α → M} : (mulSupport f).Nonempty ↔ f ≠ 1 := by
rw [nonempty_iff_ne_empty, Ne, mulSupport_eq_empty_iff]
Function.range_subset_insert_image_mulSupport
theorem
(f : α → M) : range f ⊆ insert 1 (f '' mulSupport f)
@[to_additive]
theorem range_subset_insert_image_mulSupport (f : α → M) :
rangerange f ⊆ insert 1 (f '' mulSupport f) := by
simpa only [range_subset_iff, mem_insert_iff, or_iff_not_imp_left] using
fun x (hx : x ∈ mulSupport f) => mem_image_of_mem f hx
Function.range_eq_image_or_of_mulSupport_subset
theorem
{f : α → M} {k : Set α} (h : mulSupport f ⊆ k) : range f = f '' k ∨ range f = insert 1 (f '' k)
@[to_additive]
lemma range_eq_image_or_of_mulSupport_subset {f : α → M} {k : Set α} (h : mulSupportmulSupport f ⊆ k) :
rangerange f = f '' k ∨ range f = insert 1 (f '' k) := by
have : rangerange f ⊆ insert 1 (f '' k) :=
(range_subset_insert_image_mulSupport f).trans (insert_subset_insert (image_subset f h))
by_cases h1 : 1 ∈ range f
· exact Or.inr (subset_antisymm this (insert_subset h1 (image_subset_range _ _)))
refine Or.inl (subset_antisymm ?_ (image_subset_range _ _))
rwa [← diff_singleton_eq_self h1, diff_singleton_subset_iff]
Function.mulSupport_one'
theorem
: mulSupport (1 : α → M) = ∅
@[to_additive (attr := simp)]
theorem mulSupport_one' : mulSupport (1 : α → M) = ∅ :=
mulSupport_eq_empty_iff.2 rfl
Function.mulSupport_one
theorem
: (mulSupport fun _ : α => (1 : M)) = ∅
@[to_additive (attr := simp)]
theorem mulSupport_one : (mulSupport fun _ : α => (1 : M)) = ∅ :=
mulSupport_one'
Function.mulSupport_const
theorem
{c : M} (hc : c ≠ 1) : (mulSupport fun _ : α => c) = Set.univ
@[to_additive]
theorem mulSupport_const {c : M} (hc : c ≠ 1) : (mulSupport fun _ : α => c) = Set.univ := by
ext x
simp [hc]
Function.mulSupport_binop_subset
theorem
(op : M → N → P) (op1 : op 1 1 = 1) (f : α → M) (g : α → N) :
(mulSupport fun x => op (f x) (g x)) ⊆ mulSupport f ∪ mulSupport g
@[to_additive]
theorem mulSupport_binop_subset (op : M → N → P) (op1 : op 1 1 = 1) (f : α → M) (g : α → N) :
(mulSupport fun x => op (f x) (g x)) ⊆ mulSupport f ∪ mulSupport g := fun x hx =>
not_or_of_imp fun hf hg => hx <| by simp only [hf, hg, op1]
Function.mulSupport_comp_subset
theorem
{g : M → N} (hg : g 1 = 1) (f : α → M) : mulSupport (g ∘ f) ⊆ mulSupport f
@[to_additive]
theorem mulSupport_comp_subset {g : M → N} (hg : g 1 = 1) (f : α → M) :
mulSupportmulSupport (g ∘ f) ⊆ mulSupport f := fun x => mt fun h => by simp only [(· ∘ ·), *]
Function.mulSupport_subset_comp
theorem
{g : M → N} (hg : ∀ {x}, g x = 1 → x = 1) (f : α → M) : mulSupport f ⊆ mulSupport (g ∘ f)
@[to_additive]
theorem mulSupport_subset_comp {g : M → N} (hg : ∀ {x}, g x = 1 → x = 1) (f : α → M) :
mulSupportmulSupport f ⊆ mulSupport (g ∘ f) := fun _ => mt hg
Function.mulSupport_comp_eq
theorem
(g : M → N) (hg : ∀ {x}, g x = 1 ↔ x = 1) (f : α → M) : mulSupport (g ∘ f) = mulSupport f
@[to_additive]
theorem mulSupport_comp_eq (g : M → N) (hg : ∀ {x}, g x = 1 ↔ x = 1) (f : α → M) :
mulSupport (g ∘ f) = mulSupport f :=
Set.ext fun _ => not_congr hg
Function.mulSupport_comp_eq_of_range_subset
theorem
{g : M → N} {f : α → M} (hg : ∀ {x}, x ∈ range f → (g x = 1 ↔ x = 1)) : mulSupport (g ∘ f) = mulSupport f
@[to_additive]
theorem mulSupport_comp_eq_of_range_subset {g : M → N} {f : α → M}
(hg : ∀ {x}, x ∈ range f → (g x = 1 ↔ x = 1)) :
mulSupport (g ∘ f) = mulSupport f :=
Set.ext fun x ↦ not_congr <| by rw [Function.comp, hg (mem_range_self x)]
Function.mulSupport_comp_eq_preimage
theorem
(g : β → M) (f : α → β) : mulSupport (g ∘ f) = f ⁻¹' mulSupport g
@[to_additive]
theorem mulSupport_comp_eq_preimage (g : β → M) (f : α → β) :
mulSupport (g ∘ f) = f ⁻¹' mulSupport g :=
rfl
Function.mulSupport_prod_mk
theorem
(f : α → M) (g : α → N) : (mulSupport fun x => (f x, g x)) = mulSupport f ∪ mulSupport g
@[to_additive support_prod_mk]
theorem mulSupport_prod_mk (f : α → M) (g : α → N) :
(mulSupport fun x => (f x, g x)) = mulSupportmulSupport f ∪ mulSupport g :=
Set.ext fun x => by
simp only [mulSupport, not_and_or, mem_union, mem_setOf_eq, Prod.mk_eq_one, Ne]
Function.mulSupport_prod_mk'
theorem
(f : α → M × N) : mulSupport f = (mulSupport fun x => (f x).1) ∪ mulSupport fun x => (f x).2
@[to_additive support_prod_mk']
theorem mulSupport_prod_mk' (f : α → M × N) :
mulSupport f = (mulSupport fun x => (f x).1) ∪ mulSupport fun x => (f x).2 := by
simp only [← mulSupport_prod_mk]
Function.mulSupport_along_fiber_subset
theorem
(f : α × β → M) (a : α) : (mulSupport fun b => f (a, b)) ⊆ (mulSupport f).image Prod.snd
@[to_additive]
theorem mulSupport_along_fiber_subset (f : α × β → M) (a : α) :
(mulSupport fun b => f (a, b)) ⊆ (mulSupport f).image Prod.snd :=
fun x hx => ⟨(a, x), by simpa using hx⟩
Function.mulSupport_curry
theorem
(f : α × β → M) : (mulSupport f.curry) = (mulSupport f).image Prod.fst
@[to_additive]
theorem mulSupport_curry (f : α × β → M) :
(mulSupport f.curry) = (mulSupport f).image Prod.fst := by
simp [mulSupport, funext_iff, image]
Function.mulSupport_curry'
theorem
(f : α × β → M) : (mulSupport fun a b ↦ f (a, b)) = (mulSupport f).image Prod.fst
@[to_additive]
theorem mulSupport_curry' (f : α × β → M) :
(mulSupport fun a b ↦ f (a, b)) = (mulSupport f).image Prod.fst :=
mulSupport_curry f
Function.mulSupport_mul
theorem
[MulOneClass M] (f g : α → M) : (mulSupport fun x => f x * g x) ⊆ mulSupport f ∪ mulSupport g
@[to_additive]
theorem mulSupport_mul [MulOneClass M] (f g : α → M) :
(mulSupport fun x => f x * g x) ⊆ mulSupport f ∪ mulSupport g :=
mulSupport_binop_subset (· * ·) (one_mul _) f g
Function.mulSupport_pow
theorem
[Monoid M] (f : α → M) (n : ℕ) : (mulSupport fun x => f x ^ n) ⊆ mulSupport f
@[to_additive]
theorem mulSupport_pow [Monoid M] (f : α → M) (n : ℕ) :
(mulSupport fun x => f x ^ n) ⊆ mulSupport f := by
induction n with
| zero => simp [pow_zero, mulSupport_one]
| succ n hfn =>
simpa only [pow_succ'] using (mulSupport_mul f _).trans (union_subset Subset.rfl hfn)
Function.mulSupport_inv
theorem
: (mulSupport fun x => (f x)⁻¹) = mulSupport f
@[to_additive (attr := simp)]
theorem mulSupport_inv : (mulSupport fun x => (f x)⁻¹) = mulSupport f :=
ext fun _ => inv_ne_one
Function.mulSupport_inv'
theorem
: mulSupport f⁻¹ = mulSupport f
@[to_additive (attr := simp)]
theorem mulSupport_inv' : mulSupport f⁻¹ = mulSupport f :=
mulSupport_inv f
Function.mulSupport_mul_inv
theorem
: (mulSupport fun x => f x * (g x)⁻¹) ⊆ mulSupport f ∪ mulSupport g
@[to_additive]
theorem mulSupport_mul_inv : (mulSupport fun x => f x * (g x)⁻¹) ⊆ mulSupport f ∪ mulSupport g :=
mulSupport_binop_subset (fun a b => a * b⁻¹) (by simp) f g
Function.mulSupport_div
theorem
: (mulSupport fun x => f x / g x) ⊆ mulSupport f ∪ mulSupport g
@[to_additive]
theorem mulSupport_div : (mulSupport fun x => f x / g x) ⊆ mulSupport f ∪ mulSupport g :=
mulSupport_binop_subset (· / ·) one_div_one f g
Set.image_inter_mulSupport_eq
theorem
{s : Set β} {g : β → α} : g '' s ∩ mulSupport f = g '' (s ∩ mulSupport (f ∘ g))
@[to_additive]
theorem image_inter_mulSupport_eq {s : Set β} {g : β → α} :
g '' sg '' s ∩ mulSupport f = g '' (s ∩ mulSupport (f ∘ g)) := by
rw [mulSupport_comp_eq_preimage f g, image_inter_preimage]
Pi.mulSupport_mulSingle_subset
theorem
: mulSupport (mulSingle a b) ⊆ { a }
@[to_additive]
theorem mulSupport_mulSingle_subset : mulSupportmulSupport (mulSingle a b) ⊆ {a} := fun _ hx =>
by_contra fun hx' => hx <| mulSingle_eq_of_ne hx' _
Pi.mulSupport_mulSingle_one
theorem
: mulSupport (mulSingle a (1 : B)) = ∅
@[to_additive]
theorem mulSupport_mulSingle_one : mulSupport (mulSingle a (1 : B)) = ∅ := by simp
Pi.mulSupport_mulSingle_of_ne
theorem
(h : b ≠ 1) : mulSupport (mulSingle a b) = { a }
@[to_additive (attr := simp)]
theorem mulSupport_mulSingle_of_ne (h : b ≠ 1) : mulSupport (mulSingle a b) = {a} :=
mulSupport_mulSingle_subset.antisymm fun x (hx : x = a) => by
rwa [mem_mulSupport, hx, mulSingle_eq_same]
Pi.mulSupport_mulSingle
theorem
[DecidableEq B] : mulSupport (mulSingle a b) = if b = 1 then ∅ else { a }
@[to_additive]
theorem mulSupport_mulSingle [DecidableEq B] :
mulSupport (mulSingle a b) = if b = 1 then ∅ else {a} := by split_ifs with h <;> simp [h]
Pi.mulSupport_mulSingle_disjoint
theorem
{b' : B} (hb : b ≠ 1) (hb' : b' ≠ 1) {i j : A} :
Disjoint (mulSupport (mulSingle i b)) (mulSupport (mulSingle j b')) ↔ i ≠ j
@[to_additive]
theorem mulSupport_mulSingle_disjoint {b' : B} (hb : b ≠ 1) (hb' : b' ≠ 1) {i j : A} :
DisjointDisjoint (mulSupport (mulSingle i b)) (mulSupport (mulSingle j b')) ↔ i ≠ j := by
rw [mulSupport_mulSingle_of_ne hb, mulSupport_mulSingle_of_ne hb', disjoint_singleton]