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.Finset.Update

17 declarations. Mathlib docs · Source

theorem Function.updateFinset.congr_simp E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {inst : DecidableEq ι} [inst_1 : DecidableEq ι] (x x_1 : (i : ι) → π i),
  x = x_1 →
    ∀ (s : Finset ι) (y y_1 : (i : ↥s) → π ↑i),
      y = y_1 → ∀ (i : ι), Function.updateFinset x s y i = Function.updateFinset x_1 s y_1 i

def Function.updateFinset E1 #

{ι : Type u_1} →
  {π : ι → Sort u_2} → [DecidableEq ι] → ((i : ι) → π i) → (s : Finset ι) → ((i : ↥s) → π ↑i) → (i : ι) → π i

updateFinset x s y is the vector x with the coordinates in s changed to the values of y.

theorem Function.updateFinset_def E0 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {s : Finset ι} {y : (i : ↥s) → π ↑i},
  Function.updateFinset x s y = fun i ↦ if hi : i ∈ s then y ⟨i, hi⟩ else x i

theorem Function.updateFinset_empty E0 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {y : (i : ↥∅) → π ↑i},
  Function.updateFinset x ∅ y = x

theorem Function.updateFinset_singleton E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {i : ι} {y : (i_1 : ↥{i}) → π ↑i_1},
  Function.updateFinset x {i} y = Function.update x i (y ⟨i, ⋯⟩)

theorem Function.update_eq_updateFinset E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {i : ι} {y : π i},
  Function.update x i y = Function.updateFinset x {i} (uniqueElim y)

theorem DependsOn.updateFinset E1 #

∀ {ι : Type u_2} {π : ι → Type u_3} [inst : DecidableEq ι] {α : Type u_1} {f : ((i : ι) → π i) → α} {s : Set ι},
  DependsOn f s → ∀ {t : Finset ι} (y : (i : ↥t) → π ↑i), DependsOn (fun x ↦ f (Function.updateFinset x t y)) (s \ ↑t)

If one replaces the variables indexed by a finite set t, then f no longer depends on those variables.

theorem DependsOn.update E1 #

∀ {ι : Type u_2} {π : ι → Type u_3} [inst : DecidableEq ι] {α : Type u_1} {f : ((i : ι) → π i) → α} {s : Finset ι},
  DependsOn f ↑s → ∀ (i : ι) (y : π i), DependsOn (fun x ↦ f (Function.update x i y)) ↑(s.erase i)

If one replaces the variable indexed by i, then f no longer depends on this variable.

theorem Function.updateFinset_updateFinset E1 #

∀ {ι : Type u_1} {π : ι → Type u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {s t : Finset ι} {y : (i : ↥s) → π ↑i}
  {z : (i : ↥t) → π ↑i} (hst : Disjoint s t),
  Function.updateFinset (Function.updateFinset x s y) t z =
    Function.updateFinset x (s ∪ t) ((Equiv.piFinsetUnion π hst) (y, z))

theorem Function.updateFinset_updateFinset_of_subset E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} [inst : DecidableEq ι] {s t : Finset ι},
  s ⊆ t →
    ∀ (x : (i : ι) → π i) (y : (i : ↥s) → π ↑i) (z : (i : ↥t) → π ↑i),
      Function.updateFinset (Function.updateFinset x s y) t z = Function.updateFinset x t z

theorem Function.restrict_updateFinset_of_subset E1 #

∀ {ι : Type u_1} {π : ι → Type u_2} [inst : DecidableEq ι] {s t : Finset ι} (hst : s ⊆ t) (x : (i : ι) → π i)
  (y : (i : ↥t) → π ↑i), s.restrict (Function.updateFinset x t y) = Finset.restrict₂ hst y

theorem Function.restrict_updateFinset E1 #

∀ {ι : Type u_1} {π : ι → Type u_2} [inst : DecidableEq ι] {s : Finset ι} (x : (i : ι) → π i) (y : (i : ↥s) → π ↑i),
  s.restrict (Function.updateFinset x s y) = y

theorem Function.updateFinset_restrict E0 #

∀ {ι : Type u_1} {π : ι → Type u_2} [inst : DecidableEq ι] {s : Finset ι} (x : (i : ι) → π i),
  Function.updateFinset x s (s.restrict x) = x

theorem Function.update_updateFinset E1 #

∀ {ι : Type u_1} {π : ι → Type u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {s : Finset ι} {y : (i : ↥s) → π ↑i}
  {i : ι} {z : π i} (hi : i ∉ s),
  Function.update (Function.updateFinset x s y) i z =
    Function.updateFinset x (s ∪ {i}) ((Equiv.piFinsetUnion π ⋯) (y, uniqueElim z))

theorem Function.updateFinset_congr E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] {s t : Finset ι} {y : (i : ↥s) → π ↑i}
  {z : (i : ↥t) → π ↑i} (h : s = t), Function.updateFinset x s y = Function.updateFinset x t fun i ↦ y ⟨↑i, ⋯⟩

theorem Function.updateFinset_univ E1 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] [inst_1 : Fintype ι]
  {y : (i : ↥Finset.univ) → π ↑i}, Function.updateFinset x Finset.univ y = fun i ↦ y ⟨i, ⋯⟩

theorem Function.updateFinset_univ_apply E0 #

∀ {ι : Type u_1} {π : ι → Sort u_2} {x : (i : ι) → π i} [inst : DecidableEq ι] [inst_1 : Fintype ι]
  {y : (i : ↥Finset.univ) → π ↑i} {i : ι}, Function.updateFinset x Finset.univ y i = y ⟨i, ⋯⟩