File: Mathlib/Data/PEquiv.lean

full_name: PEquiv.inv
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
structure PEquiv (α : Type u) (β : Type v) where
  /-- The underlying partial function of a `PEquiv` -/
  toFun : α → Option β
  /-- The partial inverse of `toFun` -/
  invFun : β → Option α
  /-- `invFun` is the partial inverse of `toFun`  -/
  inv : ∀ (a : α) (b : β), a ∈ invFun b ↔ b ∈ toFun a
goal: a ∈ self.invFun b ↔ b ∈ self.toFun a

full_name: PEquiv.invFun
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
structure PEquiv (α : Type u) (β : Type v) where
  /-- The underlying partial function of a `PEquiv` -/
  toFun : α → Option β
  /-- The partial inverse of `toFun` -/
  invFun : β → Option α
  /-- `invFun` is the partial inverse of `toFun`  -/
  inv : ∀ (a : α) (b : β), a ∈ invFun b ↔ b ∈ toFun a
goal: β → Option α

full_name: PEquiv
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
structure PEquiv (α : Type u) (β : Type v) where
  /-- The underlying partial function of a `PEquiv` -/
  toFun : α → Option β
  /-- The partial inverse of `toFun` -/
  invFun : β → Option α
  /-- `invFun` is the partial inverse of `toFun`  -/
  inv : ∀ (a : α) (b : β), a ∈ invFun b ↔ b ∈ toFun a
goal: Type (max u v)

full_name: PEquiv.toFun
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
structure PEquiv (α : Type u) (β : Type v) where
  /-- The underlying partial function of a `PEquiv` -/
  toFun : α → Option β
  /-- The partial inverse of `toFun` -/
  invFun : β → Option α
  /-- `invFun` is the partial inverse of `toFun`  -/
  inv : ∀ (a : α) (b : β), a ∈ invFun b ↔ b ∈ toFun a
goal: α → Option β

full_name: «_aux_Mathlib_Data_PEquiv___macroRules_term_≃.__1»
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
infixr:25 " ≃. " => PEquiv
goal: Lean.Macro

full_name: _aux_Mathlib_Data_PEquiv___unexpand_PEquiv_1
code: /-- A `PEquiv` is a partial equivalence, a representation of a bijection between a subset
  of `α` and a subset of `β`. See also `PartialEquiv` for a version that requires `toFun` and
`invFun` to be globally defined functions and has `source` and `target` sets as extra fields. -/
infixr:25 " ≃. " => PEquiv
goal: Lean.PrettyPrinter.Unexpander

full_name: PEquiv.instFunLikeOption
code: instance : FunLike (α ≃. β) α (Option β) 
goal: FunLike (α ≃. β) α (Option β)

full_name: PEquiv.coe_mk
code: @[simp] theorem coe_mk (f₁ : α → Option β) (f₂ h) : (mk f₁ f₂ h : α → Option β) = f₁ 
goal: ⇑{ toFun := f₁, invFun := f₂, inv := h } = f₁

full_name: PEquiv.coe_mk_apply
code: theorem coe_mk_apply (f₁ : α → Option β) (f₂ : β → Option α) (h) (x : α) :
    (PEquiv.mk f₁ f₂ h : α → Option β) x = f₁ x 
goal: { toFun := f₁, invFun := f₂, inv := h } x = f₁ x

full_name: PEquiv.ext
code: @[ext] theorem ext {f g : α ≃. β} (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: PEquiv.ext_iff
code: theorem ext_iff {f g : α ≃. β} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : α), f x = g x

full_name: PEquiv.refl
code: /-- The identity map as a partial equivalence. -/
@[refl]
protected def refl (α : Type*) : α ≃. α 
goal: α ≃. α

full_name: PEquiv.symm
code: /-- The inverse partial equivalence. -/
@[symm]
protected def symm (f : α ≃. β) : β ≃. α 
goal: β ≃. α

full_name: PEquiv.mem_iff_mem
code: theorem mem_iff_mem (f : α ≃. β) : ∀ {a : α} {b : β}, a ∈ f.symm b ↔ b ∈ f a 
goal: a ∈ f.symm b ↔ b ∈ f a

full_name: PEquiv.eq_some_iff
code: theorem eq_some_iff (f : α ≃. β) : ∀ {a : α} {b : β}, f.symm b = some a ↔ f a = some b 
goal: f.symm b = some a ↔ f a = some b

full_name: PEquiv.trans
code: /-- Composition of partial equivalences `f : α ≃. β` and `g : β ≃. γ`. -/
@[trans]
protected def trans (f : α ≃. β) (g : β ≃. γ) :
    α ≃. γ 
goal: α ≃. γ

