Skip to content

Commit

Permalink
feat(logic/embedding): add function.embedding.coe_injective (#7383)
Browse files Browse the repository at this point in the history
Prior art for this lemma name: `linear_map.coe_injective`
  • Loading branch information
eric-wieser committed Apr 28, 2021
1 parent c562caf commit d40a60c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/logic/embedding.lean
Expand Up @@ -48,8 +48,11 @@ set.ext $ λ x, ⟨λ ⟨y, h⟩, h ▸ subtype.coe_prop (e y), λ hs, ⟨e.symm
namespace function
namespace embedding

lemma coe_injective {α β} : @function.injective (α ↪ β) (α → β) coe_fn
| ⟨x, _⟩ ⟨y, _⟩ rfl := rfl

@[ext] lemma ext {α β} {f g : embedding α β} (h : ∀ x, f x = g x) : f = g :=
by cases f; cases g; simpa using funext h
coe_injective (funext h)

lemma ext_iff {α β} {f g : embedding α β} : (∀ x, f x = g x) ↔ f = g :=
⟨ext, λ h _, by rw h⟩
Expand Down

0 comments on commit d40a60c

Please sign in to comment.