Lean4
/-- An embedding `e : α ↪ β` defines an embedding `(α → γ) ↪ (β → γ)` for any inhabited type `γ`.
This embedding sends each `f : α → γ` to a function `g : β → γ` such that `g ∘ e = f` and
`g y = default` whenever `y ∉ range e`. -/
noncomputable def arrowCongrLeft {α : Sort u} {β : Sort v} {γ : Sort w} [Inhabited γ] (e : α ↪ β) : (α → γ) ↪ β → γ :=
⟨fun f => extend e f default, fun f₁ f₂ h =>
funext fun x => by simpa only [e.injective.extend_apply] using congr_fun h (e x)⟩
-- `simps` would generate this over-applied