full_name: PEquiv.refl_apply
code: @[simp]
theorem refl_apply (a : α) : PEquiv.refl α a = some a 
goal: (PEquiv.refl α) a = some a

full_name: PEquiv.symm_refl
code: @[simp]
theorem symm_refl : (PEquiv.refl α).symm = PEquiv.refl α 
goal: (PEquiv.refl α).symm = PEquiv.refl α

full_name: PEquiv.symm_symm
code: @[simp]
theorem symm_symm (f : α ≃. β) : f.symm.symm = f 
goal: f.symm.symm = f

full_name: PEquiv.symm_bijective
code: theorem symm_bijective : Function.Bijective (PEquiv.symm : (α ≃. β) → β ≃. α) 
goal: Function.Bijective PEquiv.symm

full_name: PEquiv.symm_injective
code: theorem symm_injective : Function.Injective (@PEquiv.symm α β) 
goal: Function.Injective PEquiv.symm

full_name: PEquiv.trans_assoc
code: theorem trans_assoc (f : α ≃. β) (g : β ≃. γ) (h : γ ≃. δ) :
    (f.trans g).trans h = f.trans (g.trans h) 
goal: (f.trans g).trans h = f.trans (g.trans h)

full_name: PEquiv.mem_trans
code: theorem mem_trans (f : α ≃. β) (g : β ≃. γ) (a : α) (c : γ) :
    c ∈ f.trans g a ↔ ∃ b, b ∈ f a ∧ c ∈ g b 
goal: c ∈ (f.trans g) a ↔ ∃ b ∈ f a, c ∈ g b

full_name: PEquiv.trans_eq_some
code: theorem trans_eq_some (f : α ≃. β) (g : β ≃. γ) (a : α) (c : γ) :
    f.trans g a = some c ↔ ∃ b, f a = some b ∧ g b = some c 
goal: (f.trans g) a = some c ↔ ∃ b, f a = some b ∧ g b = some c

full_name: PEquiv.trans_eq_none
code: theorem trans_eq_none (f : α ≃. β) (g : β ≃. γ) (a : α) :
    f.trans g a = none ↔ ∀ b c, b ∉ f a ∨ c ∉ g b 
goal: (f.trans g) a = none ↔ ∀ (b : β) (c : γ), b ∉ f a ∨ c ∉ g b

full_name: PEquiv.refl_trans
code: @[simp]
theorem refl_trans (f : α ≃. β) : (PEquiv.refl α).trans f = f 
goal: (PEquiv.refl α).trans f = f

full_name: PEquiv.trans_refl
code: @[simp]
theorem trans_refl (f : α ≃. β) : f.trans (PEquiv.refl β) = f 
goal: f.trans (PEquiv.refl β) = f

full_name: PEquiv.inj
code: protected theorem inj (f : α ≃. β) {a₁ a₂ : α} {b : β} (h₁ : b ∈ f a₁) (h₂ : b ∈ f a₂) :
    a₁ = a₂ 
goal: a₁ = a₂

full_name: PEquiv.injective_of_forall_ne_isSome
code: /-- If the domain of a `PEquiv` is `α` except a point, its forward direction is injective. -/
theorem injective_of_forall_ne_isSome (f : α ≃. β) (a₂ : α)
    (h : ∀ a₁ : α, a₁ ≠ a₂ → isSome (f a₁)) : Injective f 
goal: Function.Injective ⇑f

full_name: PEquiv.injective_of_forall_isSome
code: /-- If the domain of a `PEquiv` is all of `α`, its forward direction is injective. -/
theorem injective_of_forall_isSome {f : α ≃. β} (h : ∀ a : α, isSome (f a)) : Injective f 
goal: Function.Injective ⇑f

full_name: PEquiv.ofSet
code: /-- Creates a `PEquiv` that is the identity on `s`, and `none` outside of it. -/
def ofSet (s : Set α) [DecidablePred (· ∈ s)] :
    α ≃. α 
goal: α ≃. α

full_name: PEquiv.mem_ofSet_self_iff
code: theorem mem_ofSet_self_iff {s : Set α} [DecidablePred (· ∈ s)] {a : α} : a ∈ ofSet s a ↔ a ∈ s 
goal: a ∈ (PEquiv.ofSet s) a ↔ a ∈ s

full_name: PEquiv.mem_ofSet_iff
code: theorem mem_ofSet_iff {s : Set α} [DecidablePred (· ∈ s)] {a b : α} :
    a ∈ ofSet s b ↔ a = b ∧ a ∈ s 
goal: a ∈ (PEquiv.ofSet s) b ↔ a = b ∧ a ∈ s

full_name: PEquiv.ofSet_eq_some_iff
code: @[simp]
theorem ofSet_eq_some_iff {s : Set α} {_ : DecidablePred (· ∈ s)} {a b : α} :
    ofSet s b = some a ↔ a = b ∧ a ∈ s 
