Documentation

Mathlib.Data.PEquiv

Partial Equivalences #

In this file, we define partial equivalences PEquiv, which are a bijection between a subset of α and a subset of β. Notationally, a PEquiv is denoted by "≃." (note that the full stop is part of the notation). The way we store these internally is with two functions f : α → Option β and the reverse function g : β → Option α, with the condition that if f a is some b, then g b is some a.

Main results #

Canonical order #

PEquiv is canonically ordered by inclusion; that is, if a function f defined on a subset s is equal to g on that subset, but g is also defined on a larger set, then f ≤ g. We also have a definition of , which is the empty PEquiv (sends all to none), which in the end gives us a SemilatticeInf with an OrderBot instance.

Tags #

pequiv, partial equivalence

structure PEquiv (α : Type u) (β : Type v) :
Type (max u v)

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.

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.

Equations
instance PEquiv.instFunLikeOption {α : Type u} {β : Type v} :
FunLike (α ≃. β) α (Option β)
Equations
@[simp]
theorem PEquiv.coe_mk {α : Type u} {β : Type v} (f₁ : αOption β) (f₂ : βOption α) (h : ∀ (a : α) (b : β), a f₂ b b f₁ a) :
{ toFun := f₁, invFun := f₂, inv := h } = f₁
theorem PEquiv.coe_mk_apply {α : Type u} {β : Type v} (f₁ : αOption β) (f₂ : βOption α) (h : ∀ (a : α) (b : β), a f₂ b b f₁ a) (x : α) :
{ toFun := f₁, invFun := f₂, inv := h } x = f₁ x
theorem PEquiv.ext {α : Type u} {β : Type v} {f g : α ≃. β} (h : ∀ (x : α), f x = g x) :
f = g
def PEquiv.refl (α : Type u_1) :
α ≃. α

The identity map as a partial equivalence.

Equations
def PEquiv.symm {α : Type u} {β : Type v} (f : α ≃. β) :
β ≃. α

The inverse partial equivalence.

Equations
theorem PEquiv.mem_iff_mem {α : Type u} {β : Type v} (f : α ≃. β) {a : α} {b : β} :
a f.symm b b f a
theorem PEquiv.eq_some_iff {α : Type u} {β : Type v} (f : α ≃. β) {a : α} {b : β} :
f.symm b = some a f a = some b
def PEquiv.trans {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) (g : β ≃. γ) :
α ≃. γ

Composition of partial equivalences f : α ≃. β and g : β ≃. γ.

Equations
  • f.trans g = { toFun := fun (a : α) => (f a).bind g, invFun := fun (a : γ) => (g.symm a).bind f.symm, inv := }
@[simp]
theorem PEquiv.refl_apply {α : Type u} (a : α) :
(PEquiv.refl α) a = some a
@[simp]
@[simp]
theorem PEquiv.symm_symm {α : Type u} {β : Type v} (f : α ≃. β) :
f.symm.symm = f
theorem PEquiv.trans_assoc {α : Type u} {β : Type v} {γ : Type w} {δ : Type x} (f : α ≃. β) (g : β ≃. γ) (h : γ ≃. δ) :
(f.trans g).trans h = f.trans (g.trans h)
theorem PEquiv.mem_trans {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) (g : β ≃. γ) (a : α) (c : γ) :
c (f.trans g) a bf a, c g b
theorem PEquiv.trans_eq_some {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) (g : β ≃. γ) (a : α) (c : γ) :
(f.trans g) a = some c ∃ (b : β), f a = some b g b = some c
theorem PEquiv.trans_eq_none {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) (g : β ≃. γ) (a : α) :
(f.trans g) a = none ∀ (b : β) (c : γ), bf a cg b
@[simp]
theorem PEquiv.refl_trans {α : Type u} {β : Type v} (f : α ≃. β) :
@[simp]
theorem PEquiv.trans_refl {α : Type u} {β : Type v} (f : α ≃. β) :
theorem PEquiv.inj {α : Type u} {β : Type v} (f : α ≃. β) {a₁ a₂ : α} {b : β} (h₁ : b f a₁) (h₂ : b f a₂) :
a₁ = a₂
theorem PEquiv.injective_of_forall_ne_isSome {α : Type u} {β : Type v} (f : α ≃. β) (a₂ : α) (h : ∀ (a₁ : α), a₁ a₂(f a₁).isSome = true) :

If the domain of a PEquiv is α except a point, its forward direction is injective.

theorem PEquiv.injective_of_forall_isSome {α : Type u} {β : Type v} {f : α ≃. β} (h : ∀ (a : α), (f a).isSome = true) :

If the domain of a PEquiv is all of α, its forward direction is injective.

def PEquiv.ofSet {α : Type u} (s : Set α) [DecidablePred fun (x : α) => x s] :
α ≃. α

Creates a PEquiv that is the identity on s, and none outside of it.

