File: Mathlib/Logic/Equiv/Set.lean

full_name: Equiv.range_eq_univ
code: @[simp]
theorem range_eq_univ {α : Type*} {β : Type*} (e : α ≃ β) : range e = univ 
goal: Set.range ⇑e = Set.univ

full_name: Equiv.image_eq_preimage
code: protected theorem image_eq_preimage {α β} (e : α ≃ β) (s : Set α) : e '' s = e.symm ⁻¹' s 
goal: ⇑e '' s = ⇑e.symm ⁻¹' s

full_name: Set.mem_image_equiv
code: @[simp 1001]
theorem _root_.Set.mem_image_equiv {α β} {S : Set α} {f : α ≃ β} {x : β} :
    x ∈ f '' S ↔ f.symm x ∈ S 
goal: x ∈ ⇑f '' S ↔ f.symm x ∈ S

full_name: Set.image_equiv_eq_preimage_symm
code: /-- Alias for `Equiv.image_eq_preimage` -/
theorem _root_.Set.image_equiv_eq_preimage_symm {α β} (S : Set α) (f : α ≃ β) :
    f '' S = f.symm ⁻¹' S 
goal: ⇑f '' S = ⇑f.symm ⁻¹' S

full_name: Set.preimage_equiv_eq_image_symm
code: /-- Alias for `Equiv.image_eq_preimage` -/
theorem _root_.Set.preimage_equiv_eq_image_symm {α β} (S : Set α) (f : β ≃ α) :
    f ⁻¹' S = f.symm '' S 
goal: ⇑f ⁻¹' S = ⇑f.symm '' S

full_name: Equiv.symm_image_subset
code: @[simp high]
protected theorem symm_image_subset {α β} (e : α ≃ β) (s : Set α) (t : Set β) :
    e.symm '' t ⊆ s ↔ t ⊆ e '' s 
goal: ⇑e.symm '' t ⊆ s ↔ t ⊆ ⇑e '' s

full_name: Equiv.subset_symm_image
code: @[simp high]
protected theorem subset_symm_image {α β} (e : α ≃ β) (s : Set α) (t : Set β) :
    s ⊆ e.symm '' t ↔ e '' s ⊆ t 
goal: s ⊆ ⇑e.symm '' t ↔ ⇑e '' s ⊆ t

full_name: Equiv.symm_image_image
code: @[simp]
theorem symm_image_image {α β} (e : α ≃ β) (s : Set α) : e.symm '' (e '' s) = s 
goal: ⇑e.symm '' (⇑e '' s) = s

full_name: Equiv.eq_image_iff_symm_image_eq
code: theorem eq_image_iff_symm_image_eq {α β} (e : α ≃ β) (s : Set α) (t : Set β) :
    t = e '' s ↔ e.symm '' t = s 
goal: t = ⇑e '' s ↔ ⇑e.symm '' t = s

full_name: Equiv.image_symm_image
code: @[simp]
theorem image_symm_image {α β} (e : α ≃ β) (s : Set β) : e '' (e.symm '' s) = s 
goal: ⇑e '' (⇑e.symm '' s) = s

full_name: Equiv.image_preimage
code: @[simp]
theorem image_preimage {α β} (e : α ≃ β) (s : Set β) : e '' (e ⁻¹' s) = s 
goal: ⇑e '' (⇑e ⁻¹' s) = s

full_name: Equiv.preimage_image
code: @[simp]
theorem preimage_image {α β} (e : α ≃ β) (s : Set α) : e ⁻¹' (e '' s) = s 
goal: ⇑e ⁻¹' (⇑e '' s) = s

full_name: Equiv.image_compl
code: protected theorem image_compl {α β} (f : Equiv α β) (s : Set α) : f '' sᶜ = (f '' s)ᶜ 
goal: ⇑f '' sᶜ = (⇑f '' s)ᶜ

full_name: Equiv.symm_preimage_preimage
code: @[simp]
theorem symm_preimage_preimage {α β} (e : α ≃ β) (s : Set β) : e.symm ⁻¹' (e ⁻¹' s) = s 
goal: ⇑e.symm ⁻¹' (⇑e ⁻¹' s) = s

full_name: Equiv.preimage_symm_preimage
code: @[simp]
theorem preimage_symm_preimage {α β} (e : α ≃ β) (s : Set α) : e ⁻¹' (e.symm ⁻¹' s) = s 
goal: ⇑e ⁻¹' (⇑e.symm ⁻¹' s) = s

full_name: Equiv.preimage_subset
code: theorem preimage_subset {α β} (e : α ≃ β) (s t : Set β) : e ⁻¹' s ⊆ e ⁻¹' t ↔ s ⊆ t 
goal: ⇑e ⁻¹' s ⊆ ⇑e ⁻¹' t ↔ s ⊆ t

full_name: Equiv.image_subset
code: theorem image_subset {α β} (e : α ≃ β) (s t : Set α) : e '' s ⊆ e '' t ↔ s ⊆ t 
goal: ⇑e '' s ⊆ ⇑e '' t ↔ s ⊆ t

full_name: Equiv.image_eq_iff_eq
code: @[simp]
theorem image_eq_iff_eq {α β} (e : α ≃ β) (s t : Set α) : e '' s = e '' t ↔ s = t 
goal: ⇑e '' s = ⇑e '' t ↔ s = t

