Skip to content

Commit e8ebb32

Browse files
committed
feat(Subtype): SurjOn versions of coind_surjective and coind_bijective (#31349)
Conditions of theorems `Subtype.coind_surjective` and `Subtype.coind_bijective` imply that the subtype coincides with the whole type, which makes these theorems not very useful. This PR deprecates them and proves `Set.SurjOn` versions.
1 parent 7b70992 commit e8ebb32

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

Mathlib/Data/Set/Function.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,17 @@ theorem SurjOn.forall {p : β → Prop} (hf : s.SurjOn f t) (hf' : s.MapsTo f t)
576576
(∀ y ∈ t, p y) ↔ (∀ x ∈ s, p (f x)) :=
577577
fun H x hx ↦ H (f x) (hf' hx), fun H _y hy ↦ let ⟨x, hx, hxy⟩ := hf hy; hxy ▸ H x hx⟩
578578

579+
theorem _root_.Subtype.coind_surjective {α β} {f : α → β} {p : Set β} (h : ∀ a, f a ∈ p)
580+
(hf : Set.SurjOn f Set.univ p) :
581+
(Subtype.coind f h).Surjective := fun ⟨_, hb⟩ ↦
582+
let ⟨a, _, ha⟩ := hf hb
583+
⟨a, Subtype.coe_injective ha⟩
584+
585+
theorem _root_.Subtype.coind_bijective {α β} {f : α → β} {p : Set β} (h : ∀ a, f a ∈ p)
586+
(hf_inj : f.Injective) (hf_surj : Set.SurjOn f Set.univ p) :
587+
(Subtype.coind f h).Bijective :=
588+
⟨Subtype.coind_injective h hf_inj, Subtype.coind_surjective h hf_surj⟩
589+
579590
end surjOn
580591

581592
/-! ### Bijectivity -/

Mathlib/Data/Subtype.lean

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α
142142
theorem coind_injective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Injective f) :
143143
Injective (coind f h) := fun x y hxy ↦ hf <| by apply congr_arg Subtype.val hxy
144144

145-
theorem coind_surjective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Surjective f) :
146-
Surjective (coind f h) := fun x ↦
147-
let ⟨a, ha⟩ := hf x
148-
⟨a, coe_injective ha⟩
149-
150-
theorem coind_bijective {α β} {f : α → β} {p : β → Prop} (h : ∀ a, p (f a)) (hf : Bijective f) :
151-
Bijective (coind f h) :=
152-
⟨coind_injective h hf.1, coind_surjective h hf.2
153-
154145
/-- Restriction of a function to a function on subtypes. -/
155146
@[simps]
156147
def map {p : α → Prop} {q : β → Prop} (f : α → β) (h : ∀ a, p a → q (f a)) :

0 commit comments

Comments
 (0)