The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Set.Piecewise

33 declarations. Mathlib docs · Source

theorem Set.piecewise.congr_simp E1 #

∀ {α : Type u} {β : α → Sort v} (s s_1 : Set α),
  s = s_1 →
    ∀ (f f_1 : (i : α) → β i),
      f = f_1 →
        ∀ (g g_1 : (i : α) → β i),
          g = g_1 →
            ∀ {inst : (j : α) → Decidable (j ∈ s)} [inst_1 : (j : α) → Decidable (j ∈ s_1)] (i : α),
              s.piecewise f g i = s_1.piecewise f_1 g_1 i

theorem Set.piecewise_empty E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (f g : (i : α) → δ i) [inst : (i : α) → Decidable (i ∈ ∅)], ∅.piecewise f g = g

theorem Set.piecewise_univ E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (f g : (i : α) → δ i) [inst : (i : α) → Decidable (i ∈ Set.univ)],
  Set.univ.piecewise f g = f

theorem Set.piecewise_insert_self E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) {j : α}
  [inst : (i : α) → Decidable (i ∈ insert j s)], (insert j s).piecewise f g j = f j

theorem Set.piecewise_insert E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  [inst_1 : DecidableEq α] (j : α) [inst_2 : (i : α) → Decidable (i ∈ insert j s)],
  (insert j s).piecewise f g = Function.update (s.piecewise f g) j (f j)

theorem Set.piecewise_eq_of_mem E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)] {i : α},
  i ∈ s → s.piecewise f g i = f i

theorem Set.piecewise_eq_of_notMem E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)] {i : α},
  i ∉ s → s.piecewise f g i = g i

theorem Set.piecewise_singleton E1 #

∀ {α : Type u_1} {β : Type u_2} (x : α) [inst : (y : α) → Decidable (y ∈ {x})] [inst_1 : DecidableEq α] (f g : α → β),
  {x}.piecewise f g = Function.update g x (f x)

theorem Set.piecewise_eqOn E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] (f g : α → β),
  Set.EqOn (s.piecewise f g) f s

theorem Set.piecewise_eqOn_compl E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] (f g : α → β),
  Set.EqOn (s.piecewise f g) g sᶜ

theorem Set.piecewise_le E1 #

∀ {α : Type u_1} {δ : α → Type u_7} [inst : (i : α) → Preorder (δ i)] {s : Set α} [inst_1 : (j : α) → Decidable (j ∈ s)]
  {f₁ f₂ g : (i : α) → δ i}, (∀ i ∈ s, f₁ i ≤ g i) → (∀ i ∉ s, f₂ i ≤ g i) → s.piecewise f₁ f₂ ≤ g

theorem Set.le_piecewise E1 #

∀ {α : Type u_1} {δ : α → Type u_7} [inst : (i : α) → Preorder (δ i)] {s : Set α} [inst_1 : (j : α) → Decidable (j ∈ s)]
  {f₁ f₂ g : (i : α) → δ i}, (∀ i ∈ s, g i ≤ f₁ i) → (∀ i ∉ s, g i ≤ f₂ i) → g ≤ s.piecewise f₁ f₂

theorem Set.piecewise_mono E1 #

∀ {α : Type u_1} {δ : α → Type u_7} [inst : (i : α) → Preorder (δ i)] {s : Set α} [inst_1 : (j : α) → Decidable (j ∈ s)]
  {f₁ f₂ g₁ g₂ : (i : α) → δ i}, (∀ i ∈ s, f₁ i ≤ g₁ i) → (∀ i ∉ s, f₂ i ≤ g₂ i) → s.piecewise f₁ f₂ ≤ s.piecewise g₁ g₂

theorem Set.piecewise_insert_of_ne E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)] {i j : α},
  i ≠ j → ∀ [inst_1 : (i : α) → Decidable (i ∈ insert j s)], (insert j s).piecewise f g i = s.piecewise f g i

theorem Set.piecewise_compl E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  [inst_1 : (i : α) → Decidable (i ∈ sᶜ)], sᶜ.piecewise f g = s.piecewise g f

theorem Set.piecewise_range_comp E0 #

∀ {α : Type u_1} {β : Type u_2} {ι : Sort u_7} (f : ι → α) [inst : (j : α) → Decidable (j ∈ Set.range f)]
  (g₁ g₂ : α → β), (Set.range f).piecewise g₁ g₂ ∘ f = g₁ ∘ f

theorem Set.piecewise_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] (f g : α → γ)
  (h : β → α), s.piecewise f g ∘ h = (h ⁻¹' s).piecewise (f ∘ h) (g ∘ h)

theorem Set.MapsTo.piecewise_ite E1 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ s₂ : Set α} {t t₁ t₂ : Set β} {f₁ f₂ : α → β}
  [inst : (i : α) → Decidable (i ∈ s)],
  Set.MapsTo f₁ (s₁ ∩ s) (t₁ ∩ t) →
    Set.MapsTo f₂ (s₂ ∩ sᶜ) (t₂ ∩ tᶜ) → Set.MapsTo (s.piecewise f₁ f₂) (s.ite s₁ s₂) (t.ite t₁ t₂)