full_name: Equiv.preimage_eq_iff_eq_image
code: theorem preimage_eq_iff_eq_image {α β} (e : α ≃ β) (s t) : e ⁻¹' s = t ↔ s = e '' t 
goal: ⇑e ⁻¹' s = t ↔ s = ⇑e '' t

full_name: Equiv.eq_preimage_iff_image_eq
code: theorem eq_preimage_iff_image_eq {α β} (e : α ≃ β) (s t) : s = e ⁻¹' t ↔ e '' s = t 
goal: s = ⇑e ⁻¹' t ↔ ⇑e '' s = t

full_name: Equiv.setOf_apply_symm_eq_image_setOf
code: lemma setOf_apply_symm_eq_image_setOf {α β} (e : α ≃ β) (p : α → Prop) :
    {b | p (e.symm b)} = e '' {a | p a} 
goal: {b | p (e.symm b)} = ⇑e '' {a | p a}

full_name: Equiv.prod_assoc_preimage
code: @[simp]
theorem prod_assoc_preimage {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    Equiv.prodAssoc α β γ ⁻¹' s ×ˢ t ×ˢ u = (s ×ˢ t) ×ˢ u 
goal: ⇑(Equiv.prodAssoc α β γ) ⁻¹' s ×ˢ t ×ˢ u = (s ×ˢ t) ×ˢ u

full_name: Equiv.prod_assoc_symm_preimage
code: @[simp]
theorem prod_assoc_symm_preimage {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    (Equiv.prodAssoc α β γ).symm ⁻¹' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u 
goal: ⇑(Equiv.prodAssoc α β γ).symm ⁻¹' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u

full_name: Equiv.prod_assoc_image
code: theorem prod_assoc_image {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    Equiv.prodAssoc α β γ '' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u 
goal: ⇑(Equiv.prodAssoc α β γ) '' (s ×ˢ t) ×ˢ u = s ×ˢ t ×ˢ u

full_name: Equiv.prod_assoc_symm_image
code: theorem prod_assoc_symm_image {α β γ} {s : Set α} {t : Set β} {u : Set γ} :
    (Equiv.prodAssoc α β γ).symm '' s ×ˢ t ×ˢ u = (s ×ˢ t) ×ˢ u 
goal: ⇑(Equiv.prodAssoc α β γ).symm '' s ×ˢ t ×ˢ u = (s ×ˢ t) ×ˢ u

full_name: Equiv.setProdEquivSigma
code: /-- A set `s` in `α × β` is equivalent to the sigma-type `Σ x, {y | (x, y) ∈ s}`. -/
def setProdEquivSigma {α β : Type*} (s : Set (α × β)) :
    s ≃ Σx : α, { y : β | (x, y) ∈ s } 
goal: ↑s ≃ (x : α) × ↑{y | (x, y) ∈ s}

full_name: Equiv.setCongr_apply
code: /-- The subtypes corresponding to equal sets are equivalent. -/
@[simps! apply]
def setCongr {α : Type*} {s t : Set α} (h : s = t) : s ≃ t 
goal: (Equiv.setCongr h) a = ⟨↑a, ⋯⟩

full_name: Equiv.setCongr
code: /-- The subtypes corresponding to equal sets are equivalent. -/
@[simps! apply]
def setCongr {α : Type*} {s t : Set α} (h : s = t) : s ≃ t 
goal: ↑s ≃ ↑t

full_name: Equiv.image
code: /-- A set is equivalent to its image under an equivalence.
-/
@[simps]
def image {α β : Type*} (e : α ≃ β) (s : Set α) :
    s ≃ e '' s 
goal: ↑s ≃ ↑(⇑e '' s)

full_name: Equiv.image_apply_coe
code: /-- A set is equivalent to its image under an equivalence.
-/
@[simps]
def image {α β : Type*} (e : α ≃ β) (s : Set α) :
    s ≃ e '' s 
goal: ↑((e.image s) x) = e ↑x

full_name: Equiv.image_symm_apply_coe
code: /-- A set is equivalent to its image under an equivalence.
-/
@[simps]
def image {α β : Type*} (e : α ≃ β) (s : Set α) :
    s ≃ e '' s 
goal: ↑((e.image s).symm y) = e.symm ↑y

full_name: Equiv.Set.univ
code: /-- `univ α` is equivalent to `α`. -/
protected def univ (α) : @univ α ≃ α 
goal: ↑Set.univ ≃ α

full_name: Equiv.Set.empty
code: /-- An empty set is equivalent to the `Empty` type. -/
protected def empty (α) : (∅ : Set α) ≃ Empty 
goal: ↑∅ ≃ Empty

full_name: Equiv.Set.pempty
code: /-- An empty set is equivalent to a `PEmpty` type. -/
protected def pempty (α) : (∅ : Set α) ≃ PEmpty 
goal: ↑∅ ≃ PEmpty.{u_2}

full_name: Equiv.Set.union'
code: /-- If sets `s` and `t` are separated by a decidable predicate, then `s ∪ t` is equivalent to
`s ⊕ t`. -/
protected def union' {α} {s t : Set α} (p : α → Prop) [DecidablePred p] (hs : ∀ x ∈ s, p x)
    (ht : ∀ x ∈ t, ¬p x) : (s ∪ t : Set α) ≃ s ⊕ t 
goal: ↑(s ∪ t) ≃ ↑s ⊕ ↑t

full_name: Equiv.Set.union
code: /-- If sets `s` and `t` are disjoint, then `s ∪ t` is equivalent to `s ⊕ t`. -/
protected def union {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅) :
    (s ∪ t : Set α) ≃ s ⊕ t 
goal: ↑(s ∪ t) ≃ ↑s ⊕ ↑t

full_name: Equiv.Set.union_apply_left
code: theorem union_apply_left {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    {a : (s ∪ t : Set α)} (ha : ↑a ∈ s) : Equiv.Set.union H a = Sum.inl ⟨a, ha⟩ 
goal: (Equiv.Set.union H) a = Sum.inl ⟨↑a, ha⟩

full_name: Equiv.Set.union_apply_right
code: theorem union_apply_right {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    {a : (s ∪ t : Set α)} (ha : ↑a ∈ t) : Equiv.Set.union H a = Sum.inr ⟨a, ha⟩ 
goal: (Equiv.Set.union H) a = Sum.inr ⟨↑a, ha⟩

full_name: Equiv.Set.union_symm_apply_left
code: @[simp]
theorem union_symm_apply_left {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    (a : s) : (Equiv.Set.union H).symm (Sum.inl a) = ⟨a, by simp⟩ 
goal: (Equiv.Set.union H).symm (Sum.inl a) = ⟨↑a, ⋯⟩

full_name: Equiv.Set.union_symm_apply_right
code: @[simp]
theorem union_symm_apply_right {α} {s t : Set α} [DecidablePred fun x => x ∈ s] (H : s ∩ t ⊆ ∅)
    (a : t) : (Equiv.Set.union H).symm (Sum.inr a) = ⟨a, by simp⟩ 
goal: (Equiv.Set.union H).symm (Sum.inr a) = ⟨↑a, ⋯⟩

full_name: Equiv.Set.singleton
code: /-- A singleton set is equivalent to a `PUnit` type. -/
protected def singleton {α} (a : α) : ({a} : Set α) ≃ PUnit.{u} 
goal: ↑{a} ≃ PUnit.{u}

full_name: Equiv.Set.ofEq_symm_apply
code: /-- Equal sets are equivalent.

TODO: this is the same as `Equiv.setCongr`! -/
@[simps! apply symm_apply]
protected def ofEq {α : Type u} {s t : Set α} (h : s = t) : s ≃ t 
goal: (Equiv.Set.ofEq h).symm b = ⟨↑b, ⋯⟩

full_name: Equiv.Set.ofEq_apply
code: /-- Equal sets are equivalent.

TODO: this is the same as `Equiv.setCongr`! -/
@[simps! apply symm_apply]
protected def ofEq {α : Type u} {s t : Set α} (h : s = t) : s ≃ t 
goal: (Equiv.Set.ofEq h) a = ⟨↑a, ⋯⟩

full_name: Equiv.Set.ofEq
code: /-- Equal sets are equivalent.

TODO: this is the same as `Equiv.setCongr`! -/
@[simps! apply symm_apply]
protected def ofEq {α : Type u} {s t : Set α} (h : s = t) : s ≃ t 
goal: ↑s ≃ ↑t

full_name: Equiv.Set.insert
code: /-- If `a ∉ s`, then `insert a s` is equivalent to `s ⊕ PUnit`. -/
protected def insert {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s) :
    (insert a s : Set α) ≃ s ⊕ PUnit.{u + 1} 
goal: ↑(insert a s) ≃ ↑s ⊕ PUnit.{u + 1}

full_name: Equiv.Set.insert_symm_apply_inl
code: @[simp]
theorem insert_symm_apply_inl {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s)
    (b : s) : (Equiv.Set.insert H).symm (Sum.inl b) = ⟨b, Or.inr b.2⟩ 
goal: (Equiv.Set.insert H).symm (Sum.inl b) = ⟨↑b, ⋯⟩

full_name: Equiv.Set.insert_symm_apply_inr
code: @[simp]
theorem insert_symm_apply_inr {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s)
    (b : PUnit.{u + 1}) : (Equiv.Set.insert H).symm (Sum.inr b) = ⟨a, Or.inl rfl⟩ 
goal: (Equiv.Set.insert H).symm (Sum.inr b) = ⟨a, ⋯⟩

full_name: Equiv.Set.insert_apply_left
code: @[simp]
theorem insert_apply_left {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s) :
    Equiv.Set.insert H ⟨a, Or.inl rfl⟩ = Sum.inr PUnit.unit 
goal: (Equiv.Set.insert H) ⟨a, ⋯⟩ = Sum.inr PUnit.unit

full_name: Equiv.Set.insert_apply_right
code: @[simp]
theorem insert_apply_right {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s) (b : s) :
    Equiv.Set.insert H ⟨b, Or.inr b.2⟩ = Sum.inl b 
goal: (Equiv.Set.insert H) ⟨↑b, ⋯⟩ = Sum.inl b

full_name: Equiv.Set.sumCompl
code: /-- If `s : Set α` is a set with decidable membership, then `s ⊕ sᶜ` is equivalent to `α`. -/
protected def sumCompl {α} (s : Set α) [DecidablePred (· ∈ s)] : s ⊕ (sᶜ : Set α) ≃ α 
goal: ↑s ⊕ ↑sᶜ ≃ α

full_name: Equiv.Set.sumCompl_apply_inl
code: @[simp]
theorem sumCompl_apply_inl {α : Type u} (s : Set α) [DecidablePred (· ∈ s)] (x : s) :
    Equiv.Set.sumCompl s (Sum.inl x) = x 
goal: (Equiv.Set.sumCompl s) (Sum.inl x) = ↑x

full_name: Equiv.Set.sumCompl_apply_inr
code: @[simp]
theorem sumCompl_apply_inr {α : Type u} (s : Set α) [DecidablePred (· ∈ s)] (x : (sᶜ : Set α)) :
    Equiv.Set.sumCompl s (Sum.inr x) = x 
goal: (Equiv.Set.sumCompl s) (Sum.inr x) = ↑x

full_name: Equiv.Set.sumCompl_symm_apply_of_mem
code: theorem sumCompl_symm_apply_of_mem {α : Type u} {s : Set α} [DecidablePred (· ∈ s)] {x : α}
    (hx : x ∈ s) : (Equiv.Set.sumCompl s).symm x = Sum.inl ⟨x, hx⟩ 
goal: (Equiv.Set.sumCompl s).symm x = Sum.inl ⟨x, hx⟩

full_name: Equiv.Set.sumCompl_symm_apply_of_not_mem
code: theorem sumCompl_symm_apply_of_not_mem {α : Type u} {s : Set α} [DecidablePred (· ∈ s)] {x : α}
    (hx : x ∉ s) : (Equiv.Set.sumCompl s).symm x = Sum.inr ⟨x, hx⟩ 
goal: (Equiv.Set.sumCompl s).symm x = Sum.inr ⟨x, hx⟩

full_name: Equiv.Set.sumCompl_symm_apply
code: @[simp]
theorem sumCompl_symm_apply {α : Type*} {s : Set α} [DecidablePred (· ∈ s)] {x : s} :
    (Equiv.Set.sumCompl s).symm x = Sum.inl x 
goal: (Equiv.Set.sumCompl s).symm ↑x = Sum.inl x

full_name: Equiv.Set.sumCompl_symm_apply_compl
code: @[simp]
theorem sumCompl_symm_apply_compl {α : Type*} {s : Set α} [DecidablePred (· ∈ s)]
    {x : (sᶜ : Set α)} : (Equiv.Set.sumCompl s).symm x = Sum.inr x 
goal: (Equiv.Set.sumCompl s).symm ↑x = Sum.inr x

full_name: Equiv.Set.sumDiffSubset
code: /-- `sumDiffSubset s t` is the natural equivalence between
`s ⊕ (t \ s)` and `t`, where `s` and `t` are two sets. -/
protected def sumDiffSubset {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)] :
    s ⊕ (t \ s : Set α) ≃ t 
goal: ↑s ⊕ ↑(t \ s) ≃ ↑t

full_name: Equiv.Set.sumDiffSubset_apply_inl
code: @[simp]
theorem sumDiffSubset_apply_inl {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)] (x : s) :
    Equiv.Set.sumDiffSubset h (Sum.inl x) = inclusion h x 
goal: (Equiv.Set.sumDiffSubset h) (Sum.inl x) = Set.inclusion h x

full_name: Equiv.Set.sumDiffSubset_apply_inr
code: @[simp]
theorem sumDiffSubset_apply_inr {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)]
    (x : (t \ s : Set α)) : Equiv.Set.sumDiffSubset h (Sum.inr x) = inclusion diff_subset x 
goal: (Equiv.Set.sumDiffSubset h) (Sum.inr x) = Set.inclusion ⋯ x

full_name: Equiv.Set.sumDiffSubset_symm_apply_of_mem
code: theorem sumDiffSubset_symm_apply_of_mem {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)]
    {x : t} (hx : x.1 ∈ s) : (Equiv.Set.sumDiffSubset h).symm x = Sum.inl ⟨x, hx⟩ 
goal: (Equiv.Set.sumDiffSubset h).symm x = Sum.inl ⟨↑x, hx⟩

full_name: Equiv.Set.sumDiffSubset_symm_apply_of_not_mem
code: theorem sumDiffSubset_symm_apply_of_not_mem {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)]
    {x : t} (hx : x.1 ∉ s) : (Equiv.Set.sumDiffSubset h).symm x = Sum.inr ⟨x, ⟨x.2, hx⟩⟩ 
goal: (Equiv.Set.sumDiffSubset h).symm x = Sum.inr ⟨↑x, ⋯⟩

full_name: Equiv.Set.unionSumInter
code: /-- If `s` is a set with decidable membership, then the sum of `s ∪ t` and `s ∩ t` is equivalent
to `s ⊕ t`. -/
protected def unionSumInter {α : Type u} (s t : Set α) [DecidablePred (· ∈ s)] :
    (s ∪ t : Set α) ⊕ (s ∩ t : Set α) ≃ s ⊕ t 
goal: ↑(s ∪ t) ⊕ ↑(s ∩ t) ≃ ↑s ⊕ ↑t

full_name: Equiv.Set.compl
code: /-- Given an equivalence `e₀` between sets `s : Set α` and `t : Set β`, the set of equivalences
`e : α ≃ β` such that `e ↑x = ↑(e₀ x)` for each `x : s` is equivalent to the set of equivalences
between `sᶜ` and `tᶜ`. -/
protected def compl {α : Type u} {β : Type v} {s : Set α} {t : Set β} [DecidablePred (· ∈ s)]
    [DecidablePred (· ∈ t)] (e₀ : s ≃ t) :
    { e : α ≃ β // ∀ x : s, e x = e₀ x } ≃ ((sᶜ : Set α) ≃ (tᶜ : Set β)) 
goal: { e // ∀ (x : ↑s), e ↑x = ↑(e₀ x) } ≃ (↑sᶜ ≃ ↑tᶜ)

full_name: Equiv.Set.prod
code: /-- The set product of two sets is equivalent to the type product of their coercions to types. -/
protected def prod {α β} (s : Set α) (t : Set β) : ↥(s ×ˢ t) ≃ s × t 
goal: ↑(s ×ˢ t) ≃ ↑s × ↑t

full_name: Equiv.Set.univPi_symm_apply_coe
code: /-- The set `Set.pi Set.univ s` is equivalent to `Π a, s a`. -/
@[simps]
protected def univPi {α : Type*} {β : α → Type*} (s : ∀ a, Set (β a)) :
    pi univ s ≃ ∀ a, s a 
goal: ↑((Equiv.Set.univPi s).symm f) a = ↑(f a)

full_name: Equiv.Set.univPi
code: /-- The set `Set.pi Set.univ s` is equivalent to `Π a, s a`. -/
@[simps]
protected def univPi {α : Type*} {β : α → Type*} (s : ∀ a, Set (β a)) :
    pi univ s ≃ ∀ a, s a 
goal: ↑(Set.univ.pi s) ≃ ((a : α) → ↑(s a))

full_name: Equiv.Set.univPi_apply_coe
code: /-- The set `Set.pi Set.univ s` is equivalent to `Π a, s a`. -/
@[simps]
protected def univPi {α : Type*} {β : α → Type*} (s : ∀ a, Set (β a)) :
    pi univ s ≃ ∀ a, s a 
goal: ↑((Equiv.Set.univPi s) f a) = ↑f a

full_name: Equiv.Set.imageOfInjOn
code: /-- If a function `f` is injective on a set `s`, then `s` is equivalent to `f '' s`. -/
protected noncomputable def imageOfInjOn {α β} (f : α → β) (s : Set α) (H : InjOn f s) :
    s ≃ f '' s 
goal: ↑s ≃ ↑(f '' s)

full_name: Equiv.Set.image_apply
code: /-- If `f` is an injective function, then `s` is equivalent to `f '' s`. -/
@[simps! apply]
protected noncomputable def image {α β} (f : α → β) (s : Set α) (H : Injective f) : s ≃ f '' s 
goal: (Equiv.Set.image f s H) p = ⟨f ↑p, ⋯⟩

full_name: Equiv.Set.image
code: /-- If `f` is an injective function, then `s` is equivalent to `f '' s`. -/
@[simps! apply]
protected noncomputable def image {α β} (f : α → β) (s : Set α) (H : Injective f) : s ≃ f '' s 
goal: ↑s ≃ ↑(f '' s)

full_name: Equiv.Set.image_symm_apply
code: @[simp]
protected theorem image_symm_apply {α β} (f : α → β) (s : Set α) (H : Injective f) (x : α)
    (h : f x ∈ f '' s) : (Set.image f s H).symm ⟨f x, h⟩ = ⟨x, H.mem_set_image.1 h⟩ 
goal: (Equiv.Set.image f s H).symm ⟨f x, h⟩ = ⟨x, ⋯⟩

full_name: Equiv.Set.image_symm_preimage
code: theorem image_symm_preimage {α β} {f : α → β} (hf : Injective f) (u s : Set α) :
    (fun x => (Set.image f s hf).symm x : f '' s → α) ⁻¹' u = Subtype.val ⁻¹' (f '' u) 
goal: (fun x => ↑((Equiv.Set.image f s hf).symm x)) ⁻¹' u = Subtype.val ⁻¹' (f '' u)

full_name: Equiv.Set.congr_symm_apply
code: /-- If `α` is equivalent to `β`, then `Set α` is equivalent to `Set β`. -/
@[simps]
protected def congr {α β : Type*} (e : α ≃ β) : Set α ≃ Set β 
goal: (Equiv.Set.congr e).symm t = ⇑e.symm '' t

full_name: Equiv.Set.congr
code: /-- If `α` is equivalent to `β`, then `Set α` is equivalent to `Set β`. -/
@[simps]
protected def congr {α β : Type*} (e : α ≃ β) : Set α ≃ Set β 
goal: Set α ≃ Set β

full_name: Equiv.Set.congr_apply
code: /-- If `α` is equivalent to `β`, then `Set α` is equivalent to `Set β`. -/
@[simps]
protected def congr {α β : Type*} (e : α ≃ β) : Set α ≃ Set β 
goal: (Equiv.Set.congr e) s = ⇑e '' s

full_name: Equiv.Set.sep
code: /-- The set `{x ∈ s | t x}` is equivalent to the set of `x : s` such that `t x`. -/
protected def sep {α : Type u} (s : Set α) (t : α → Prop) :
    ({ x ∈ s | t x } : Set α) ≃ { x : s | t x } 
goal: ↑{x | x ∈ s ∧ t x} ≃ ↑{x | t ↑x}

full_name: Equiv.Set.powerset
code: /-- The set `𝒫 S := {x | x ⊆ S}` is equivalent to the type `Set S`. -/
protected def powerset {α} (S : Set α) :
    𝒫 S ≃ Set S 
goal: ↑(𝒫 S) ≃ Set ↑S

full_name: Equiv.Set.rangeSplittingImageEquiv
code: /-- If `s` is a set in `range f`,
then its image under `rangeSplitting f` is in bijection (via `f`) with `s`.
-/
@[simps]
noncomputable def rangeSplittingImageEquiv {α β : Type*} (f : α → β) (s : Set (range f)) :
    rangeSplitting f '' s ≃ s 
goal: ↑(Set.rangeSplitting f '' s) ≃ ↑s

full_name: Equiv.Set.rangeSplittingImageEquiv_symm_apply_coe
code: /-- If `s` is a set in `range f`,
then its image under `rangeSplitting f` is in bijection (via `f`) with `s`.
-/
@[simps]
noncomputable def rangeSplittingImageEquiv {α β : Type*} (f : α → β) (s : Set (range f)) :
    rangeSplitting f '' s ≃ s 
goal: ↑((Equiv.Set.rangeSplittingImageEquiv f s).symm x) = Set.rangeSplitting f ↑x

full_name: Equiv.Set.rangeSplittingImageEquiv_apply_coe_coe
code: /-- If `s` is a set in `range f`,
then its image under `rangeSplitting f` is in bijection (via `f`) with `s`.
-/
@[simps]
noncomputable def rangeSplittingImageEquiv {α β : Type*} (f : α → β) (s : Set (range f)) :
    rangeSplitting f '' s ≃ s 
goal: ↑↑((Equiv.Set.rangeSplittingImageEquiv f s) x) = f ↑x

full_name: Equiv.Set.rangeInl_symm_apply_coe
code: /-- Equivalence between the range of `Sum.inl : α → α ⊕ β` and `α`. -/
@[simps symm_apply_coe]
def rangeInl (α β : Type*) : Set.range (Sum.inl : α → α ⊕ β) ≃ α 
goal: ↑((Equiv.Set.rangeInl α β).symm x) = Sum.inl x

full_name: Equiv.Set.rangeInl
code: /-- Equivalence between the range of `Sum.inl : α → α ⊕ β` and `α`. -/
@[simps symm_apply_coe]
def rangeInl (α β : Type*) : Set.range (Sum.inl : α → α ⊕ β) ≃ α 
goal: ↑(Set.range Sum.inl) ≃ α

full_name: Equiv.Set.rangeInl_apply_inl
code: @[simp] lemma rangeInl_apply_inl {α : Type*} (β : Type*) (x : α) :
    (rangeInl α β) ⟨.inl x, mem_range_self _⟩ = x 
goal: (Equiv.Set.rangeInl α β) ⟨Sum.inl x, ⋯⟩ = x

full_name: Equiv.Set.rangeInr
code: /-- Equivalence between the range of `Sum.inr : β → α ⊕ β` and `β`. -/
@[simps symm_apply_coe]
def rangeInr (α β : Type*) : Set.range (Sum.inr : β → α ⊕ β) ≃ β 
goal: ↑(Set.range Sum.inr) ≃ β

full_name: Equiv.Set.rangeInr_symm_apply_coe
code: /-- Equivalence between the range of `Sum.inr : β → α ⊕ β` and `β`. -/
@[simps symm_apply_coe]
def rangeInr (α β : Type*) : Set.range (Sum.inr : β → α ⊕ β) ≃ β 
goal: ↑((Equiv.Set.rangeInr α β).symm x) = Sum.inr x

full_name: Equiv.Set.rangeInr_apply_inr
code: @[simp] lemma rangeInr_apply_inr (α : Type*) {β : Type*} (x : β) :
    (rangeInr α β) ⟨.inr x, mem_range_self _⟩ = x 
goal: (Equiv.Set.rangeInr α β) ⟨Sum.inr x, ⋯⟩ = x

full_name: Equiv.ofLeftInverse
code: /-- If `f : α → β` has a left-inverse when `α` is nonempty, then `α` is computably equivalent to the
range of `f`.

While awkward, the `Nonempty α` hypothesis on `f_inv` and `hf` allows this to be used when `α` is
empty too. This hypothesis is absent on analogous definitions on stronger `Equiv`s like
`LinearEquiv.ofLeftInverse` and `RingEquiv.ofLeftInverse` as their typeclass assumptions
are already sufficient to ensure non-emptiness. -/
@[simps]
def ofLeftInverse {α β : Sort _} (f : α → β) (f_inv : Nonempty α → β → α)
    (hf : ∀ h : Nonempty α, LeftInverse (f_inv h) f) :
    α ≃ range f 
goal: α ≃ ↑(Set.range f)

full_name: Equiv.ofLeftInverse_symm_apply
code: /-- If `f : α → β` has a left-inverse when `α` is nonempty, then `α` is computably equivalent to the
range of `f`.

While awkward, the `Nonempty α` hypothesis on `f_inv` and `hf` allows this to be used when `α` is
empty too. This hypothesis is absent on analogous definitions on stronger `Equiv`s like
`LinearEquiv.ofLeftInverse` and `RingEquiv.ofLeftInverse` as their typeclass assumptions
are already sufficient to ensure non-emptiness. -/
@[simps]
def ofLeftInverse {α β : Sort _} (f : α → β) (f_inv : Nonempty α → β → α)
    (hf : ∀ h : Nonempty α, LeftInverse (f_inv h) f) :
    α ≃ range f 
goal: (Equiv.ofLeftInverse f f_inv hf).symm b = f_inv ⋯ ↑b

full_name: Equiv.ofLeftInverse_apply_coe
code: /-- If `f : α → β` has a left-inverse when `α` is nonempty, then `α` is computably equivalent to the
range of `f`.

While awkward, the `Nonempty α` hypothesis on `f_inv` and `hf` allows this to be used when `α` is
empty too. This hypothesis is absent on analogous definitions on stronger `Equiv`s like
`LinearEquiv.ofLeftInverse` and `RingEquiv.ofLeftInverse` as their typeclass assumptions
are already sufficient to ensure non-emptiness. -/
@[simps]
def ofLeftInverse {α β : Sort _} (f : α → β) (f_inv : Nonempty α → β → α)
    (hf : ∀ h : Nonempty α, LeftInverse (f_inv h) f) :
    α ≃ range f 
goal: ↑((Equiv.ofLeftInverse f f_inv hf) a) = f a

full_name: Equiv.ofLeftInverse'
code: /-- If `f : α → β` has a left-inverse, then `α` is computably equivalent to the range of `f`.

Note that if `α` is empty, no such `f_inv` exists and so this definition can't be used, unlike
the stronger but less convenient `ofLeftInverse`. -/
abbrev ofLeftInverse' {α β : Sort _} (f : α → β) (f_inv : β → α) (hf : LeftInverse f_inv f) :
    α ≃ range f 
goal: α ≃ ↑(Set.range f)

full_name: Equiv.ofInjective_apply
code: /-- If `f : α → β` is an injective function, then domain `α` is equivalent to the range of `f`. -/
@[simps! apply]
noncomputable def ofInjective {α β} (f : α → β) (hf : Injective f) : α ≃ range f 
goal: (Equiv.ofInjective f hf) a = ⟨f a, ⋯⟩

full_name: Equiv.ofInjective
code: /-- If `f : α → β` is an injective function, then domain `α` is equivalent to the range of `f`. -/
@[simps! apply]
noncomputable def ofInjective {α β} (f : α → β) (hf : Injective f) : α ≃ range f 
goal: α ≃ ↑(Set.range f)

full_name: Equiv.apply_ofInjective_symm
code: theorem apply_ofInjective_symm {α β} {f : α → β} (hf : Injective f) (b : range f) :
    f ((ofInjective f hf).symm b) = b 
goal: f ((Equiv.ofInjective f hf).symm b) = ↑b

full_name: Equiv.ofInjective_symm_apply
code: @[simp]
theorem ofInjective_symm_apply {α β} {f : α → β} (hf : Injective f) (a : α) :
    (ofInjective f hf).symm ⟨f a, ⟨a, rfl⟩⟩ = a 
goal: (Equiv.ofInjective f hf).symm ⟨f a, ⋯⟩ = a

full_name: Equiv.coe_ofInjective_symm
code: theorem coe_ofInjective_symm {α β} {f : α → β} (hf : Injective f) :
    ((ofInjective f hf).symm : range f → α) = rangeSplitting f 
goal: ⇑(Equiv.ofInjective f hf).symm = Set.rangeSplitting f

full_name: Equiv.self_comp_ofInjective_symm
code: @[simp]
theorem self_comp_ofInjective_symm {α β} {f : α → β} (hf : Injective f) :
    f ∘ (ofInjective f hf).symm = Subtype.val 
goal: f ∘ ⇑(Equiv.ofInjective f hf).symm = Subtype.val

full_name: Equiv.ofLeftInverse_eq_ofInjective
code: theorem ofLeftInverse_eq_ofInjective {α β : Type*} (f : α → β) (f_inv : Nonempty α → β → α)
    (hf : ∀ h : Nonempty α, LeftInverse (f_inv h) f) :
    ofLeftInverse f f_inv hf =
      ofInjective f ((isEmpty_or_nonempty α).elim (fun h _ _ _ => Subsingleton.elim _ _)
        (fun h => (hf h).injective)) 
goal: Equiv.ofLeftInverse f f_inv hf = Equiv.ofInjective f ⋯

full_name: Equiv.ofLeftInverse'_eq_ofInjective
code: theorem ofLeftInverse'_eq_ofInjective {α β : Type*} (f : α → β) (f_inv : β → α)
    (hf : LeftInverse f_inv f) : ofLeftInverse' f f_inv hf = ofInjective f hf.injective 
goal: Equiv.ofLeftInverse' f f_inv hf = Equiv.ofInjective f ⋯

full_name: Equiv.set_forall_iff
code: protected theorem set_forall_iff {α β} (e : α ≃ β) {p : Set α → Prop} :
    (∀ a, p a) ↔ ∀ a, p (e ⁻¹' a) 
goal: (∀ (a : Set α), p a) ↔ ∀ (a : Set β), p (⇑e ⁻¹' a)

full_name: Equiv.preimage_piEquivPiSubtypeProd_symm_pi
code: theorem preimage_piEquivPiSubtypeProd_symm_pi {α : Type*} {β : α → Type*} (p : α → Prop)
    [DecidablePred p] (s : ∀ i, Set (β i)) :
    (piEquivPiSubtypeProd p β).symm ⁻¹' pi univ s =
      (pi univ fun i : { i // p i } => s i) ×ˢ pi univ fun i : { i // ¬p i } => s i 
goal: ⇑(Equiv.piEquivPiSubtypeProd p β).symm ⁻¹' Set.univ.pi s = (Set.univ.pi fun i => s ↑i) ×ˢ Set.univ.pi fun i => s ↑i

full_name: Equiv.sigmaPreimageEquiv_apply
code: /-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α 
goal: (Equiv.sigmaPreimageEquiv f) x = ↑x.snd

full_name: Equiv.sigmaPreimageEquiv_symm_apply_snd_coe
code: /-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α 
goal: ↑((Equiv.sigmaPreimageEquiv f).symm x).snd = x

full_name: Equiv.sigmaPreimageEquiv
code: /-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α 
goal: (b : β) × ↑(f ⁻¹' {b}) ≃ α

full_name: Equiv.sigmaPreimageEquiv_symm_apply_fst
code: /-- `sigmaPreimageEquiv f` for `f : α → β` is the natural equivalence between
the type of all preimages of points under `f` and the total space `α`. -/
@[simps!]
def sigmaPreimageEquiv {α β} (f : α → β) : (Σb, f ⁻¹' {b}) ≃ α 
goal: ((Equiv.sigmaPreimageEquiv f).symm x).fst = f x

full_name: Equiv.ofPreimageEquiv_symm_apply
code: /-- A family of equivalences between preimages of points gives an equivalence between domains. -/
@[simps!]
def ofPreimageEquiv {α β γ} {f : α → γ} {g : β → γ} (e : ∀ c, f ⁻¹' {c} ≃ g ⁻¹' {c}) : α ≃ β 
goal: ∀ (a : β), (Equiv.ofPreimageEquiv e).symm a = ↑((Equiv.sigmaCongrRight e).symm ((Equiv.sigmaFiberEquiv g).symm a)).snd

full_name: Equiv.ofPreimageEquiv
code: /-- A family of equivalences between preimages of points gives an equivalence between domains. -/
@[simps!]
def ofPreimageEquiv {α β γ} {f : α → γ} {g : β → γ} (e : ∀ c, f ⁻¹' {c} ≃ g ⁻¹' {c}) : α ≃ β 
goal: α ≃ β

full_name: Equiv.ofPreimageEquiv_apply
code: /-- A family of equivalences between preimages of points gives an equivalence between domains. -/
@[simps!]
def ofPreimageEquiv {α β γ} {f : α → γ} {g : β → γ} (e : ∀ c, f ⁻¹' {c} ≃ g ⁻¹' {c}) : α ≃ β 
goal: ∀ (a : α), (Equiv.ofPreimageEquiv e) a = ↑((e (f a)) ((Equiv.sigmaFiberEquiv f).symm a).snd)

full_name: Equiv.ofPreimageEquiv_map
code: theorem ofPreimageEquiv_map {α β γ} {f : α → γ} {g : β → γ} (e : ∀ c, f ⁻¹' {c} ≃ g ⁻¹' {c})
    (a : α) : g (ofPreimageEquiv e a) = f a 
goal: g ((Equiv.ofPreimageEquiv e) a) = f a

full_name: Set.BijOn.equiv
code: /-- If a function is a bijection between two sets `s` and `t`, then it induces an
equivalence between the types `↥s` and `↥t`. -/
noncomputable def Set.BijOn.equiv {α : Type*} {β : Type*} {s : Set α} {t : Set β} (f : α → β)
    (h : BijOn f s t) : s ≃ t 
goal: ↑s ≃ ↑t

full_name: dite_comp_equiv_update
code: /-- The composition of an updated function with an equiv on a subtype can be expressed as an
updated function. -/
-- Porting note: replace `s : Set α` and `: s` with `p : α → Prop` and `: Subtype p`, since the
-- former now unfolds syntactically to a less general case of the latter.
theorem dite_comp_equiv_update {α : Type*} {β : Sort*} {γ : Sort*} {p : α → Prop}
    (e : β ≃ Subtype p)
    (v : β → γ) (w : α → γ) (j : β) (x : γ) [DecidableEq β] [DecidableEq α]
    [∀ j, Decidable (p j)] :
    (fun i : α => if h : p i then (Function.update v j x) (e.symm ⟨i, h⟩) else w i) =
      Function.update (fun i : α => if h : p i then v (e.symm ⟨i, h⟩) else w i) (e j) x 
goal: (fun i => if h : p i then Function.update v j x (e.symm ⟨i, h⟩) else w i) =
  Function.update (fun i => if h : p i then v (e.symm ⟨i, h⟩) else w i) (↑(e j)) x

full_name: Equiv.swap_bijOn_self
code: theorem Equiv.swap_bijOn_self (hs : a ∈ s ↔ b ∈ s) : BijOn (Equiv.swap a b) s s 
goal: Set.BijOn (⇑(Equiv.swap a b)) s s

full_name: Equiv.swap_bijOn_exchange
code: theorem Equiv.swap_bijOn_exchange (ha : a ∈ s) (hb : b ∉ s) :
    BijOn (Equiv.swap a b) s (insert b (s \ {a})) 
goal: Set.BijOn (⇑(Equiv.swap a b)) s (insert b (s \ {a}))