Equations
theorem PEquiv.mem_ofSet_self_iff {α : Type u} {s : Set α} [DecidablePred fun (x : α) => x s] {a : α} :
a (ofSet s) a a s
theorem PEquiv.mem_ofSet_iff {α : Type u} {s : Set α} [DecidablePred fun (x : α) => x s] {a b : α} :
a (ofSet s) b a = b a s
@[simp]
theorem PEquiv.ofSet_eq_some_iff {α : Type u} {s : Set α} {x✝ : DecidablePred fun (x : α) => x s} {a b : α} :
(ofSet s) b = some a a = b a s
theorem PEquiv.ofSet_eq_some_self_iff {α : Type u} {s : Set α} {x✝ : DecidablePred fun (x : α) => x s} {a : α} :
(ofSet s) a = some a a s
@[simp]
theorem PEquiv.ofSet_symm {α : Type u} (s : Set α) [DecidablePred fun (x : α) => x s] :
@[simp]
theorem PEquiv.ofSet_eq_refl {α : Type u} {s : Set α} [DecidablePred fun (x : α) => x s] :
theorem PEquiv.symm_trans_rev {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) (g : β ≃. γ) :
theorem PEquiv.self_trans_symm {α : Type u} {β : Type v} (f : α ≃. β) :
f.trans f.symm = ofSet {a : α | (f a).isSome = true}
theorem PEquiv.symm_trans_self {α : Type u} {β : Type v} (f : α ≃. β) :
f.symm.trans f = ofSet {b : β | (f.symm b).isSome = true}
theorem PEquiv.trans_symm_eq_iff_forall_isSome {α : Type u} {β : Type v} {f : α ≃. β} :
f.trans f.symm = PEquiv.refl α ∀ (a : α), (f a).isSome = true
instance PEquiv.instBotPEquiv {α : Type u} {β : Type v} :
Bot (α ≃. β)
Equations
instance PEquiv.instInhabited {α : Type u} {β : Type v} :
Inhabited (α ≃. β)
Equations
@[simp]
theorem PEquiv.bot_apply {α : Type u} {β : Type v} (a : α) :
@[simp]
theorem PEquiv.symm_bot {α : Type u} {β : Type v} :
@[simp]
theorem PEquiv.trans_bot {α : Type u} {β : Type v} {γ : Type w} (f : α ≃. β) :
@[simp]
theorem PEquiv.bot_trans {α : Type u} {β : Type v} {γ : Type w} (f : β ≃. γ) :
theorem PEquiv.isSome_symm_get {α : Type u} {β : Type v} (f : α ≃. β) {a : α} (h : (f a).isSome = true) :
(f.symm ((f a).get h)).isSome = true
def PEquiv.single {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (a : α) (b : β) :
α ≃. β

Create a PEquiv which sends a to b and b to a, but is otherwise none.

Equations
theorem PEquiv.mem_single {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (a : α) (b : β) :
b (single a b) a
theorem PEquiv.mem_single_iff {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (a₁ a₂ : α) (b₁ b₂ : β) :
b₁ (single a₂ b₂) a₁ a₁ = a₂ b₁ = b₂
@[simp]
theorem PEquiv.symm_single {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (a : α) (b : β) :
(single a b).symm = single b a
@[simp]
theorem PEquiv.single_apply {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] (a : α) (b : β) :
(single a b) a = some b
theorem PEquiv.single_apply_of_ne {α : Type u} {β : Type v} [DecidableEq α] [DecidableEq β] {a₁ a₂ : α} (h : a₁ a₂) (b : β) :
(single a₁ b) a₂ = none
theorem PEquiv.single_trans_of_mem {α : Type u} {β : Type v} {γ : Type w} [DecidableEq α] [DecidableEq β] [DecidableEq γ] (a : α) {b : β} {c : γ} {f : β ≃. γ} (h : c f b) :
(single a b).trans f = single a c
theorem PEquiv.trans_single_of_mem {α : Type u} {β : Type v} {γ : Type w} [DecidableEq α] [DecidableEq β] [DecidableEq γ] {a : α} {b : β} (c : γ) {f : α ≃. β} (h : b f a) :
f.trans (single b c) = single a c
@[simp]
theorem PEquiv.single_trans_single {α : Type u} {β : Type v} {γ : Type w} [DecidableEq α] [DecidableEq β] [DecidableEq γ] (a : α) (b : β) (c : γ) :
(single a b).trans (single b c) = single a c
@[simp]
theorem PEquiv.trans_single_of_eq_none {β : Type v} {γ : Type w} {δ : Type x} [DecidableEq β] [DecidableEq γ] {b : β} (c : γ) {f : δ ≃. β} (h : f.symm b = none) :
f.trans (single b c) =
theorem PEquiv.single_trans_of_eq_none {α : Type u} {β : Type v} {δ : Type x} [DecidableEq α] [DecidableEq β] (a : α) {b : β} {f : β ≃. δ} (h : f b = none) :
(single a b).trans f =
theorem PEquiv.single_trans_single_of_ne {α : Type u} {β : Type v} {γ : Type w} [DecidableEq α] [DecidableEq β] [DecidableEq γ] {b₁ b₂ : β} (h : b₁ b₂) (a : α) (c : γ) :
(single a b₁).trans (single b₂ c) =
theorem PEquiv.le_def {α : Type u} {β : Type v} {f g : α ≃. β} :
f g ∀ (a : α), bf a, b g a
instance PEquiv.instOrderBot {α : Type u} {β : Type v} :
OrderBot (α ≃. β)
Equations
Equations
  • One or more equations did not get rendered due to their size.
def Equiv.toPEquiv {α : Type u_1} {β : Type u_2} (f : α β) :
α ≃. β

Turns an Equiv into a PEquiv of the whole type.

Equations
@[simp]
theorem Equiv.toPEquiv_trans {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : α β) (g : β γ) :
theorem Equiv.toPEquiv_symm {α : Type u_1} {β : Type u_2} (f : α β) :
@[simp]
theorem Equiv.toPEquiv_apply {α : Type u_1} {β : Type u_2} (f : α β) (x : α) :
f.toPEquiv x = some (f x)