theorem Set.eqOn_piecewise E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] {f f' g : α → β} {t : Set α},
  Set.EqOn (s.piecewise f f') g t ↔ Set.EqOn f g (t ∩ s) ∧ Set.EqOn f' g (t ∩ sᶜ)

theorem Set.EqOn.piecewise_ite' E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] {f f' g : α → β} {t t' : Set α},
  Set.EqOn f g (t ∩ s) → Set.EqOn f' g (t' ∩ sᶜ) → Set.EqOn (s.piecewise f f') g (s.ite t t')

theorem Set.EqOn.piecewise_ite E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] {f f' g : α → β} {t t' : Set α},
  Set.EqOn f g t → Set.EqOn f' g t' → Set.EqOn (s.piecewise f f') g (s.ite t t')

theorem Set.piecewise_preimage E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] (f g : α → β) (t : Set β),
  s.piecewise f g ⁻¹' t = s.ite (f ⁻¹' t) (g ⁻¹' t)

theorem Set.apply_piecewise E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  {δ' : α → Sort u_7} (h : (i : α) → δ i → δ' i) {x : α},
  h x (s.piecewise f g x) = s.piecewise (fun x ↦ h x (f x)) (fun x ↦ h x (g x)) x

theorem Set.apply_piecewise₂ E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  {δ' : α → Sort u_7} {δ'' : α → Sort u_8} (f' g' : (i : α) → δ' i) (h : (i : α) → δ i → δ' i → δ'' i) {x : α},
  h x (s.piecewise f g x) (s.piecewise f' g' x) = s.piecewise (fun x ↦ h x (f x) (f' x)) (fun x ↦ h x (g x) (g' x)) x

theorem Set.piecewise_op E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  {δ' : α → Sort u_7} (h : (i : α) → δ i → δ' i),
  (s.piecewise (fun x ↦ h x (f x)) fun x ↦ h x (g x)) = fun x ↦ h x (s.piecewise f g x)

theorem Set.piecewise_op₂ E1 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f g : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)]
  {δ' : α → Sort u_7} {δ'' : α → Sort u_8} (f' g' : (i : α) → δ' i) (h : (i : α) → δ i → δ' i → δ'' i),
  (s.piecewise (fun x ↦ h x (f x) (f' x)) fun x ↦ h x (g x) (g' x)) = fun x ↦
    h x (s.piecewise f g x) (s.piecewise f' g' x)

theorem Set.piecewise_same E0 #

∀ {α : Type u_1} {δ : α → Sort u_6} (s : Set α) (f : (i : α) → δ i) [inst : (j : α) → Decidable (j ∈ s)],
  s.piecewise f f = f

theorem Set.range_piecewise E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] (f g : α → β),
  Set.range (s.piecewise f g) = f '' s ∪ g '' sᶜ

theorem Set.injective_piecewise_iff E0 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] {f g : α → β},
  Function.Injective (s.piecewise f g) ↔ Set.InjOn f s ∧ Set.InjOn g sᶜ ∧ ∀ x ∈ s, ∀ y ∉ s, f x ≠ g y

theorem Set.piecewise_mem_pi E1 #

∀ {α : Type u_1} (s : Set α) [inst : (j : α) → Decidable (j ∈ s)] {δ : α → Type u_7} {t : Set α}
  {t' : (i : α) → Set (δ i)} {f g : (i : α) → δ i}, f ∈ t.pi t' → g ∈ t.pi t' → s.piecewise f g ∈ t.pi t'

theorem Set.pi_piecewise E0 #

∀ {ι : Type u_7} {α : ι → Type u_8} (s s' : Set ι) (t t' : (i : ι) → Set (α i)) [inst : (x : ι) → Decidable (x ∈ s')],
  s.pi (s'.piecewise t t') = (s ∩ s').pi t ∩ (s \ s').pi t'

theorem Set.univ_pi_piecewise E1 #

∀ {ι : Type u_7} {α : ι → Type u_8} (s : Set ι) (t t' : (i : ι) → Set (α i)) [inst : (x : ι) → Decidable (x ∈ s)],
  Set.univ.pi (s.piecewise t t') = s.pi t ∩ sᶜ.pi t'

theorem Set.univ_pi_piecewise_univ E1 #

∀ {ι : Type u_7} {α : ι → Type u_8} (s : Set ι) (t : (i : ι) → Set (α i)) [inst : (x : ι) → Decidable (x ∈ s)],
  Set.univ.pi (s.piecewise t fun x ↦ Set.univ) = s.pi t