goal: ∀ {x : DecidablePred fun x => x ∈ s} {a b : α}, (PEquiv.ofSet s) b = some a ↔ a = b ∧ a ∈ s

full_name: PEquiv.ofSet_eq_some_self_iff
code: theorem ofSet_eq_some_self_iff {s : Set α} {_ : DecidablePred (· ∈ s)} {a : α} :
    ofSet s a = some a ↔ a ∈ s 
goal: ∀ {x : DecidablePred fun x => x ∈ s} {a : α}, (PEquiv.ofSet s) a = some a ↔ a ∈ s

full_name: PEquiv.ofSet_symm
code: @[simp]
theorem ofSet_symm : (ofSet s).symm = ofSet s 
goal: (PEquiv.ofSet s).symm = PEquiv.ofSet s

full_name: PEquiv.ofSet_univ
code: @[simp]
theorem ofSet_univ : ofSet Set.univ = PEquiv.refl α 
goal: PEquiv.ofSet Set.univ = PEquiv.refl α

full_name: PEquiv.ofSet_eq_refl
code: @[simp]
theorem ofSet_eq_refl {s : Set α} [DecidablePred (· ∈ s)] :
    ofSet s = PEquiv.refl α ↔ s = Set.univ 
goal: PEquiv.ofSet s = PEquiv.refl α ↔ s = Set.univ

full_name: PEquiv.symm_trans_rev
code: theorem symm_trans_rev (f : α ≃. β) (g : β ≃. γ) : (f.trans g).symm = g.symm.trans f.symm 
goal: (f.trans g).symm = g.symm.trans f.symm

full_name: PEquiv.self_trans_symm
code: theorem self_trans_symm (f : α ≃. β) : f.trans f.symm = ofSet { a | (f a).isSome } 
goal: f.trans f.symm = PEquiv.ofSet {a | (f a).isSome = true}

full_name: PEquiv.symm_trans_self
code: theorem symm_trans_self (f : α ≃. β) : f.symm.trans f = ofSet { b | (f.symm b).isSome } 
goal: f.symm.trans f = PEquiv.ofSet {b | (f.symm b).isSome = true}

full_name: PEquiv.trans_symm_eq_iff_forall_isSome
code: theorem trans_symm_eq_iff_forall_isSome {f : α ≃. β} :
    f.trans f.symm = PEquiv.refl α ↔ ∀ a, isSome (f a) 
goal: f.trans f.symm = PEquiv.refl α ↔ ∀ (a : α), (f a).isSome = true

full_name: PEquiv.instBotPEquiv
code: instance instBotPEquiv : Bot (α ≃. β) 
goal: Bot (α ≃. β)

full_name: PEquiv.instInhabited
code: instance : Inhabited (α ≃. β) 
goal: Inhabited (α ≃. β)

full_name: PEquiv.bot_apply
code: @[simp]
theorem bot_apply (a : α) : (⊥ : α ≃. β) a = none 
goal: ⊥ a = none

full_name: PEquiv.symm_bot
code: @[simp]
theorem symm_bot : (⊥ : α ≃. β).symm = ⊥ 
goal: ⊥.symm = ⊥

full_name: PEquiv.trans_bot
code: @[simp]
theorem trans_bot (f : α ≃. β) : f.trans (⊥ : β ≃. γ) = ⊥ 
goal: f.trans ⊥ = ⊥

full_name: PEquiv.bot_trans
code: @[simp]
theorem bot_trans (f : β ≃. γ) : (⊥ : α ≃. β).trans f = ⊥ 
goal: ⊥.trans f = ⊥

full_name: PEquiv.isSome_symm_get
code: theorem isSome_symm_get (f : α ≃. β) {a : α} (h : isSome (f a)) :
    isSome (f.symm (Option.get _ h)) 
goal: (f.symm ((f a).get h)).isSome = true

full_name: PEquiv.single
code: /-- Create a `PEquiv` which sends `a` to `b` and `b` to `a`, but is otherwise `none`. -/
def single (a : α) (b : β) :
    α ≃. β 
goal: α ≃. β

full_name: PEquiv.mem_single
code: theorem mem_single (a : α) (b : β) : b ∈ single a b a 
goal: b ∈ (PEquiv.single a b) a

full_name: PEquiv.mem_single_iff
code: theorem mem_single_iff (a₁ a₂ : α) (b₁ b₂ : β) : b₁ ∈ single a₂ b₂ a₁ ↔ a₁ = a₂ ∧ b₁ = b₂ 
goal: b₁ ∈ (PEquiv.single a₂ b₂) a₁ ↔ a₁ = a₂ ∧ b₁ = b₂

