Skip to content

Commit 508efdc

Browse files
committed
feat: two missing injOn lemmas (#8303)
1 parent 28a049b commit 508efdc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Mathlib/Data/Set/Function.lean

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,7 @@ theorem SurjOn.bijOn_subset [Nonempty α] (h : SurjOn f s t) : BijOn f (invFunOn
13331333
rwa [h.rightInvOn_invFunOn hy]
13341334
#align set.surj_on.bij_on_subset Set.SurjOn.bijOn_subset
13351335

1336-
theorem surjOn_iff_exists_bijOn_subset : SurjOn f s t ↔ ∃ (s' : _) (_ : s' ⊆ s), BijOn f s' t := by
1336+
theorem surjOn_iff_exists_bijOn_subset : SurjOn f s t ↔ ∃ s' ⊆ s, BijOn f s' t := by
13371337
constructor
13381338
· rcases eq_empty_or_nonempty t with (rfl | ht)
13391339
· exact fun _ => ⟨∅, empty_subset _, bijOn_empty f⟩
@@ -1344,6 +1344,23 @@ theorem surjOn_iff_exists_bijOn_subset : SurjOn f s t ↔ ∃ (s' : _) (_ : s'
13441344
exact hfs'.surjOn.mono hs' (Subset.refl _)
13451345
#align set.surj_on_iff_exists_bij_on_subset Set.surjOn_iff_exists_bijOn_subset
13461346

1347+
alias ⟨SurjOn.exists_bijOn_subset, _⟩ := Set.surjOn_iff_exists_bijOn_subset
1348+
1349+
variable (f s)
1350+
1351+
lemma exists_subset_bijOn : ∃ s' ⊆ s, BijOn f s' (f '' s) :=
1352+
surjOn_iff_exists_bijOn_subset.mp (surjOn_image f s)
1353+
1354+
lemma exists_image_eq_and_injOn : ∃ u, f '' u = f '' s ∧ InjOn f u :=
1355+
let ⟨u, _, hfu⟩ := exists_subset_bijOn s f
1356+
⟨u, hfu.image_eq, hfu.injOn⟩
1357+
1358+
variable {f s}
1359+
1360+
lemma exists_image_eq_injOn_of_subset_range (ht : t ⊆ range f) :
1361+
∃ s, f '' s = t ∧ InjOn f s :=
1362+
image_preimage_eq_of_subset ht ▸ exists_image_eq_and_injOn _ _
1363+
13471364
theorem preimage_invFun_of_mem [n : Nonempty α] {f : α → β} (hf : Injective f) {s : Set α}
13481365
(h : Classical.choice n ∈ s) : invFun f ⁻¹' s = f '' s ∪ (range f)ᶜ := by
13491366
ext x

0 commit comments

Comments
 (0)