File: Mathlib/Data/Finset/Piecewise.lean

full_name: Finset.piecewise
code: /-- `s.piecewise f g` is the function equal to `f` on the finset `s`, and to `g` on its
complement. -/
def piecewise [∀ j, Decidable (j ∈ s)] : ∀ i, π i 
goal: π i

full_name: Finset.piecewise_insert_self
code: lemma piecewise_insert_self [DecidableEq ι] {j : ι} [∀ i, Decidable (i ∈ insert j s)] :
    (insert j s).piecewise f g j = f j 
goal: (insert j s).piecewise f g j = f j

full_name: Finset.piecewise_empty
code: @[simp]
lemma piecewise_empty [∀ i : ι, Decidable (i ∈ (∅ : Finset ι))] : piecewise ∅ f g = g 
goal: ∅.piecewise f g = g

full_name: Finset.piecewise_coe
code: @[norm_cast move]
lemma piecewise_coe [∀ j, Decidable (j ∈ (s : Set ι))] :
    (s : Set ι).piecewise f g = s.piecewise f g 
goal: (↑s).piecewise f g = s.piecewise f g

full_name: Finset.piecewise_eq_of_mem
code: @[simp]
lemma piecewise_eq_of_mem {i : ι} (hi : i ∈ s) : s.piecewise f g i = f i 
goal: s.piecewise f g i = f i

full_name: Finset.piecewise_eq_of_not_mem
code: @[simp]
lemma piecewise_eq_of_not_mem {i : ι} (hi : i ∉ s) : s.piecewise f g i = g i 
goal: s.piecewise f g i = g i

full_name: Finset.piecewise_congr
code: lemma piecewise_congr {f f' g g' : ∀ i, π i} (hf : ∀ i ∈ s, f i = f' i)
    (hg : ∀ i ∉ s, g i = g' i) : s.piecewise f g = s.piecewise f' g' 
goal: s.piecewise f g = s.piecewise f' g'

full_name: Finset.piecewise_insert_of_ne
code: @[simp]
lemma piecewise_insert_of_ne [DecidableEq ι] {i j : ι} [∀ i, Decidable (i ∈ insert j s)]
    (h : i ≠ j) : (insert j s).piecewise f g i = s.piecewise f g i 
goal: (insert j s).piecewise f g i = s.piecewise f g i

full_name: Finset.piecewise_insert
code: lemma piecewise_insert [DecidableEq ι] (j : ι) [∀ i, Decidable (i ∈ insert j s)] :
    (insert j s).piecewise f g = update (s.piecewise f g) j (f j) 
goal: (insert j s).piecewise f g = Function.update (s.piecewise f g) j (f j)

full_name: Finset.piecewise_cases
code: lemma piecewise_cases {i} (p : π i → Prop) (hf : p (f i)) (hg : p (g i)) :
    p (s.piecewise f g i) 
goal: p (s.piecewise f g i)

full_name: Finset.piecewise_singleton
code: lemma piecewise_singleton [DecidableEq ι] (i : ι) : piecewise {i} f g = update g i (f i) 
goal: {i}.piecewise f g = Function.update g i (f i)

full_name: Finset.piecewise_piecewise_of_subset_left
code: lemma piecewise_piecewise_of_subset_left {s t : Finset ι} [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ t)] (h : s ⊆ t) (f₁ f₂ g : ∀ a, π a) :
    s.piecewise (t.piecewise f₁ f₂) g = s.piecewise f₁ g 
goal: s.piecewise (t.piecewise f₁ f₂) g = s.piecewise f₁ g

full_name: Finset.piecewise_idem_left
code: @[simp]
lemma piecewise_idem_left (f₁ f₂ g : ∀ a, π a) :
    s.piecewise (s.piecewise f₁ f₂) g = s.piecewise f₁ g 
goal: s.piecewise (s.piecewise f₁ f₂) g = s.piecewise f₁ g

full_name: Finset.piecewise_piecewise_of_subset_right
code: lemma piecewise_piecewise_of_subset_right {s t : Finset ι} [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ t)] (h : t ⊆ s) (f g₁ g₂ : ∀ a, π a) :
    s.piecewise f (t.piecewise g₁ g₂) = s.piecewise f g₂ 
goal: s.piecewise f (t.piecewise g₁ g₂) = s.piecewise f g₂

full_name: Finset.piecewise_idem_right
code: @[simp]
lemma piecewise_idem_right (f g₁ g₂ : ∀ a, π a) :
    s.piecewise f (s.piecewise g₁ g₂) = s.piecewise f g₂ 
goal: s.piecewise f (s.piecewise g₁ g₂) = s.piecewise f g₂