full_name: PEquiv.symm_single
code: @[simp]
theorem symm_single (a : α) (b : β) : (single a b).symm = single b a 
goal: (PEquiv.single a b).symm = PEquiv.single b a

full_name: PEquiv.single_apply
code: @[simp]
theorem single_apply (a : α) (b : β) : single a b a = some b 
goal: (PEquiv.single a b) a = some b

full_name: PEquiv.single_apply_of_ne
code: theorem single_apply_of_ne {a₁ a₂ : α} (h : a₁ ≠ a₂) (b : β) : single a₁ b a₂ = none 
goal: (PEquiv.single a₁ b) a₂ = none

full_name: PEquiv.single_trans_of_mem
code: theorem single_trans_of_mem (a : α) {b : β} {c : γ} {f : β ≃. γ} (h : c ∈ f b) :
    (single a b).trans f = single a c 
goal: (PEquiv.single a b).trans f = PEquiv.single a c

full_name: PEquiv.trans_single_of_mem
code: theorem trans_single_of_mem {a : α} {b : β} (c : γ) {f : α ≃. β} (h : b ∈ f a) :
    f.trans (single b c) = single a c 
goal: f.trans (PEquiv.single b c) = PEquiv.single a c

full_name: PEquiv.single_trans_single
code: @[simp]
theorem single_trans_single (a : α) (b : β) (c : γ) :
    (single a b).trans (single b c) = single a c 
goal: (PEquiv.single a b).trans (PEquiv.single b c) = PEquiv.single a c

full_name: PEquiv.single_subsingleton_eq_refl
code: @[simp]
theorem single_subsingleton_eq_refl [Subsingleton α] (a b : α) : single a b = PEquiv.refl α 
goal: PEquiv.single a b = PEquiv.refl α

full_name: PEquiv.trans_single_of_eq_none
code: theorem trans_single_of_eq_none {b : β} (c : γ) {f : δ ≃. β} (h : f.symm b = none) :
    f.trans (single b c) = ⊥ 
goal: f.trans (PEquiv.single b c) = ⊥

full_name: PEquiv.single_trans_of_eq_none
code: theorem single_trans_of_eq_none (a : α) {b : β} {f : β ≃. δ} (h : f b = none) :
    (single a b).trans f = ⊥ 
goal: (PEquiv.single a b).trans f = ⊥

full_name: PEquiv.single_trans_single_of_ne
code: theorem single_trans_single_of_ne {b₁ b₂ : β} (h : b₁ ≠ b₂) (a : α) (c : γ) :
    (single a b₁).trans (single b₂ c) = ⊥ 
goal: (PEquiv.single a b₁).trans (PEquiv.single b₂ c) = ⊥

full_name: PEquiv.instPartialOrderPEquiv
code: instance instPartialOrderPEquiv : PartialOrder (α ≃. β) 
goal: PartialOrder (α ≃. β)

full_name: PEquiv.le_def
code: theorem le_def {f g : α ≃. β} : f ≤ g ↔ ∀ (a : α) (b : β), b ∈ f a → b ∈ g a 
goal: f ≤ g ↔ ∀ (a : α), ∀ b ∈ f a, b ∈ g a

full_name: PEquiv.instOrderBot
code: instance : OrderBot (α ≃. β) 
goal: OrderBot (α ≃. β)

full_name: PEquiv.instSemilatticeInfOfDecidableEq
code: instance [DecidableEq α] [DecidableEq β] : SemilatticeInf (α ≃. β) 
goal: SemilatticeInf (α ≃. β)

full_name: Equiv.toPEquiv
code: /-- Turns an `Equiv` into a `PEquiv` of the whole type. -/
def toPEquiv (f : α ≃ β) : α ≃. β 
goal: α ≃. β

full_name: Equiv.toPEquiv_refl
code: @[simp]
theorem toPEquiv_refl : (Equiv.refl α).toPEquiv = PEquiv.refl α 
goal: (Equiv.refl α).toPEquiv = PEquiv.refl α

full_name: Equiv.toPEquiv_trans
code: theorem toPEquiv_trans (f : α ≃ β) (g : β ≃ γ) :
    (f.trans g).toPEquiv = f.toPEquiv.trans g.toPEquiv 
goal: (f.trans g).toPEquiv = f.toPEquiv.trans g.toPEquiv

full_name: Equiv.toPEquiv_symm
code: theorem toPEquiv_symm (f : α ≃ β) : f.symm.toPEquiv = f.toPEquiv.symm 
goal: f.symm.toPEquiv = f.toPEquiv.symm

full_name: Equiv.toPEquiv_apply
code: theorem toPEquiv_apply (f : α ≃ β) (x : α) : f.toPEquiv x = some (f x) 
goal: f.toPEquiv x = some (f x)