Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c0c673a

Browse files
committed
feat(data/equiv,logic/embedding): add can_lift instances (#12049)
1 parent c686fcc commit c0c673a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/data/equiv/basic.lean

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,20 +1521,25 @@ end subtype_equiv_codomain
15211521

15221522
/-- If `f` is a bijective function, then its domain is equivalent to its codomain. -/
15231523
@[simps apply]
1524-
noncomputable def of_bijective {α β} (f : α → β) (hf : bijective f) : α ≃ β :=
1524+
noncomputable def of_bijective (f : α → β) (hf : bijective f) : α ≃ β :=
15251525
{ to_fun := f,
15261526
inv_fun := function.surj_inv hf.surjective,
15271527
left_inv := function.left_inverse_surj_inv hf,
15281528
right_inv := function.right_inverse_surj_inv _}
15291529

1530-
lemma of_bijective_apply_symm_apply {α β} (f : α → β) (hf : bijective f) (x : β) :
1530+
lemma of_bijective_apply_symm_apply (f : α → β) (hf : bijective f) (x : β) :
15311531
f ((of_bijective f hf).symm x) = x :=
15321532
(of_bijective f hf).apply_symm_apply x
15331533

1534-
@[simp] lemma of_bijective_symm_apply_apply {α β} (f : α → β) (hf : bijective f) (x : α) :
1534+
@[simp] lemma of_bijective_symm_apply_apply (f : α → β) (hf : bijective f) (x : α) :
15351535
(of_bijective f hf).symm (f x) = x :=
15361536
(of_bijective f hf).symm_apply_apply x
15371537

1538+
instance : can_lift (α → β) (α ≃ β) :=
1539+
{ coe := coe_fn,
1540+
cond := bijective,
1541+
prf := λ f hf, ⟨of_bijective f hf, rfl⟩ }
1542+
15381543
section
15391544

15401545
variables {α' β' : Type*} (e : perm α') {p : β' → Prop} [decidable_pred p]

src/logic/embedding.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ instance {α : Sort u} {β : Sort v} : embedding_like (α ↪ β) α β :=
3434
injective' := embedding.inj',
3535
coe_injective' := λ f g h, by { cases f, cases g, congr' } }
3636

37+
instance {α β : Sort*} : can_lift (α → β) (α ↪ β) :=
38+
{ coe := coe_fn,
39+
cond := injective,
40+
prf := λ f hf, ⟨⟨f, hf⟩, rfl⟩ }
41+
3742
end function
3843

3944
section equiv

0 commit comments

Comments
 (0)