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

Commit 3a88a9e

Browse files
committed
chore(data/subtype): Add coind_bijective and map_involutive (#5319)
1 parent 029b258 commit 3a88a9e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/data/subtype.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀a, p (
9090
(hf : injective f) : injective (coind f h) :=
9191
λ x y hxy, hf $ by apply congr_arg subtype.val hxy
9292

93+
theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀a, p (f a))
94+
(hf : surjective f) : surjective (coind f h) :=
95+
λ x, let ⟨a, ha⟩ := hf x in ⟨a, coe_injective ha⟩
96+
97+
theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀a, p (f a))
98+
(hf : bijective f) : bijective (coind f h) :=
99+
⟨coind_injective h hf.1, coind_surjective h hf.2
100+
93101
/-- Restriction of a function to a function on subtypes. -/
94102
@[simps] def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀a, p a → q (f a)) :
95103
subtype p → subtype q :=
@@ -107,6 +115,10 @@ lemma map_injective {p : α → Prop} {q : β → Prop} {f : α → β} (h : ∀
107115
(hf : injective f) : injective (map f h) :=
108116
coind_injective _ $ hf.comp coe_injective
109117

118+
lemma map_involutive {p : α → Prop} {f : α → α} (h : ∀a, p a → p (f a))
119+
(hf : involutive f) : involutive (map f h) :=
120+
λ x, subtype.ext (hf x)
121+
110122
instance [has_equiv α] (p : α → Prop) : has_equiv (subtype p) :=
111123
⟨λ s t, (s : α) ≈ (t : α)⟩
112124

0 commit comments

Comments
 (0)