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

Commit d0e454a

Browse files
committed
feat(logic/function/basic): add function.{in,sur,bi}jective.comp_left (#10406)
As far as I can tell we don't have these variations. Note that the `surjective` and `bijective` versions do not appear next to the other composition statements, as they require `surj_inv` to concisely prove.
1 parent d9e40b4 commit d0e454a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/logic/function/basic.lean

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ lemma injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : bijective g)
9292
hx ▸ hy ▸ λ hf, h hf ▸ rfl,
9393
λ h, h.comp hg.injective⟩
9494

95+
/-- Composition by an injective function on the left is itself injective. -/
96+
lemma injective.comp_left {g : β → γ} (hg : function.injective g) :
97+
function.injective ((∘) g : (α → β) → (α → γ)) :=
98+
λ f₁ f₂ hgf, funext $ λ i, hg $ (congr_fun hgf i : _)
99+
95100
lemma injective_of_subsingleton [subsingleton α] (f : α → β) :
96101
injective f :=
97102
λ a b ab, subsingleton.elim _ _
@@ -345,7 +350,7 @@ lemma injective_iff_has_left_inverse : injective f ↔ has_left_inverse f :=
345350
end inv_fun
346351

347352
section surj_inv
348-
variables {α : Sort u} {β : Sort v} {f : α → β}
353+
variables {α : Sort u} {β : Sort v} {γ : Sort w} {f : α → β}
349354

350355
/-- The inverse of a surjective function. (Unlike `inv_fun`, this does not require
351356
`α` to be inhabited.) -/
@@ -376,6 +381,16 @@ lemma surjective_to_subsingleton [na : nonempty α] [subsingleton β] (f : α
376381
surjective f :=
377382
λ y, let ⟨a⟩ := na in ⟨a, subsingleton.elim _ _⟩
378383

384+
/-- Composition by an surjective function on the left is itself surjective. -/
385+
lemma surjective.comp_left {g : β → γ} (hg : function.surjective g) :
386+
function.surjective ((∘) g : (α → β) → (α → γ)) :=
387+
λ f, ⟨surj_inv hg ∘ f, funext $ λ x, right_inverse_surj_inv _ _⟩
388+
389+
/-- Composition by an bijective function on the left is itself bijective. -/
390+
lemma bijective.comp_left {g : β → γ} (hg : function.bijective g) :
391+
function.bijective ((∘) g : (α → β) → (α → γ)) :=
392+
⟨hg.injective.comp_left, hg.surjective.comp_left⟩
393+
379394
end surj_inv
380395

381396
section update

0 commit comments

Comments
 (0)