full_name: Finset.update_eq_piecewise
code: lemma update_eq_piecewise {β : Type*} [DecidableEq ι] (f : ι → β) (i : ι) (v : β) :
    update f i v = piecewise (singleton i) (fun _ => v) f 
goal: Function.update f i v = {i}.piecewise (fun x => v) f

full_name: Finset.update_piecewise
code: lemma update_piecewise [DecidableEq ι] (i : ι) (v : π i) :
    update (s.piecewise f g) i v = s.piecewise (update f i v) (update g i v) 
goal: Function.update (s.piecewise f g) i v = s.piecewise (Function.update f i v) (Function.update g i v)

full_name: Finset.update_piecewise_of_mem
code: lemma update_piecewise_of_mem [DecidableEq ι] {i : ι} (hi : i ∈ s) (v : π i) :
    update (s.piecewise f g) i v = s.piecewise (update f i v) g 
goal: Function.update (s.piecewise f g) i v = s.piecewise (Function.update f i v) g

full_name: Finset.update_piecewise_of_not_mem
code: lemma update_piecewise_of_not_mem [DecidableEq ι] {i : ι} (hi : i ∉ s) (v : π i) :
    update (s.piecewise f g) i v = s.piecewise f (update g i v) 
goal: Function.update (s.piecewise f g) i v = s.piecewise f (Function.update g i v)

full_name: Finset.piecewise_same
code: lemma piecewise_same : s.piecewise f f = f 
goal: s.piecewise f f = f

full_name: Finset.piecewise_univ
code: @[simp]
lemma piecewise_univ [∀ i, Decidable (i ∈ (univ : Finset ι))] (f g : ∀ i, π i) :
    univ.piecewise f g = f 
goal: Finset.univ.piecewise f g = f

full_name: Finset.piecewise_compl
code: lemma piecewise_compl [DecidableEq ι] (s : Finset ι) [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ sᶜ)] (f g : ∀ i, π i) :
    sᶜ.piecewise f g = s.piecewise g f 
goal: sᶜ.piecewise f g = s.piecewise g f

full_name: Finset.piecewise_erase_univ
code: @[simp]
lemma piecewise_erase_univ [DecidableEq ι] (i : ι) (f g : ∀ i, π i) :
    (Finset.univ.erase i).piecewise f g = Function.update f i (g i) 
goal: (Finset.univ.erase i).piecewise f g = Function.update f i (g i)

full_name: Finset.piecewise_mem_set_pi
code: lemma piecewise_mem_set_pi (hf : f ∈ Set.pi t t') (hg : g ∈ Set.pi t t') :
    s.piecewise f g ∈ Set.pi t t' 
goal: s.piecewise f g ∈ t.pi t'

full_name: Finset.piecewise_le_of_le_of_le
code: lemma piecewise_le_of_le_of_le (hf : f ≤ h) (hg : g ≤ h) : s.piecewise f g ≤ h 
goal: s.piecewise f g ≤ h

full_name: Finset.le_piecewise_of_le_of_le
code: lemma le_piecewise_of_le_of_le (hf : h ≤ f) (hg : h ≤ g) : h ≤ s.piecewise f g 
goal: h ≤ s.piecewise f g

full_name: Finset.piecewise_le_piecewise'
code: lemma piecewise_le_piecewise' (hf : ∀ x ∈ s, f x ≤ f' x) (hg : ∀ x ∉ s, g x ≤ g' x) :
    s.piecewise f g ≤ s.piecewise f' g' 
goal: s.piecewise f g ≤ s.piecewise f' g'

full_name: Finset.piecewise_le_piecewise
code: lemma piecewise_le_piecewise (hf : f ≤ f') (hg : g ≤ g') : s.piecewise f g ≤ s.piecewise f' g' 
goal: s.piecewise f g ≤ s.piecewise f' g'

full_name: Finset.piecewise_mem_Icc_of_mem_of_mem
code: lemma piecewise_mem_Icc_of_mem_of_mem (hf : f ∈ Set.Icc f' g') (hg : g ∈ Set.Icc f' g') :
    s.piecewise f g ∈ Set.Icc f' g' 
goal: s.piecewise f g ∈ Set.Icc f' g'

full_name: Finset.piecewise_mem_Icc
code: lemma piecewise_mem_Icc (h : f ≤ g) : s.piecewise f g ∈ Set.Icc f g 
goal: s.piecewise f g ∈ Set.Icc f g

full_name: Finset.piecewise_mem_Icc'
code: lemma piecewise_mem_Icc' (h : g ≤ f) : s.piecewise f g ∈ Set.Icc g f 
goal: s.piecewise f g ∈ Set.Icc g f