logic.function.basicMathlib.Logic.Function.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

chore(*): Miscellaneous lemmas (#18677)
  • algebra.support: support n = univ if n ≠ 0, mul_support n = univ if n ≠ 1
  • data.int.char_zero: ↑n = 1 ↔ n = 1
  • data.real.ennreal: of_real a.to_real = a ↔ a ≠ ⊤, (of_real a).to_real = a ↔ 0 ≤ a
  • data.set.basic: s ∩ {a | p a} = {a ∈ s | p a}
  • logic.function.basic: on_fun f g a b = f (g a) (g b)
  • order.conditionally_complete_lattice.basic: Lemmas unfolding the definition of Sup/Inf on with_top/with_bot
Diff
@@ -46,6 +46,9 @@ lemma const_injective [nonempty α] : injective (const α : β → α → β) :=
 
 lemma id_def : @id α = λ x, x := rfl
 
+@[simp] lemma on_fun_apply (f : β → β → γ) (g : α → β) (a b : α) : on_fun f g a b = f (g a) (g b) :=
+rfl
+
 lemma hfunext {α α': Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : Πa, β a} {f' : Πa, β' a}
   (hα : α = α') (h : ∀a a', a == a' → f a == f' a') : f == f' :=
 begin

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -786,7 +786,7 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 #align function.update_noteq Function.update_noteq
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) := by
@@ -794,7 +794,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
@@ -802,7 +802,7 @@ theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.update_eq_iff /-
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
@@ -810,7 +810,7 @@ theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.update_eq_iff Function.update_eq_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:642:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.eq_update_iff /-
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
Diff
@@ -226,12 +226,12 @@ theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
     Function.Injective fun x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩ := fun x₁ x₂ h =>
   by
-  dsimp only at h 
+  dsimp only at h
   by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
-  · rw [dif_pos h₁, dif_pos h₂] at h ; injection hf h
-  · rw [dif_pos h₁, dif_neg h₂] at h ; exact (im_disj h).elim
-  · rw [dif_neg h₁, dif_pos h₂] at h ; exact (im_disj h.symm).elim
-  · rw [dif_neg h₁, dif_neg h₂] at h ; injection hf' h
+  · rw [dif_pos h₁, dif_pos h₂] at h; injection hf h
+  · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
+  · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
+  · rw [dif_neg h₁, dif_neg h₂] at h; injection hf' h
 #align function.injective.dite Function.Injective.dite
 -/
 
@@ -413,8 +413,7 @@ theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjecti
   let g : Set T → T := fun s => ⟨U, cast hU.symm s⟩
   have hg : injective g := by
     intro s t h
-    suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this ;
-      assumption
+    suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this; assumption
     · congr; assumption
   exact cantor_injective g hg
 #align function.not_surjective_Type Function.not_surjective_Type
@@ -562,10 +561,10 @@ theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPa
   | a, b =>
     ⟨fun h =>
       if h' : ∃ a, f a = b then by
-        rw [partial_inv, dif_pos h'] at h 
+        rw [partial_inv, dif_pos h'] at h
         injection h with h; subst h
         apply Classical.choose_spec h'
-      else by rw [partial_inv, dif_neg h'] at h  <;> contradiction,
+      else by rw [partial_inv, dif_neg h'] at h <;> contradiction,
       fun e =>
       e ▸
         have h : ∃ a', f a' = f a := ⟨_, rfl⟩
@@ -776,7 +775,7 @@ theorem surjective_eval {α : Sort u} {β : α → Sort v} [h : ∀ a, Nonempty
 theorem update_injective (f : ∀ a, β a) (a' : α) : Injective (update f a') := fun v v' h =>
   by
   have := congr_fun h a'
-  rwa [update_same, update_same] at this 
+  rwa [update_same, update_same] at this
 #align function.update_injective Function.update_injective
 -/
 
@@ -1030,7 +1029,7 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g =
   intro g₁ g₂ hg
   refine' funext fun x => _
   have H := congr_fun hg (f x)
-  simp only [hf.extend_apply] at H 
+  simp only [hf.extend_apply] at H
   exact H
 #align function.extend_injective Function.extend_injective
 -/
Diff
@@ -70,6 +70,8 @@ theorem const_comp {f : α → β} {c : γ} : const β c ∘ f = const α c :=
 #align function.const_comp Function.const_comp
 -/
 
+/- warning: function.comp_const clashes with function.comp_const_right -> Function.comp_const
+Case conversion may be inaccurate. Consider using '#align function.comp_const Function.comp_constₓ'. -/
 #print Function.comp_const /-
 @[simp]
 theorem comp_const {f : β → γ} {b : β} : f ∘ const α b = const α (f b) :=
Diff
@@ -257,12 +257,10 @@ theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
 #align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
 -/
 
-#print Function.decidableEqPfun /-
 instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, DecidableEq (α hp)] :
     DecidableEq (∀ hp, α hp)
   | f, g => decidable_of_iff (∀ hp, f hp = g hp) funext_iff.symm
 #align function.decidable_eq_pfun Function.decidableEqPfun
--/
 
 #print Function.Surjective.forall /-
 protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
Diff
@@ -1002,9 +1002,9 @@ theorem factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f 
 #align function.factors_through_iff Function.factorsThrough_iff
 -/
 
-#print Function.FactorsThrough.apply_extend /-
-theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f) (F : γ → δ)
-    (e' : β → γ) (b : β) : F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
+#print Function.apply_extend /-
+theorem Function.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f) (F : γ → δ) (e' : β → γ)
+    (b : β) : F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   by
   by_cases hb : ∃ a, f a = b
   · cases' hb with a ha; subst b
@@ -1012,14 +1012,16 @@ theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g
     · intro a b h; simp only [comp_apply]; apply congr_arg; exact hf h
     · exact hf
   · rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb]
-#align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
+#align function.factors_through.apply_extend Function.apply_extend
 -/
 
-#print Function.Injective.apply_extend /-
-theorem Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
+/- warning: function.injective.apply_extend clashes with function.factors_through.apply_extend -> Function.apply_extend
+Case conversion may be inaccurate. Consider using '#align function.injective.apply_extend Function.apply_extendₓ'. -/
+#print Function.apply_extend /-
+theorem Function.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
     F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   (hf.FactorsThrough g).apply_extend F e' b
-#align function.injective.apply_extend Function.Injective.apply_extend
+#align function.injective.apply_extend Function.apply_extend
 -/
 
 #print Function.extend_injective /-
Diff
@@ -126,7 +126,7 @@ theorem funext_iff {β : α → Sort _} {f₁ f₂ : ∀ x : α, β x} : f₁ =
 
 #print Function.ne_iff /-
 theorem ne_iff {β : α → Sort _} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔ ∃ a, f₁ a ≠ f₂ a :=
-  funext_iff.Not.trans not_forall
+  funext_iff.Not.trans Classical.not_forall
 #align function.ne_iff Function.ne_iff
 -/
 
Diff
@@ -956,10 +956,10 @@ def FactorsThrough (g : α → γ) (f : α → β) : Prop :=
 #align function.factors_through Function.FactorsThrough
 -/
 
-#print Function.Injective.FactorsThrough /-
-theorem Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f := fun a b h =>
+#print Function.Injective.factorsThrough /-
+theorem Injective.factorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f := fun a b h =>
   congr_arg g (hf h)
-#align function.injective.factors_through Function.Injective.FactorsThrough
+#align function.injective.factors_through Function.Injective.factorsThrough
 -/
 
 #print Function.extend_def /-
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2016 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
 -/
-import Mathbin.Data.Option.Defs
-import Mathbin.Logic.Nonempty
-import Mathbin.Tactic.Cache
+import Data.Option.Defs
+import Logic.Nonempty
+import Tactic.Cache
 
 #align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
 
@@ -787,7 +787,7 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 #align function.update_noteq Function.update_noteq
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) := by
@@ -795,7 +795,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
@@ -803,7 +803,7 @@ theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.update_eq_iff /-
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
@@ -811,7 +811,7 @@ theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.update_eq_iff Function.update_eq_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:641:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.eq_update_iff /-
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2016 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
-
-! This file was ported from Lean 3 source module logic.function.basic
-! leanprover-community/mathlib commit 29cb56a7b35f72758b05a30490e1f10bd62c35c1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Option.Defs
 import Mathbin.Logic.Nonempty
 import Mathbin.Tactic.Cache
 
+#align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
+
 /-!
 # Miscellaneous function constructions and lemmas
 
@@ -790,7 +787,7 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 #align function.update_noteq Function.update_noteq
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) := by
@@ -798,7 +795,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
@@ -806,7 +803,7 @@ theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.update_eq_iff /-
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
@@ -814,7 +811,7 @@ theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.update_eq_iff Function.update_eq_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.eq_update_iff /-
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
Diff
@@ -46,39 +46,53 @@ theorem eval_apply {β : α → Sort _} (x : α) (f : ∀ x, β x) : eval x f =
 
 /- warning: function.comp_apply clashes with function.comp_app -> Function.comp_apply
 Case conversion may be inaccurate. Consider using '#align function.comp_apply Function.comp_applyₓ'. -/
+#print Function.comp_apply /-
 theorem comp_apply {α : Sort u} {β : Sort v} {φ : Sort w} (f : β → φ) (g : α → β) (a : α) :
     (f ∘ g) a = f (g a) :=
   rfl
 #align function.comp_apply Function.comp_apply
+-/
 
+#print Function.const_def /-
 theorem const_def {y : β} : (fun x : α => y) = const α y :=
   rfl
 #align function.const_def Function.const_def
+-/
 
+#print Function.const_apply /-
 @[simp]
 theorem const_apply {y : β} {x : α} : const α y x = y :=
   rfl
 #align function.const_apply Function.const_apply
+-/
 
+#print Function.const_comp /-
 @[simp]
 theorem const_comp {f : α → β} {c : γ} : const β c ∘ f = const α c :=
   rfl
 #align function.const_comp Function.const_comp
+-/
 
+#print Function.comp_const /-
 @[simp]
 theorem comp_const {f : β → γ} {b : β} : f ∘ const α b = const α (f b) :=
   rfl
 #align function.comp_const Function.comp_const
+-/
 
+#print Function.const_injective /-
 theorem const_injective [Nonempty α] : Injective (const α : β → α → β) := fun y₁ y₂ h =>
   let ⟨x⟩ := ‹Nonempty α›
   congr_fun h x
 #align function.const_injective Function.const_injective
+-/
 
+#print Function.const_inj /-
 @[simp]
 theorem const_inj [Nonempty α] {y₁ y₂ : β} : const α y₁ = const α y₂ ↔ y₁ = y₂ :=
   ⟨fun h => const_injective h, fun h => h ▸ rfl⟩
 #align function.const_inj Function.const_inj
+-/
 
 #print Function.id_def /-
 theorem id_def : @id α = fun x => x :=
@@ -86,10 +100,12 @@ theorem id_def : @id α = fun x => x :=
 #align function.id_def Function.id_def
 -/
 
+#print Function.onFun_apply /-
 @[simp]
 theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
   rfl
 #align function.on_fun_apply Function.onFun_apply
+-/
 
 #print Function.hfunext /-
 theorem hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀ a, β a} {f' : ∀ a, β' a}
@@ -117,33 +133,47 @@ theorem ne_iff {β : α → Sort _} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ 
 #align function.ne_iff Function.ne_iff
 -/
 
+#print Function.Bijective.injective /-
 protected theorem Bijective.injective {f : α → β} (hf : Bijective f) : Injective f :=
   hf.1
 #align function.bijective.injective Function.Bijective.injective
+-/
 
+#print Function.Bijective.surjective /-
 protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surjective f :=
   hf.2
 #align function.bijective.surjective Function.Bijective.surjective
+-/
 
+#print Function.Injective.eq_iff /-
 theorem Injective.eq_iff (I : Injective f) {a b : α} : f a = f b ↔ a = b :=
   ⟨@I _ _, congr_arg f⟩
 #align function.injective.eq_iff Function.Injective.eq_iff
+-/
 
+#print Function.Injective.eq_iff' /-
 theorem Injective.eq_iff' (I : Injective f) {a b : α} {c : β} (h : f b = c) : f a = c ↔ a = b :=
   h ▸ I.eq_iff
 #align function.injective.eq_iff' Function.Injective.eq_iff'
+-/
 
+#print Function.Injective.ne /-
 theorem Injective.ne (hf : Injective f) {a₁ a₂ : α} : a₁ ≠ a₂ → f a₁ ≠ f a₂ :=
   mt fun h => hf h
 #align function.injective.ne Function.Injective.ne
+-/
 
+#print Function.Injective.ne_iff /-
 theorem Injective.ne_iff (hf : Injective f) {x y : α} : f x ≠ f y ↔ x ≠ y :=
   ⟨mt <| congr_arg f, hf.Ne⟩
 #align function.injective.ne_iff Function.Injective.ne_iff
+-/
 
+#print Function.Injective.ne_iff' /-
 theorem Injective.ne_iff' (hf : Injective f) {x y : α} {z : β} (h : f y = z) : f x ≠ z ↔ x ≠ y :=
   h ▸ hf.ne_iff
 #align function.injective.ne_iff' Function.Injective.ne_iff'
+-/
 
 #print Function.Injective.decidableEq /-
 /-- If the co-domain `β` of an injective function `f : α → β` has decidable equality, then
@@ -159,11 +189,14 @@ theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective
 #align function.injective.of_comp Function.Injective.of_comp
 -/
 
+#print Function.Injective.of_comp_iff /-
 theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α) :
     Injective (f ∘ g) ↔ Injective g :=
   ⟨Injective.of_comp, hf.comp⟩
 #align function.injective.of_comp_iff Function.Injective.of_comp_iff
+-/
 
+#print Function.Injective.of_comp_iff' /-
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
   ⟨fun h x y =>
@@ -172,17 +205,23 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
     hx ▸ hy ▸ fun hf => h hf ▸ rfl,
     fun h => h.comp hg.Injective⟩
 #align function.injective.of_comp_iff' Function.Injective.of_comp_iff'
+-/
 
+#print Function.Injective.comp_left /-
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
     Function.Injective ((· ∘ ·) g : (α → β) → α → γ) := fun f₁ f₂ hgf =>
   funext fun i => hg <| (congr_fun hgf i : _)
 #align function.injective.comp_left Function.Injective.comp_left
+-/
 
+#print Function.injective_of_subsingleton /-
 theorem injective_of_subsingleton [Subsingleton α] (f : α → β) : Injective f := fun a b ab =>
   Subsingleton.elim _ _
 #align function.injective_of_subsingleton Function.injective_of_subsingleton
+-/
 
+#print Function.Injective.dite /-
 theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a } → β}
     {f' : { a : α // ¬p a } → β} (hf : Injective f) (hf' : Injective f')
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
@@ -195,6 +234,7 @@ theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a
   · rw [dif_neg h₁, dif_pos h₂] at h ; exact (im_disj h.symm).elim
   · rw [dif_neg h₁, dif_neg h₂] at h ; injection hf' h
 #align function.injective.dite Function.Injective.dite
+-/
 
 #print Function.Surjective.of_comp /-
 theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjective f := fun y =>
@@ -203,11 +243,14 @@ theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjecti
 #align function.surjective.of_comp Function.Surjective.of_comp
 -/
 
+#print Function.Surjective.of_comp_iff /-
 theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective g) :
     Surjective (f ∘ g) ↔ Surjective f :=
   ⟨Surjective.of_comp, fun h => h.comp hg⟩
 #align function.surjective.of_comp_iff Function.Surjective.of_comp_iff
+-/
 
+#print Function.Surjective.of_comp_iff' /-
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
   ⟨fun h x =>
@@ -215,6 +258,7 @@ theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     ⟨x', hf.Injective hx'⟩,
     hf.Surjective.comp⟩
 #align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
+-/
 
 #print Function.decidableEqPfun /-
 instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, DecidableEq (α hp)] :
@@ -223,23 +267,30 @@ instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, D
 #align function.decidable_eq_pfun Function.decidableEqPfun
 -/
 
+#print Function.Surjective.forall /-
 protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
     (∀ y, p y) ↔ ∀ x, p (f x) :=
   ⟨fun h x => h (f x), fun h y =>
     let ⟨x, hx⟩ := hf y
     hx ▸ h x⟩
 #align function.surjective.forall Function.Surjective.forall
+-/
 
+#print Function.Surjective.forall₂ /-
 protected theorem Surjective.forall₂ (hf : Surjective f) {p : β → β → Prop} :
     (∀ y₁ y₂, p y₁ y₂) ↔ ∀ x₁ x₂, p (f x₁) (f x₂) :=
   hf.forall.trans <| forall_congr' fun x => hf.forall
 #align function.surjective.forall₂ Function.Surjective.forall₂
+-/
 
+#print Function.Surjective.forall₃ /-
 protected theorem Surjective.forall₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∀ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∀ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.forall.trans <| forall_congr' fun x => hf.forall₂
 #align function.surjective.forall₃ Function.Surjective.forall₃
+-/
 
+#print Function.Surjective.exists /-
 protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     (∃ y, p y) ↔ ∃ x, p (f x) :=
   ⟨fun ⟨y, hy⟩ =>
@@ -247,26 +298,36 @@ protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     ⟨x, hx.symm ▸ hy⟩,
     fun ⟨x, hx⟩ => ⟨f x, hx⟩⟩
 #align function.surjective.exists Function.Surjective.exists
+-/
 
+#print Function.Surjective.exists₂ /-
 protected theorem Surjective.exists₂ (hf : Surjective f) {p : β → β → Prop} :
     (∃ y₁ y₂, p y₁ y₂) ↔ ∃ x₁ x₂, p (f x₁) (f x₂) :=
   hf.exists.trans <| exists_congr fun x => hf.exists
 #align function.surjective.exists₂ Function.Surjective.exists₂
+-/
 
+#print Function.Surjective.exists₃ /-
 protected theorem Surjective.exists₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∃ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∃ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.exists.trans <| exists_congr fun x => hf.exists₂
 #align function.surjective.exists₃ Function.Surjective.exists₃
+-/
 
+#print Function.Surjective.injective_comp_right /-
 theorem Surjective.injective_comp_right (hf : Surjective f) : Injective fun g : β → γ => g ∘ f :=
   fun g₁ g₂ h => funext <| hf.forall.2 <| congr_fun h
 #align function.surjective.injective_comp_right Function.Surjective.injective_comp_right
+-/
 
+#print Function.Surjective.right_cancellable /-
 protected theorem Surjective.right_cancellable (hf : Surjective f) {g₁ g₂ : β → γ} :
     g₁ ∘ f = g₂ ∘ f ↔ g₁ = g₂ :=
   hf.injective_comp_right.eq_iff
 #align function.surjective.right_cancellable Function.Surjective.right_cancellable
+-/
 
+#print Function.surjective_of_right_cancellable_Prop /-
 theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g₁ ∘ f = g₂ ∘ f → g₁ = g₂) :
     Surjective f :=
   by
@@ -276,7 +337,9 @@ theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g
     have : True = ∃ x, f x = y := congr_fun h y
     rw [← this]; exact trivial
 #align function.surjective_of_right_cancellable_Prop Function.surjective_of_right_cancellable_Prop
+-/
 
+#print Function.bijective_iff_existsUnique /-
 theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β, ∃! a : α, f a = b :=
   ⟨fun hf b =>
     let ⟨a, ha⟩ := hf.Surjective b
@@ -284,13 +347,17 @@ theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β,
     fun he =>
     ⟨fun a a' h => ExistsUnique.unique (he (f a')) h rfl, fun b => ExistsUnique.exists (he b)⟩⟩
 #align function.bijective_iff_exists_unique Function.bijective_iff_existsUnique
+-/
 
+#print Function.Bijective.existsUnique /-
 /-- Shorthand for using projection notation with `function.bijective_iff_exists_unique`. -/
 protected theorem Bijective.existsUnique {f : α → β} (hf : Bijective f) (b : β) :
     ∃! a : α, f a = b :=
   (bijective_iff_existsUnique f).mp hf b
 #align function.bijective.exists_unique Function.Bijective.existsUnique
+-/
 
+#print Function.Bijective.existsUnique_iff /-
 theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β → Prop} :
     (∃! y, p y) ↔ ∃! x, p (f x) :=
   ⟨fun ⟨y, hpy, hy⟩ =>
@@ -301,16 +368,21 @@ theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β 
       let ⟨z, hz⟩ := hf.Surjective y
       hz ▸ congr_arg f <| hx _ <| by rwa [hz]⟩⟩
 #align function.bijective.exists_unique_iff Function.Bijective.existsUnique_iff
+-/
 
+#print Function.Bijective.of_comp_iff /-
 theorem Bijective.of_comp_iff (f : α → β) {g : γ → α} (hg : Bijective g) :
     Bijective (f ∘ g) ↔ Bijective f :=
   and_congr (Injective.of_comp_iff' _ hg) (Surjective.of_comp_iff _ hg.Surjective)
 #align function.bijective.of_comp_iff Function.Bijective.of_comp_iff
+-/
 
+#print Function.Bijective.of_comp_iff' /-
 theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α) :
     Function.Bijective (f ∘ g) ↔ Function.Bijective g :=
   and_congr (Injective.of_comp_iff hf.Injective _) (Surjective.of_comp_iff' hf _)
 #align function.bijective.of_comp_iff' Function.Bijective.of_comp_iff'
+-/
 
 #print Function.cantor_surjective /-
 /-- **Cantor's diagonal argument** implies that there are no surjective functions from `α`
@@ -360,18 +432,24 @@ def IsPartialInv {α β} (f : α → β) (g : β → Option α) : Prop :=
 #align function.is_partial_inv Function.IsPartialInv
 -/
 
+#print Function.isPartialInv_left /-
 theorem isPartialInv_left {α β} {f : α → β} {g} (H : IsPartialInv f g) (x) : g (f x) = some x :=
   (H _ _).2 rfl
 #align function.is_partial_inv_left Function.isPartialInv_left
+-/
 
+#print Function.injective_of_isPartialInv /-
 theorem injective_of_isPartialInv {α β} {f : α → β} {g} (H : IsPartialInv f g) : Injective f :=
   fun a b h => Option.some.inj <| ((H _ _).2 h).symm.trans ((H _ _).2 rfl)
 #align function.injective_of_partial_inv Function.injective_of_isPartialInv
+-/
 
+#print Function.injective_of_isPartialInv_right /-
 theorem injective_of_isPartialInv_right {α β} {f : α → β} {g} (H : IsPartialInv f g) (x y b)
     (h₁ : b ∈ g x) (h₂ : b ∈ g y) : x = y :=
   ((H _ _).1 h₁).symm.trans ((H _ _).1 h₂)
 #align function.injective_of_partial_inv_right Function.injective_of_isPartialInv_right
+-/
 
 #print Function.LeftInverse.comp_eq_id /-
 theorem LeftInverse.comp_eq_id {f : α → β} {g : β → α} (h : LeftInverse f g) : f ∘ g = id :=
@@ -397,23 +475,31 @@ theorem rightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g
 #align function.right_inverse_iff_comp Function.rightInverse_iff_comp
 -/
 
+#print Function.LeftInverse.comp /-
 theorem LeftInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : LeftInverse f g)
     (hh : LeftInverse h i) : LeftInverse (h ∘ f) (g ∘ i) := fun a =>
   show h (f (g (i a))) = a by rw [hf (i a), hh a]
 #align function.left_inverse.comp Function.LeftInverse.comp
+-/
 
+#print Function.RightInverse.comp /-
 theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : RightInverse f g)
     (hh : RightInverse h i) : RightInverse (h ∘ f) (g ∘ i) :=
   LeftInverse.comp hh hf
 #align function.right_inverse.comp Function.RightInverse.comp
+-/
 
+#print Function.LeftInverse.rightInverse /-
 theorem LeftInverse.rightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) : RightInverse f g :=
   h
 #align function.left_inverse.right_inverse Function.LeftInverse.rightInverse
+-/
 
+#print Function.RightInverse.leftInverse /-
 theorem RightInverse.leftInverse {f : α → β} {g : β → α} (h : RightInverse g f) : LeftInverse f g :=
   h
 #align function.right_inverse.left_inverse Function.RightInverse.leftInverse
+-/
 
 #print Function.LeftInverse.surjective /-
 theorem LeftInverse.surjective {f : α → β} {g : β → α} (h : LeftInverse f g) : Surjective f :=
@@ -455,12 +541,14 @@ theorem RightInverse.leftInverse_of_injective {f : α → β} {g : β → α} :
 #align function.right_inverse.left_inverse_of_injective Function.RightInverse.leftInverse_of_injective
 -/
 
+#print Function.LeftInverse.eq_rightInverse /-
 theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
     (h₂ : RightInverse g₂ f) : g₁ = g₂ :=
   calc
     g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp.right_id]
     _ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, comp.left_id]
 #align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverse
+-/
 
 attribute [local instance 10] Classical.propDecidable
 
@@ -472,6 +560,7 @@ noncomputable def partialInv {α β} (f : α → β) (b : β) : Option α :=
 #align function.partial_inv Function.partialInv
 -/
 
+#print Function.partialInv_of_injective /-
 theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPartialInv f (partialInv f)
   | a, b =>
     ⟨fun h =>
@@ -485,10 +574,13 @@ theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPa
         have h : ∃ a', f a' = f a := ⟨_, rfl⟩
         (dif_pos h).trans (congr_arg _ (I <| Classical.choose_spec h))⟩
 #align function.partial_inv_of_injective Function.partialInv_of_injective
+-/
 
+#print Function.partialInv_left /-
 theorem partialInv_left {α β} {f : α → β} (I : Injective f) : ∀ x, partialInv f (f x) = some x :=
   isPartialInv_left (partialInv_of_injective I)
 #align function.partial_inv_left Function.partialInv_left
+-/
 
 end
 
@@ -506,42 +598,60 @@ noncomputable def invFun (f : α → β) : β → α := fun y =>
 #align function.inv_fun Function.invFun
 -/
 
+#print Function.invFun_eq /-
 theorem invFun_eq (h : ∃ a, f a = b) : f (invFun f b) = b := by
   simp only [inv_fun, dif_pos h, h.some_spec]
 #align function.inv_fun_eq Function.invFun_eq
+-/
 
+#print Function.invFun_neg /-
 theorem invFun_neg (h : ¬∃ a, f a = b) : invFun f b = Classical.choice ‹_› :=
   dif_neg h
 #align function.inv_fun_neg Function.invFun_neg
+-/
 
+#print Function.invFun_eq_of_injective_of_rightInverse /-
 theorem invFun_eq_of_injective_of_rightInverse {g : β → α} (hf : Injective f)
     (hg : RightInverse g f) : invFun f = g :=
   funext fun b => hf (by rw [hg b]; exact inv_fun_eq ⟨g b, hg b⟩)
 #align function.inv_fun_eq_of_injective_of_right_inverse Function.invFun_eq_of_injective_of_rightInverse
+-/
 
+#print Function.rightInverse_invFun /-
 theorem rightInverse_invFun (hf : Surjective f) : RightInverse (invFun f) f := fun b =>
   invFun_eq <| hf b
 #align function.right_inverse_inv_fun Function.rightInverse_invFun
+-/
 
+#print Function.leftInverse_invFun /-
 theorem leftInverse_invFun (hf : Injective f) : LeftInverse (invFun f) f := fun b =>
   hf <| invFun_eq ⟨b, rfl⟩
 #align function.left_inverse_inv_fun Function.leftInverse_invFun
+-/
 
+#print Function.invFun_surjective /-
 theorem invFun_surjective (hf : Injective f) : Surjective (invFun f) :=
   (leftInverse_invFun hf).Surjective
 #align function.inv_fun_surjective Function.invFun_surjective
+-/
 
+#print Function.invFun_comp /-
 theorem invFun_comp (hf : Injective f) : invFun f ∘ f = id :=
   funext <| leftInverse_invFun hf
 #align function.inv_fun_comp Function.invFun_comp
+-/
 
+#print Function.Injective.hasLeftInverse /-
 theorem Injective.hasLeftInverse (hf : Injective f) : HasLeftInverse f :=
   ⟨invFun f, leftInverse_invFun hf⟩
 #align function.injective.has_left_inverse Function.Injective.hasLeftInverse
+-/
 
+#print Function.injective_iff_hasLeftInverse /-
 theorem injective_iff_hasLeftInverse : Injective f ↔ HasLeftInverse f :=
   ⟨Injective.hasLeftInverse, HasLeftInverse.injective⟩
 #align function.injective_iff_has_left_inverse Function.injective_iff_hasLeftInverse
+-/
 
 end InvFun
 
@@ -638,6 +748,7 @@ def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
 #align function.update Function.update
 -/
 
+#print Function.update_apply /-
 /-- On non-dependent functions, `function.update` can be expressed as an `ite` -/
 theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
     update f a' b a = if a = a' then b else f a :=
@@ -647,6 +758,7 @@ theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
   funext
   rw [eq_rec_constant]
 #align function.update_apply Function.update_apply
+-/
 
 #print Function.update_same /-
 @[simp]
@@ -741,16 +853,20 @@ theorem update_eq_self (a : α) (f : ∀ a, β a) : update f a (f a) = f :=
 #align function.update_eq_self Function.update_eq_self
 -/
 
+#print Function.update_comp_eq_of_forall_ne' /-
 theorem update_comp_eq_of_forall_ne' {α'} (g : ∀ a, β a) {f : α' → α} {i : α} (a : β i)
     (h : ∀ x, f x ≠ i) : (fun j => (update g i a) (f j)) = fun j => g (f j) :=
   funext fun x => update_noteq (h _) _ _
 #align function.update_comp_eq_of_forall_ne' Function.update_comp_eq_of_forall_ne'
+-/
 
+#print Function.update_comp_eq_of_forall_ne /-
 /-- Non-dependent version of `function.update_comp_eq_of_forall_ne'` -/
 theorem update_comp_eq_of_forall_ne {α β : Sort _} (g : α' → β) {f : α → α'} {i : α'} (a : β)
     (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f :=
   update_comp_eq_of_forall_ne' g a h
 #align function.update_comp_eq_of_forall_ne Function.update_comp_eq_of_forall_ne
+-/
 
 #print Function.update_comp_eq_of_injective' /-
 theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Function.Injective f)
@@ -759,13 +875,16 @@ theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Fu
 #align function.update_comp_eq_of_injective' Function.update_comp_eq_of_injective'
 -/
 
+#print Function.update_comp_eq_of_injective /-
 /-- Non-dependent version of `function.update_comp_eq_of_injective'` -/
 theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → α'}
     (hf : Function.Injective f) (i : α) (a : β) :
     Function.update g (f i) a ∘ f = Function.update (g ∘ f) i a :=
   update_comp_eq_of_injective' g hf i a
 #align function.update_comp_eq_of_injective Function.update_comp_eq_of_injective
+-/
 
+#print Function.apply_update /-
 theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f : ∀ i, α i → β i)
     (g : ∀ i, α i) (i : ι) (v : α i) (j : ι) :
     f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j :=
@@ -774,7 +893,9 @@ theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f :
   · subst j; simp
   · simp [h]
 #align function.apply_update Function.apply_update
+-/
 
+#print Function.apply_update₂ /-
 theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _} (f : ∀ i, α i → β i → γ i)
     (g : ∀ i, α i) (h : ∀ i, β i) (i : ι) (v : α i) (w : β i) (j : ι) :
     f j (update g i v j) (update h i w j) = update (fun k => f k (g k) (h k)) i (f i v w) j :=
@@ -783,12 +904,16 @@ theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _
   · subst j; simp
   · simp [h]
 #align function.apply_update₂ Function.apply_update₂
+-/
 
+#print Function.comp_update /-
 theorem comp_update {α' : Sort _} {β : Sort _} (f : α' → β) (g : α → α') (i : α) (v : α') :
     f ∘ update g i v = update (f ∘ g) i (f v) :=
   funext <| apply_update _ _ _ _
 #align function.comp_update Function.comp_update
+-/
 
+#print Function.update_comm /-
 theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
     (f : ∀ a, β a) : update (update f a v) b w = update (update f b w) a v :=
   by
@@ -796,11 +921,14 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a
   by_cases h₁ : c = b <;> by_cases h₂ : c = a <;> try simp [h₁, h₂]
   cases h (h₂.symm.trans h₁)
 #align function.update_comm Function.update_comm
+-/
 
+#print Function.update_idem /-
 @[simp]
 theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
     update (update f a v) a w = update f a w := by funext b; by_cases b = a <;> simp [update, h]
 #align function.update_idem Function.update_idem
+-/
 
 end Update
 
@@ -831,40 +959,53 @@ def FactorsThrough (g : α → γ) (f : α → β) : Prop :=
 #align function.factors_through Function.FactorsThrough
 -/
 
+#print Function.Injective.FactorsThrough /-
 theorem Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f := fun a b h =>
   congr_arg g (hf h)
 #align function.injective.factors_through Function.Injective.FactorsThrough
+-/
 
+#print Function.extend_def /-
 theorem extend_def (f : α → β) (g : α → γ) (e' : β → γ) (b : β) [Decidable (∃ a, f a = b)] :
     extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b := by unfold extend;
   congr
 #align function.extend_def Function.extend_def
+-/
 
+#print Function.FactorsThrough.extend_apply /-
 theorem FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
   by
   simp only [extend_def, dif_pos, exists_apply_eq_apply]
   exact hf (Classical.choose_spec (exists_apply_eq_apply f a))
 #align function.factors_through.extend_apply Function.FactorsThrough.extend_apply
+-/
 
+#print Function.Injective.extend_apply /-
 @[simp]
 theorem Injective.extend_apply (hf : f.Injective) (g : α → γ) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
   (hf.FactorsThrough g).extend_apply e' a
 #align function.injective.extend_apply Function.Injective.extend_apply
+-/
 
+#print Function.extend_apply' /-
 @[simp]
 theorem extend_apply' (g : α → γ) (e' : β → γ) (b : β) (hb : ¬∃ a, f a = b) :
     extend f g e' b = e' b := by simp [Function.extend_def, hb]
 #align function.extend_apply' Function.extend_apply'
+-/
 
+#print Function.factorsThrough_iff /-
 theorem factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔ ∃ e : β → γ, g = e ∘ f :=
   ⟨fun hf =>
     ⟨extend f g (const β (Classical.arbitrary γ)),
       funext fun x => by simp only [comp_app, hf.extend_apply]⟩,
     fun h a b hf => by rw [Classical.choose_spec h, comp_apply, hf]⟩
 #align function.factors_through_iff Function.factorsThrough_iff
+-/
 
+#print Function.FactorsThrough.apply_extend /-
 theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f) (F : γ → δ)
     (e' : β → γ) (b : β) : F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   by
@@ -875,12 +1016,16 @@ theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g
     · exact hf
   · rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb]
 #align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
+-/
 
+#print Function.Injective.apply_extend /-
 theorem Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
     F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   (hf.FactorsThrough g).apply_extend F e' b
 #align function.injective.apply_extend Function.Injective.apply_extend
+-/
 
+#print Function.extend_injective /-
 theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g => extend f g e' :=
   by
   intro g₁ g₂ hg
@@ -889,47 +1034,64 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g =
   simp only [hf.extend_apply] at H 
   exact H
 #align function.extend_injective Function.extend_injective
+-/
 
+#print Function.FactorsThrough.extend_comp /-
 theorem FactorsThrough.extend_comp {g : α → γ} (e' : β → γ) (hf : FactorsThrough g f) :
     extend f g e' ∘ f = g :=
   funext fun a => by simp only [comp_app, hf.extend_apply e']
 #align function.factors_through.extend_comp Function.FactorsThrough.extend_comp
+-/
 
+#print Function.extend_comp /-
 @[simp]
 theorem extend_comp (hf : Injective f) (g : α → γ) (e' : β → γ) : extend f g e' ∘ f = g :=
   (hf.FactorsThrough g).extend_comp e'
 #align function.extend_comp Function.extend_comp
+-/
 
+#print Function.Injective.surjective_comp_right' /-
 theorem Injective.surjective_comp_right' (hf : Injective f) (g₀ : β → γ) :
     Surjective fun g : β → γ => g ∘ f := fun g => ⟨extend f g g₀, extend_comp hf _ _⟩
 #align function.injective.surjective_comp_right' Function.Injective.surjective_comp_right'
+-/
 
+#print Function.Injective.surjective_comp_right /-
 theorem Injective.surjective_comp_right [Nonempty γ] (hf : Injective f) :
     Surjective fun g : β → γ => g ∘ f :=
   hf.surjective_comp_right' fun _ => Classical.choice ‹_›
 #align function.injective.surjective_comp_right Function.Injective.surjective_comp_right
+-/
 
+#print Function.Bijective.comp_right /-
 theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ => g ∘ f :=
   ⟨hf.Surjective.injective_comp_right, fun g =>
     ⟨g ∘ surjInv hf.Surjective, by
       simp only [comp.assoc g _ f, (left_inverse_surj_inv hf).comp_eq_id, comp.right_id]⟩⟩
 #align function.bijective.comp_right Function.Bijective.comp_right
+-/
 
 end Extend
 
+#print Function.uncurry_def /-
 theorem uncurry_def {α β γ} (f : α → β → γ) : uncurry f = fun p => f p.1 p.2 :=
   rfl
 #align function.uncurry_def Function.uncurry_def
+-/
 
+#print Function.uncurry_apply_pair /-
 @[simp]
 theorem uncurry_apply_pair {α β γ} (f : α → β → γ) (x : α) (y : β) : uncurry f (x, y) = f x y :=
   rfl
 #align function.uncurry_apply_pair Function.uncurry_apply_pair
+-/
 
+#print Function.curry_apply /-
 @[simp]
 theorem curry_apply {α β γ} (f : α × β → γ) (x : α) (y : β) : curry f x y = f (x, y) :=
   rfl
 #align function.curry_apply Function.curry_apply
+-/
 
 section Bicomp
 
@@ -950,18 +1112,21 @@ def bicompr (f : γ → δ) (g : α → β → γ) (a b) :=
 #align function.bicompr Function.bicompr
 -/
 
--- mathport name: «expr ∘₂ »
 -- Suggested local notation:
 local notation f " ∘₂ " g => bicompr f g
 
+#print Function.uncurry_bicompr /-
 theorem uncurry_bicompr (f : α → β → γ) (g : γ → δ) : uncurry (g ∘₂ f) = g ∘ uncurry f :=
   rfl
 #align function.uncurry_bicompr Function.uncurry_bicompr
+-/
 
+#print Function.uncurry_bicompl /-
 theorem uncurry_bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) :
     uncurry (bicompl f g h) = uncurry f ∘ Prod.map g h :=
   rfl
 #align function.uncurry_bicompl Function.uncurry_bicompl
+-/
 
 end Bicomp
 
@@ -983,7 +1148,6 @@ class HasUncurry (α : Type _) (β : outParam (Type _)) (γ : outParam (Type _))
 for bundled maps.-/
 add_decl_doc has_uncurry.uncurry
 
--- mathport name: uncurry
 notation:arg "↿" x:arg => HasUncurry.uncurry x
 
 #print Function.hasUncurryBase /-
@@ -1023,8 +1187,6 @@ namespace Involutive
 
 variable {α : Sort u} {f : α → α} (h : Involutive f)
 
-include h
-
 #print Function.Involutive.comp_self /-
 @[simp]
 theorem comp_self : f ∘ f = id :=
@@ -1090,36 +1252,48 @@ namespace Injective2
 
 variable {α β γ : Sort _} {f : α → β → γ}
 
+#print Function.Injective2.left /-
 /-- A binary injective function is injective when only the left argument varies. -/
 protected theorem left (hf : Injective2 f) (b : β) : Function.Injective fun a => f a b :=
   fun a₁ a₂ h => (hf h).left
 #align function.injective2.left Function.Injective2.left
+-/
 
+#print Function.Injective2.right /-
 /-- A binary injective function is injective when only the right argument varies. -/
 protected theorem right (hf : Injective2 f) (a : α) : Function.Injective (f a) := fun a₁ a₂ h =>
   (hf h).right
 #align function.injective2.right Function.Injective2.right
+-/
 
+#print Function.Injective2.uncurry /-
 protected theorem uncurry {α β γ : Type _} {f : α → β → γ} (hf : Injective2 f) :
     Function.Injective (uncurry f) := fun ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ h => And.elim (hf h) (congr_arg₂ _)
 #align function.injective2.uncurry Function.Injective2.uncurry
+-/
 
+#print Function.Injective2.left' /-
 /-- As a map from the left argument to a unary function, `f` is injective. -/
 theorem left' (hf : Injective2 f) [Nonempty β] : Function.Injective f := fun a₁ a₂ h =>
   let ⟨b⟩ := ‹Nonempty β›
   hf.left b <| (congr_fun h b : _)
 #align function.injective2.left' Function.Injective2.left'
+-/
 
+#print Function.Injective2.right' /-
 /-- As a map from the right argument to a unary function, `f` is injective. -/
 theorem right' (hf : Injective2 f) [Nonempty α] : Function.Injective fun b a => f a b :=
   fun b₁ b₂ h =>
   let ⟨a⟩ := ‹Nonempty α›
   hf.right a <| (congr_fun h a : _)
 #align function.injective2.right' Function.Injective2.right'
+-/
 
+#print Function.Injective2.eq_iff /-
 theorem eq_iff (hf : Injective2 f) {a₁ a₂ b₁ b₂} : f a₁ b₁ = f a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ :=
   ⟨fun h => hf h, And.ndrec <| congr_arg₂ f⟩
 #align function.injective2.eq_iff Function.Injective2.eq_iff
+-/
 
 end Injective2
 
@@ -1162,10 +1336,12 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 /-! ### Bijectivity of `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` -/
 
 
+#print eq_rec_on_bijective /-
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.recOn _ _ C _ h)
   | _, _, rfl => ⟨fun x y => id, fun x => ⟨x, rfl⟩⟩
 #align eq_rec_on_bijective eq_rec_on_bijective
+-/
 
 #print eq_mp_bijective /-
 theorem eq_mp_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mp h) :=
@@ -1189,11 +1365,13 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
 is trivial anyway.-/
 
 
+#print eq_rec_inj /-
 @[simp]
 theorem eq_rec_inj {α : Sort _} {a a' : α} (h : a = a') {C : α → Type _} (x y : C a) :
     (Eq.ndrec x h : C a') = Eq.ndrec y h ↔ x = y :=
   (eq_rec_on_bijective h).Injective.eq_iff
 #align eq_rec_inj eq_rec_inj
+-/
 
 #print cast_inj /-
 @[simp]
@@ -1202,23 +1380,29 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
 #align cast_inj cast_inj
 -/
 
+#print Function.LeftInverse.eq_rec_eq /-
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     (congr_arg f (h a)).rec (C (g (f a))) = C a :=
   eq_of_hEq <| (eq_rec_hEq _ _).trans <| by rw [h]
 #align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eq
+-/
 
+#print Function.LeftInverse.eq_rec_on_eq /-
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     (congr_arg f (h a)).recOn (C (g (f a))) = C a :=
   h.eq_rec_eq _ _
 #align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eq
+-/
 
+#print Function.LeftInverse.cast_eq /-
 theorem Function.LeftInverse.cast_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     cast (congr_arg (fun a => γ (f a)) (h a)) (C (g (f a))) = C a :=
   eq_of_hEq <| (eq_rec_hEq _ _).trans <| by rw [h]
 #align function.left_inverse.cast_eq Function.LeftInverse.cast_eq
+-/
 
 #print Set.SeparatesPoints /-
 /-- A set of functions "separates points"
@@ -1228,9 +1412,11 @@ def Set.SeparatesPoints {α β : Type _} (A : Set (α → β)) : Prop :=
 #align set.separates_points Set.SeparatesPoints
 -/
 
+#print IsSymmOp.flip_eq /-
 theorem IsSymmOp.flip_eq {α β} (op) [IsSymmOp α β op] : flip op = op :=
   funext fun a => funext fun b => (IsSymmOp.symm_op a b).symm
 #align is_symm_op.flip_eq IsSymmOp.flip_eq
+-/
 
 #print InvImage.equivalence /-
 theorem InvImage.equivalence {α : Sort u} {β : Sort v} (r : β → β → Prop) (f : α → β)
Diff
@@ -460,7 +460,6 @@ theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h
   calc
     g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp.right_id]
     _ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, comp.left_id]
-    
 #align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverse
 
 attribute [local instance 10] Classical.propDecidable
Diff
@@ -679,7 +679,7 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 #align function.update_noteq Function.update_noteq
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) := by
@@ -687,7 +687,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
@@ -695,7 +695,7 @@ theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.update_eq_iff /-
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
@@ -703,7 +703,7 @@ theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.update_eq_iff Function.update_eq_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:638:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.eq_update_iff /-
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
Diff
@@ -317,7 +317,7 @@ theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α
 to `set α`. -/
 theorem cantor_surjective {α} (f : α → Set α) : ¬Function.Surjective f
   | h =>
-    let ⟨D, e⟩ := h { a | ¬a ∈ f a }
+    let ⟨D, e⟩ := h {a | ¬a ∈ f a}
     (iff_not_self (D ∈ f D)).1 <| iff_of_eq (congr_arg ((· ∈ ·) D) e)
 #align function.cantor_surjective Function.cantor_surjective
 -/
@@ -327,7 +327,7 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬Function.Surjective f
 to `α`. -/
 theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Function.Injective f
   | i =>
-    (cantor_surjective fun a => { b | ∀ U, a = f U → b ∈ U }) <|
+    (cantor_surjective fun a => {b | ∀ U, a = f U → b ∈ U}) <|
       RightInverse.surjective fun U =>
         funext fun a => propext ⟨fun h => h U rfl, fun h' U' e => i e ▸ h'⟩
 #align function.cantor_injective Function.cantor_injective
Diff
@@ -188,12 +188,12 @@ theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
     Function.Injective fun x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩ := fun x₁ x₂ h =>
   by
-  dsimp only at h
+  dsimp only at h 
   by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
-  · rw [dif_pos h₁, dif_pos h₂] at h; injection hf h
-  · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
-  · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
-  · rw [dif_neg h₁, dif_neg h₂] at h; injection hf' h
+  · rw [dif_pos h₁, dif_pos h₂] at h ; injection hf h
+  · rw [dif_pos h₁, dif_neg h₂] at h ; exact (im_disj h).elim
+  · rw [dif_neg h₁, dif_pos h₂] at h ; exact (im_disj h.symm).elim
+  · rw [dif_neg h₁, dif_neg h₂] at h ; injection hf' h
 #align function.injective.dite Function.Injective.dite
 
 #print Function.Surjective.of_comp /-
@@ -344,8 +344,9 @@ theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjecti
   let g : Set T → T := fun s => ⟨U, cast hU.symm s⟩
   have hg : injective g := by
     intro s t h
-    suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this; assumption
-    · congr ; assumption
+    suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this ;
+      assumption
+    · congr; assumption
   exact cantor_injective g hg
 #align function.not_surjective_Type Function.not_surjective_Type
 -/
@@ -476,10 +477,10 @@ theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPa
   | a, b =>
     ⟨fun h =>
       if h' : ∃ a, f a = b then by
-        rw [partial_inv, dif_pos h'] at h
+        rw [partial_inv, dif_pos h'] at h 
         injection h with h; subst h
         apply Classical.choose_spec h'
-      else by rw [partial_inv, dif_neg h'] at h <;> contradiction,
+      else by rw [partial_inv, dif_neg h'] at h  <;> contradiction,
       fun e =>
       e ▸
         have h : ∃ a', f a' = f a := ⟨_, rfl⟩
@@ -667,7 +668,7 @@ theorem surjective_eval {α : Sort u} {β : α → Sort v} [h : ∀ a, Nonempty
 theorem update_injective (f : ∀ a, β a) (a' : α) : Injective (update f a') := fun v v' h =>
   by
   have := congr_fun h a'
-  rwa [update_same, update_same] at this
+  rwa [update_same, update_same] at this 
 #align function.update_injective Function.update_injective
 -/
 
@@ -689,7 +690,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
-    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) := by
+    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
   rw [← not_forall_not, forall_update_iff f fun a b => ¬p a b]; simp [not_and_or]
 #align function.exists_update_iff Function.exists_update_iff
 -/
@@ -886,7 +887,7 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g =
   intro g₁ g₂ hg
   refine' funext fun x => _
   have H := congr_fun hg (f x)
-  simp only [hf.extend_apply] at H
+  simp only [hf.extend_apply] at H 
   exact H
 #align function.extend_injective Function.extend_injective
 
Diff
@@ -45,77 +45,36 @@ theorem eval_apply {β : α → Sort _} (x : α) (f : ∀ x, β x) : eval x f =
 -/
 
 /- warning: function.comp_apply clashes with function.comp_app -> Function.comp_apply
-warning: function.comp_apply -> Function.comp_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {φ : Sort.{u3}} (f : β -> φ) (g : α -> β) (a : α), Eq.{u3} φ (Function.comp.{u1, u2, u3} α β φ f g a) (f (g a))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {φ : Sort.{u1}} {f : α -> β} {g : φ -> α} {a : φ}, Eq.{u2} β (Function.comp.{u1, u3, u2} φ α β f g a) (f (g a))
 Case conversion may be inaccurate. Consider using '#align function.comp_apply Function.comp_applyₓ'. -/
 theorem comp_apply {α : Sort u} {β : Sort v} {φ : Sort w} (f : β → φ) (g : α → β) (a : α) :
     (f ∘ g) a = f (g a) :=
   rfl
 #align function.comp_apply Function.comp_apply
 
-/- warning: function.const_def -> Function.const_def is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {y : β}, Eq.{imax u1 u2} (α -> β) (fun (x : α) => y) (Function.const.{u2, u1} β α y)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {y : β}, Eq.{imax u2 u1} (α -> β) (fun (x : α) => y) (Function.const.{u1, u2} β α y)
-Case conversion may be inaccurate. Consider using '#align function.const_def Function.const_defₓ'. -/
 theorem const_def {y : β} : (fun x : α => y) = const α y :=
   rfl
 #align function.const_def Function.const_def
 
-/- warning: function.const_apply -> Function.const_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {y : β} {x : α}, Eq.{u2} β (Function.const.{u2, u1} β α y x) y
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {y : α} {x : β}, Eq.{u2} α (Function.const.{u2, u1} α β y x) y
-Case conversion may be inaccurate. Consider using '#align function.const_apply Function.const_applyₓ'. -/
 @[simp]
 theorem const_apply {y : β} {x : α} : const α y x = y :=
   rfl
 #align function.const_apply Function.const_apply
 
-/- warning: function.const_comp -> Function.const_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {c : γ}, Eq.{imax u1 u3} (α -> γ) (Function.comp.{u1, u2, u3} α β γ (Function.const.{u3, u2} γ β c) f) (Function.const.{u3, u1} γ α c)
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u1}} {γ : Sort.{u2}} {f : α -> β} {c : γ}, Eq.{imax u3 u2} (α -> γ) (Function.comp.{u3, u1, u2} α β γ (Function.const.{u2, u1} γ β c) f) (Function.const.{u2, u3} γ α c)
-Case conversion may be inaccurate. Consider using '#align function.const_comp Function.const_compₓ'. -/
 @[simp]
 theorem const_comp {f : α → β} {c : γ} : const β c ∘ f = const α c :=
   rfl
 #align function.const_comp Function.const_comp
 
-/- warning: function.comp_const -> Function.comp_const is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : β -> γ} {b : β}, Eq.{imax u1 u3} (α -> γ) (Function.comp.{u1, u2, u3} α β γ f (Function.const.{u2, u1} β α b)) (Function.const.{u3, u1} γ α (f b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u1}} {γ : Sort.{u2}} {f : β -> γ} {b : β}, Eq.{imax u3 u2} (α -> γ) (Function.comp.{u3, u1, u2} α β γ f (Function.const.{u1, u3} β α b)) (Function.const.{u2, u3} γ α (f b))
-Case conversion may be inaccurate. Consider using '#align function.comp_const Function.comp_constₓ'. -/
 @[simp]
 theorem comp_const {f : β → γ} {b : β} : f ∘ const α b = const α (f b) :=
   rfl
 #align function.comp_const Function.comp_const
 
-/- warning: function.const_injective -> Function.const_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α], Function.Injective.{u2, imax u1 u2} β (α -> β) (Function.const.{u2, u1} β α)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α], Function.Injective.{u1, imax u2 u1} β (α -> β) (Function.const.{u1, u2} β α)
-Case conversion may be inaccurate. Consider using '#align function.const_injective Function.const_injectiveₓ'. -/
 theorem const_injective [Nonempty α] : Injective (const α : β → α → β) := fun y₁ y₂ h =>
   let ⟨x⟩ := ‹Nonempty α›
   congr_fun h x
 #align function.const_injective Function.const_injective
 
-/- warning: function.const_inj -> Function.const_inj is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {y₁ : β} {y₂ : β}, Iff (Eq.{imax u1 u2} (α -> β) (Function.const.{u2, u1} β α y₁) (Function.const.{u2, u1} β α y₂)) (Eq.{u2} β y₁ y₂)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {y₁ : β} {y₂ : β}, Iff (Eq.{imax u2 u1} (α -> β) (Function.const.{u1, u2} β α y₁) (Function.const.{u1, u2} β α y₂)) (Eq.{u1} β y₁ y₂)
-Case conversion may be inaccurate. Consider using '#align function.const_inj Function.const_injₓ'. -/
 @[simp]
 theorem const_inj [Nonempty α] {y₁ y₂ : β} : const α y₁ = const α y₂ ↔ y₁ = y₂ :=
   ⟨fun h => const_injective h, fun h => h ▸ rfl⟩
@@ -127,12 +86,6 @@ theorem id_def : @id α = fun x => x :=
 #align function.id_def Function.id_def
 -/
 
-/- warning: function.on_fun_apply -> Function.onFun_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : β -> β -> γ) (g : α -> β) (a : α) (b : α), Eq.{u3} γ (Function.onFun.{u1, u2, u3} α β γ f g a b) (f (g a) (g b))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} (f : β -> β -> γ) (g : α -> β) (a : α) (b : α), Eq.{u3} γ (Function.onFun.{u2, u1, u3} α β γ f g a b) (f (g a) (g b))
-Case conversion may be inaccurate. Consider using '#align function.on_fun_apply Function.onFun_applyₓ'. -/
 @[simp]
 theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
   rfl
@@ -164,72 +117,30 @@ theorem ne_iff {β : α → Sort _} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ 
 #align function.ne_iff Function.ne_iff
 -/
 
-/- warning: function.bijective.injective -> Function.Bijective.injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (Function.Injective.{u1, u2} α β f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u2, u1} α β f) -> (Function.Injective.{u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.bijective.injective Function.Bijective.injectiveₓ'. -/
 protected theorem Bijective.injective {f : α → β} (hf : Bijective f) : Injective f :=
   hf.1
 #align function.bijective.injective Function.Bijective.injective
 
-/- warning: function.bijective.surjective -> Function.Bijective.surjective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (Function.Surjective.{u1, u2} α β f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u2, u1} α β f) -> (Function.Surjective.{u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.bijective.surjective Function.Bijective.surjectiveₓ'. -/
 protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surjective f :=
   hf.2
 #align function.bijective.surjective Function.Bijective.surjective
 
-/- warning: function.injective.eq_iff -> Function.Injective.eq_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall {a : α} {b : α}, Iff (Eq.{u2} β (f a) (f b)) (Eq.{u1} α a b))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (forall {a : α} {b : α}, Iff (Eq.{u1} β (f a) (f b)) (Eq.{u2} α a b))
-Case conversion may be inaccurate. Consider using '#align function.injective.eq_iff Function.Injective.eq_iffₓ'. -/
 theorem Injective.eq_iff (I : Injective f) {a b : α} : f a = f b ↔ a = b :=
   ⟨@I _ _, congr_arg f⟩
 #align function.injective.eq_iff Function.Injective.eq_iff
 
-/- warning: function.injective.eq_iff' -> Function.Injective.eq_iff' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall {a : α} {b : α} {c : β}, (Eq.{u2} β (f b) c) -> (Iff (Eq.{u2} β (f a) c) (Eq.{u1} α a b)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (forall {a : α} {b : α} {c : β}, (Eq.{u1} β (f b) c) -> (Iff (Eq.{u1} β (f a) c) (Eq.{u2} α a b)))
-Case conversion may be inaccurate. Consider using '#align function.injective.eq_iff' Function.Injective.eq_iff'ₓ'. -/
 theorem Injective.eq_iff' (I : Injective f) {a b : α} {c : β} (h : f b = c) : f a = c ↔ a = b :=
   h ▸ I.eq_iff
 #align function.injective.eq_iff' Function.Injective.eq_iff'
 
-/- warning: function.injective.ne -> Function.Injective.ne is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall {a₁ : α} {a₂ : α}, (Ne.{u1} α a₁ a₂) -> (Ne.{u2} β (f a₁) (f a₂)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (forall {a₁ : α} {a₂ : α}, (Ne.{u2} α a₁ a₂) -> (Ne.{u1} β (f a₁) (f a₂)))
-Case conversion may be inaccurate. Consider using '#align function.injective.ne Function.Injective.neₓ'. -/
 theorem Injective.ne (hf : Injective f) {a₁ a₂ : α} : a₁ ≠ a₂ → f a₁ ≠ f a₂ :=
   mt fun h => hf h
 #align function.injective.ne Function.Injective.ne
 
-/- warning: function.injective.ne_iff -> Function.Injective.ne_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall {x : α} {y : α}, Iff (Ne.{u2} β (f x) (f y)) (Ne.{u1} α x y))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (forall {x : α} {y : α}, Iff (Ne.{u1} β (f x) (f y)) (Ne.{u2} α x y))
-Case conversion may be inaccurate. Consider using '#align function.injective.ne_iff Function.Injective.ne_iffₓ'. -/
 theorem Injective.ne_iff (hf : Injective f) {x y : α} : f x ≠ f y ↔ x ≠ y :=
   ⟨mt <| congr_arg f, hf.Ne⟩
 #align function.injective.ne_iff Function.Injective.ne_iff
 
-/- warning: function.injective.ne_iff' -> Function.Injective.ne_iff' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall {x : α} {y : α} {z : β}, (Eq.{u2} β (f y) z) -> (Iff (Ne.{u2} β (f x) z) (Ne.{u1} α x y)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (forall {x : α} {y : α} {z : β}, (Eq.{u1} β (f y) z) -> (Iff (Ne.{u1} β (f x) z) (Ne.{u2} α x y)))
-Case conversion may be inaccurate. Consider using '#align function.injective.ne_iff' Function.Injective.ne_iff'ₓ'. -/
 theorem Injective.ne_iff' (hf : Injective f) {x y : α} {z : β} (h : f y = z) : f x ≠ z ↔ x ≠ y :=
   h ▸ hf.ne_iff
 #align function.injective.ne_iff' Function.Injective.ne_iff'
@@ -248,23 +159,11 @@ theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective
 #align function.injective.of_comp Function.Injective.of_comp
 -/
 
-/- warning: function.injective.of_comp_iff -> Function.Injective.of_comp_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Injective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Injective.{u3, u1} γ α g))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Injective.{u1, u2} γ β (Function.comp.{u1, u3, u2} γ α β f g)) (Function.Injective.{u1, u3} γ α g))
-Case conversion may be inaccurate. Consider using '#align function.injective.of_comp_iff Function.Injective.of_comp_iffₓ'. -/
 theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α) :
     Injective (f ∘ g) ↔ Injective g :=
   ⟨Injective.of_comp, hf.comp⟩
 #align function.injective.of_comp_iff Function.Injective.of_comp_iff
 
-/- warning: function.injective.of_comp_iff' -> Function.Injective.of_comp_iff' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Bijective.{u3, u1} γ α g) -> (Iff (Function.Injective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Injective.{u1, u2} α β f))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Bijective.{u3, u2} γ α g) -> (Iff (Function.Injective.{u3, u1} γ β (Function.comp.{u3, u2, u1} γ α β f g)) (Function.Injective.{u2, u1} α β f))
-Case conversion may be inaccurate. Consider using '#align function.injective.of_comp_iff' Function.Injective.of_comp_iff'ₓ'. -/
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
   ⟨fun h x y =>
@@ -274,34 +173,16 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
     fun h => h.comp hg.Injective⟩
 #align function.injective.of_comp_iff' Function.Injective.of_comp_iff'
 
-/- warning: function.injective.comp_left -> Function.Injective.comp_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {g : β -> γ}, (Function.Injective.{u2, u3} β γ g) -> (Function.Injective.{imax u1 u2, imax u1 u3} (α -> β) (α -> γ) (Function.comp.{u1, u2, u3} α β γ g))
-but is expected to have type
-  forall {α : Sort.{u1}} {β : Sort.{u3}} {γ : Sort.{u2}} {g : β -> γ}, (Function.Injective.{u3, u2} β γ g) -> (Function.Injective.{imax u1 u3, imax u1 u2} (α -> β) (α -> γ) ((fun (x._@.Mathlib.Logic.Function.Basic._hyg.1150 : β -> γ) (x._@.Mathlib.Logic.Function.Basic._hyg.1152 : α -> β) => Function.comp.{u1, u3, u2} α β γ x._@.Mathlib.Logic.Function.Basic._hyg.1150 x._@.Mathlib.Logic.Function.Basic._hyg.1152) g))
-Case conversion may be inaccurate. Consider using '#align function.injective.comp_left Function.Injective.comp_leftₓ'. -/
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
     Function.Injective ((· ∘ ·) g : (α → β) → α → γ) := fun f₁ f₂ hgf =>
   funext fun i => hg <| (congr_fun hgf i : _)
 #align function.injective.comp_left Function.Injective.comp_left
 
-/- warning: function.injective_of_subsingleton -> Function.injective_of_subsingleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Subsingleton.{u1} α] (f : α -> β), Function.Injective.{u1, u2} α β f
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Subsingleton.{u2} α] (f : α -> β), Function.Injective.{u2, u1} α β f
-Case conversion may be inaccurate. Consider using '#align function.injective_of_subsingleton Function.injective_of_subsingletonₓ'. -/
 theorem injective_of_subsingleton [Subsingleton α] (f : α → β) : Injective f := fun a b ab =>
   Subsingleton.elim _ _
 #align function.injective_of_subsingleton Function.injective_of_subsingleton
 
-/- warning: function.injective.dite -> Function.Injective.dite is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} (p : α -> Prop) [_inst_1 : DecidablePred.{u1} α p] {f : (Subtype.{u1} α (fun (a : α) => p a)) -> β} {f' : (Subtype.{u1} α (fun (a : α) => Not (p a))) -> β}, (Function.Injective.{max 1 u1, u2} (Subtype.{u1} α (fun (a : α) => p a)) β f) -> (Function.Injective.{max 1 u1, u2} (Subtype.{u1} α (fun (a : α) => Not (p a))) β f') -> (forall {x : α} {x' : α} {hx : p x} {hx' : Not (p x')}, Ne.{u2} β (f (Subtype.mk.{u1} α (fun (a : α) => p a) x hx)) (f' (Subtype.mk.{u1} α (fun (a : α) => Not (p a)) x' hx'))) -> (Function.Injective.{u1, u2} α β (fun (x : α) => dite.{u2} β (p x) (_inst_1 x) (fun (h : p x) => f (Subtype.mk.{u1} α (fun (a : α) => p a) x h)) (fun (h : Not (p x)) => f' (Subtype.mk.{u1} α (fun (a : α) => Not (p a)) x h))))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} (p : α -> Prop) [_inst_1 : DecidablePred.{u2} α p] {f : (Subtype.{u2} α (fun (a : α) => p a)) -> β} {f' : (Subtype.{u2} α (fun (a : α) => Not (p a))) -> β}, (Function.Injective.{max 1 u2, u1} (Subtype.{u2} α (fun (a : α) => p a)) β f) -> (Function.Injective.{max 1 u2, u1} (Subtype.{u2} α (fun (a : α) => Not (p a))) β f') -> (forall {x : α} {x' : α} {hx : p x} {hx' : Not (p x')}, Ne.{u1} β (f (Subtype.mk.{u2} α (fun (a : α) => p a) x hx)) (f' (Subtype.mk.{u2} α (fun (a : α) => Not (p a)) x' hx'))) -> (Function.Injective.{u2, u1} α β (fun (x : α) => dite.{u1} β (p x) (_inst_1 x) (fun (h : p x) => f (Subtype.mk.{u2} α (fun (a : α) => p a) x h)) (fun (h : Not (p x)) => f' (Subtype.mk.{u2} α (fun (a : α) => Not (p a)) x h))))
-Case conversion may be inaccurate. Consider using '#align function.injective.dite Function.Injective.diteₓ'. -/
 theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a } → β}
     {f' : { a : α // ¬p a } → β} (hf : Injective f) (hf' : Injective f')
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
@@ -322,23 +203,11 @@ theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjecti
 #align function.surjective.of_comp Function.Surjective.of_comp
 -/
 
-/- warning: function.surjective.of_comp_iff -> Function.Surjective.of_comp_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Surjective.{u3, u1} γ α g) -> (Iff (Function.Surjective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Surjective.{u1, u2} α β f))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Surjective.{u3, u2} γ α g) -> (Iff (Function.Surjective.{u3, u1} γ β (Function.comp.{u3, u2, u1} γ α β f g)) (Function.Surjective.{u2, u1} α β f))
-Case conversion may be inaccurate. Consider using '#align function.surjective.of_comp_iff Function.Surjective.of_comp_iffₓ'. -/
 theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective g) :
     Surjective (f ∘ g) ↔ Surjective f :=
   ⟨Surjective.of_comp, fun h => h.comp hg⟩
 #align function.surjective.of_comp_iff Function.Surjective.of_comp_iff
 
-/- warning: function.surjective.of_comp_iff' -> Function.Surjective.of_comp_iff' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Surjective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Surjective.{u3, u1} γ α g))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u3, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Surjective.{u1, u2} γ β (Function.comp.{u1, u3, u2} γ α β f g)) (Function.Surjective.{u1, u3} γ α g))
-Case conversion may be inaccurate. Consider using '#align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'ₓ'. -/
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
   ⟨fun h x =>
@@ -354,12 +223,6 @@ instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, D
 #align function.decidable_eq_pfun Function.decidableEqPfun
 -/
 
-/- warning: function.surjective.forall -> Function.Surjective.forall is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> Prop}, Iff (forall (y : β), p y) (forall (x : α), p (f x)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> Prop}, Iff (forall (y : β), p y) (forall (x : α), p (f x)))
-Case conversion may be inaccurate. Consider using '#align function.surjective.forall Function.Surjective.forallₓ'. -/
 protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
     (∀ y, p y) ↔ ∀ x, p (f x) :=
   ⟨fun h x => h (f x), fun h y =>
@@ -367,34 +230,16 @@ protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
     hx ▸ h x⟩
 #align function.surjective.forall Function.Surjective.forall
 
-/- warning: function.surjective.forall₂ -> Function.Surjective.forall₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> β -> Prop}, Iff (forall (y₁ : β) (y₂ : β), p y₁ y₂) (forall (x₁ : α) (x₂ : α), p (f x₁) (f x₂)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> β -> Prop}, Iff (forall (y₁ : β) (y₂ : β), p y₁ y₂) (forall (x₁ : α) (x₂ : α), p (f x₁) (f x₂)))
-Case conversion may be inaccurate. Consider using '#align function.surjective.forall₂ Function.Surjective.forall₂ₓ'. -/
 protected theorem Surjective.forall₂ (hf : Surjective f) {p : β → β → Prop} :
     (∀ y₁ y₂, p y₁ y₂) ↔ ∀ x₁ x₂, p (f x₁) (f x₂) :=
   hf.forall.trans <| forall_congr' fun x => hf.forall
 #align function.surjective.forall₂ Function.Surjective.forall₂
 
-/- warning: function.surjective.forall₃ -> Function.Surjective.forall₃ is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> β -> β -> Prop}, Iff (forall (y₁ : β) (y₂ : β) (y₃ : β), p y₁ y₂ y₃) (forall (x₁ : α) (x₂ : α) (x₃ : α), p (f x₁) (f x₂) (f x₃)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> β -> β -> Prop}, Iff (forall (y₁ : β) (y₂ : β) (y₃ : β), p y₁ y₂ y₃) (forall (x₁ : α) (x₂ : α) (x₃ : α), p (f x₁) (f x₂) (f x₃)))
-Case conversion may be inaccurate. Consider using '#align function.surjective.forall₃ Function.Surjective.forall₃ₓ'. -/
 protected theorem Surjective.forall₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∀ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∀ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.forall.trans <| forall_congr' fun x => hf.forall₂
 #align function.surjective.forall₃ Function.Surjective.forall₃
 
-/- warning: function.surjective.exists -> Function.Surjective.exists is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> Prop}, Iff (Exists.{u2} β (fun (y : β) => p y)) (Exists.{u1} α (fun (x : α) => p (f x))))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> Prop}, Iff (Exists.{u1} β (fun (y : β) => p y)) (Exists.{u2} α (fun (x : α) => p (f x))))
-Case conversion may be inaccurate. Consider using '#align function.surjective.exists Function.Surjective.existsₓ'. -/
 protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     (∃ y, p y) ↔ ∃ x, p (f x) :=
   ⟨fun ⟨y, hy⟩ =>
@@ -403,55 +248,25 @@ protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     fun ⟨x, hx⟩ => ⟨f x, hx⟩⟩
 #align function.surjective.exists Function.Surjective.exists
 
-/- warning: function.surjective.exists₂ -> Function.Surjective.exists₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> β -> Prop}, Iff (Exists.{u2} β (fun (y₁ : β) => Exists.{u2} β (fun (y₂ : β) => p y₁ y₂))) (Exists.{u1} α (fun (x₁ : α) => Exists.{u1} α (fun (x₂ : α) => p (f x₁) (f x₂)))))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> β -> Prop}, Iff (Exists.{u1} β (fun (y₁ : β) => Exists.{u1} β (fun (y₂ : β) => p y₁ y₂))) (Exists.{u2} α (fun (x₁ : α) => Exists.{u2} α (fun (x₂ : α) => p (f x₁) (f x₂)))))
-Case conversion may be inaccurate. Consider using '#align function.surjective.exists₂ Function.Surjective.exists₂ₓ'. -/
 protected theorem Surjective.exists₂ (hf : Surjective f) {p : β → β → Prop} :
     (∃ y₁ y₂, p y₁ y₂) ↔ ∃ x₁ x₂, p (f x₁) (f x₂) :=
   hf.exists.trans <| exists_congr fun x => hf.exists
 #align function.surjective.exists₂ Function.Surjective.exists₂
 
-/- warning: function.surjective.exists₃ -> Function.Surjective.exists₃ is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {p : β -> β -> β -> Prop}, Iff (Exists.{u2} β (fun (y₁ : β) => Exists.{u2} β (fun (y₂ : β) => Exists.{u2} β (fun (y₃ : β) => p y₁ y₂ y₃)))) (Exists.{u1} α (fun (x₁ : α) => Exists.{u1} α (fun (x₂ : α) => Exists.{u1} α (fun (x₃ : α) => p (f x₁) (f x₂) (f x₃))))))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (forall {p : β -> β -> β -> Prop}, Iff (Exists.{u1} β (fun (y₁ : β) => Exists.{u1} β (fun (y₂ : β) => Exists.{u1} β (fun (y₃ : β) => p y₁ y₂ y₃)))) (Exists.{u2} α (fun (x₁ : α) => Exists.{u2} α (fun (x₂ : α) => Exists.{u2} α (fun (x₃ : α) => p (f x₁) (f x₂) (f x₃))))))
-Case conversion may be inaccurate. Consider using '#align function.surjective.exists₃ Function.Surjective.exists₃ₓ'. -/
 protected theorem Surjective.exists₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∃ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∃ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.exists.trans <| exists_congr fun x => hf.exists₂
 #align function.surjective.exists₃ Function.Surjective.exists₃
 
-/- warning: function.surjective.injective_comp_right -> Function.Surjective.injective_comp_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (Function.Injective.{imax u2 u3, imax u1 u3} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u1, u2, u3} α β γ g f))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u3, u2} α β f) -> (Function.Injective.{imax u2 u1, imax u3 u1} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u3, u2, u1} α β γ g f))
-Case conversion may be inaccurate. Consider using '#align function.surjective.injective_comp_right Function.Surjective.injective_comp_rightₓ'. -/
 theorem Surjective.injective_comp_right (hf : Surjective f) : Injective fun g : β → γ => g ∘ f :=
   fun g₁ g₂ h => funext <| hf.forall.2 <| congr_fun h
 #align function.surjective.injective_comp_right Function.Surjective.injective_comp_right
 
-/- warning: function.surjective.right_cancellable -> Function.Surjective.right_cancellable is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (forall {g₁ : β -> γ} {g₂ : β -> γ}, Iff (Eq.{imax u1 u3} (α -> γ) (Function.comp.{u1, u2, u3} α β γ g₁ f) (Function.comp.{u1, u2, u3} α β γ g₂ f)) (Eq.{imax u2 u3} (β -> γ) g₁ g₂))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Surjective.{u3, u2} α β f) -> (forall {g₁ : β -> γ} {g₂ : β -> γ}, Iff (Eq.{imax u3 u1} (α -> γ) (Function.comp.{u3, u2, u1} α β γ g₁ f) (Function.comp.{u3, u2, u1} α β γ g₂ f)) (Eq.{imax u2 u1} (β -> γ) g₁ g₂))
-Case conversion may be inaccurate. Consider using '#align function.surjective.right_cancellable Function.Surjective.right_cancellableₓ'. -/
 protected theorem Surjective.right_cancellable (hf : Surjective f) {g₁ g₂ : β → γ} :
     g₁ ∘ f = g₂ ∘ f ↔ g₁ = g₂ :=
   hf.injective_comp_right.eq_iff
 #align function.surjective.right_cancellable Function.Surjective.right_cancellable
 
-/- warning: function.surjective_of_right_cancellable_Prop -> Function.surjective_of_right_cancellable_Prop is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (forall (g₁ : β -> Prop) (g₂ : β -> Prop), (Eq.{max u1 1} (α -> Prop) (Function.comp.{u1, u2, 1} α β Prop g₁ f) (Function.comp.{u1, u2, 1} α β Prop g₂ f)) -> (Eq.{max u2 1} (β -> Prop) g₁ g₂)) -> (Function.Surjective.{u1, u2} α β f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (forall (g₁ : β -> Prop) (g₂ : β -> Prop), (Eq.{max 1 u2} (α -> Prop) (Function.comp.{u2, u1, 1} α β Prop g₁ f) (Function.comp.{u2, u1, 1} α β Prop g₂ f)) -> (Eq.{max 1 u1} (β -> Prop) g₁ g₂)) -> (Function.Surjective.{u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.surjective_of_right_cancellable_Prop Function.surjective_of_right_cancellable_Propₓ'. -/
 theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g₁ ∘ f = g₂ ∘ f → g₁ = g₂) :
     Surjective f :=
   by
@@ -462,12 +277,6 @@ theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g
     rw [← this]; exact trivial
 #align function.surjective_of_right_cancellable_Prop Function.surjective_of_right_cancellable_Prop
 
-/- warning: function.bijective_iff_exists_unique -> Function.bijective_iff_existsUnique is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} (f : α -> β), Iff (Function.Bijective.{u1, u2} α β f) (forall (b : β), ExistsUnique.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} (f : α -> β), Iff (Function.Bijective.{u2, u1} α β f) (forall (b : β), ExistsUnique.{u2} α (fun (a : α) => Eq.{u1} β (f a) b))
-Case conversion may be inaccurate. Consider using '#align function.bijective_iff_exists_unique Function.bijective_iff_existsUniqueₓ'. -/
 theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β, ∃! a : α, f a = b :=
   ⟨fun hf b =>
     let ⟨a, ha⟩ := hf.Surjective b
@@ -476,24 +285,12 @@ theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β,
     ⟨fun a a' h => ExistsUnique.unique (he (f a')) h rfl, fun b => ExistsUnique.exists (he b)⟩⟩
 #align function.bijective_iff_exists_unique Function.bijective_iff_existsUnique
 
-/- warning: function.bijective.exists_unique -> Function.Bijective.existsUnique is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (forall (b : β), ExistsUnique.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u2, u1} α β f) -> (forall (b : β), ExistsUnique.{u2} α (fun (a : α) => Eq.{u1} β (f a) b))
-Case conversion may be inaccurate. Consider using '#align function.bijective.exists_unique Function.Bijective.existsUniqueₓ'. -/
 /-- Shorthand for using projection notation with `function.bijective_iff_exists_unique`. -/
 protected theorem Bijective.existsUnique {f : α → β} (hf : Bijective f) (b : β) :
     ∃! a : α, f a = b :=
   (bijective_iff_existsUnique f).mp hf b
 #align function.bijective.exists_unique Function.Bijective.existsUnique
 
-/- warning: function.bijective.exists_unique_iff -> Function.Bijective.existsUnique_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (forall {p : β -> Prop}, Iff (ExistsUnique.{u2} β (fun (y : β) => p y)) (ExistsUnique.{u1} α (fun (x : α) => p (f x))))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u2, u1} α β f) -> (forall {p : β -> Prop}, Iff (ExistsUnique.{u1} β (fun (y : β) => p y)) (ExistsUnique.{u2} α (fun (x : α) => p (f x))))
-Case conversion may be inaccurate. Consider using '#align function.bijective.exists_unique_iff Function.Bijective.existsUnique_iffₓ'. -/
 theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β → Prop} :
     (∃! y, p y) ↔ ∃! x, p (f x) :=
   ⟨fun ⟨y, hpy, hy⟩ =>
@@ -505,23 +302,11 @@ theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β 
       hz ▸ congr_arg f <| hx _ <| by rwa [hz]⟩⟩
 #align function.bijective.exists_unique_iff Function.Bijective.existsUnique_iff
 
-/- warning: function.bijective.of_comp_iff -> Function.Bijective.of_comp_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Bijective.{u3, u1} γ α g) -> (Iff (Function.Bijective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Bijective.{u1, u2} α β f))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} (f : α -> β) {g : γ -> α}, (Function.Bijective.{u3, u2} γ α g) -> (Iff (Function.Bijective.{u3, u1} γ β (Function.comp.{u3, u2, u1} γ α β f g)) (Function.Bijective.{u2, u1} α β f))
-Case conversion may be inaccurate. Consider using '#align function.bijective.of_comp_iff Function.Bijective.of_comp_iffₓ'. -/
 theorem Bijective.of_comp_iff (f : α → β) {g : γ → α} (hg : Bijective g) :
     Bijective (f ∘ g) ↔ Bijective f :=
   and_congr (Injective.of_comp_iff' _ hg) (Surjective.of_comp_iff _ hg.Surjective)
 #align function.bijective.of_comp_iff Function.Bijective.of_comp_iff
 
-/- warning: function.bijective.of_comp_iff' -> Function.Bijective.of_comp_iff' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Bijective.{u3, u2} γ β (Function.comp.{u3, u1, u2} γ α β f g)) (Function.Bijective.{u3, u1} γ α g))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u3, u2} α β f) -> (forall (g : γ -> α), Iff (Function.Bijective.{u1, u2} γ β (Function.comp.{u1, u3, u2} γ α β f g)) (Function.Bijective.{u1, u3} γ α g))
-Case conversion may be inaccurate. Consider using '#align function.bijective.of_comp_iff' Function.Bijective.of_comp_iff'ₓ'. -/
 theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α) :
     Function.Bijective (f ∘ g) ↔ Function.Bijective g :=
   and_congr (Injective.of_comp_iff hf.Injective _) (Surjective.of_comp_iff' hf _)
@@ -574,32 +359,14 @@ def IsPartialInv {α β} (f : α → β) (g : β → Option α) : Prop :=
 #align function.is_partial_inv Function.IsPartialInv
 -/
 
-/- warning: function.is_partial_inv_left -> Function.isPartialInv_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Sort.{u2}} {f : α -> β} {g : β -> (Option.{u1} α)}, (Function.IsPartialInv.{u1, u2} α β f g) -> (forall (x : α), Eq.{succ u1} (Option.{u1} α) (g (f x)) (Option.some.{u1} α x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Sort.{u1}} {f : α -> β} {g : β -> (Option.{u2} α)}, (Function.IsPartialInv.{u2, u1} α β f g) -> (forall (x : α), Eq.{succ u2} (Option.{u2} α) (g (f x)) (Option.some.{u2} α x))
-Case conversion may be inaccurate. Consider using '#align function.is_partial_inv_left Function.isPartialInv_leftₓ'. -/
 theorem isPartialInv_left {α β} {f : α → β} {g} (H : IsPartialInv f g) (x) : g (f x) = some x :=
   (H _ _).2 rfl
 #align function.is_partial_inv_left Function.isPartialInv_left
 
-/- warning: function.injective_of_partial_inv -> Function.injective_of_isPartialInv is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Sort.{u2}} {f : α -> β} {g : β -> (Option.{u1} α)}, (Function.IsPartialInv.{u1, u2} α β f g) -> (Function.Injective.{succ u1, u2} α β f)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Sort.{u1}} {f : α -> β} {g : β -> (Option.{u2} α)}, (Function.IsPartialInv.{u2, u1} α β f g) -> (Function.Injective.{succ u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.injective_of_partial_inv Function.injective_of_isPartialInvₓ'. -/
 theorem injective_of_isPartialInv {α β} {f : α → β} {g} (H : IsPartialInv f g) : Injective f :=
   fun a b h => Option.some.inj <| ((H _ _).2 h).symm.trans ((H _ _).2 rfl)
 #align function.injective_of_partial_inv Function.injective_of_isPartialInv
 
-/- warning: function.injective_of_partial_inv_right -> Function.injective_of_isPartialInv_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Sort.{u2}} {f : α -> β} {g : β -> (Option.{u1} α)}, (Function.IsPartialInv.{u1, u2} α β f g) -> (forall (x : β) (y : β) (b : α), (Membership.Mem.{u1, u1} α (Option.{u1} α) (Option.hasMem.{u1} α) b (g x)) -> (Membership.Mem.{u1, u1} α (Option.{u1} α) (Option.hasMem.{u1} α) b (g y)) -> (Eq.{u2} β x y))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Sort.{u1}} {f : α -> β} {g : β -> (Option.{u2} α)}, (Function.IsPartialInv.{u2, u1} α β f g) -> (forall (x : β) (y : β) (b : α), (Membership.mem.{u2, u2} α (Option.{u2} α) (Option.instMembershipOption.{u2} α) b (g x)) -> (Membership.mem.{u2, u2} α (Option.{u2} α) (Option.instMembershipOption.{u2} α) b (g y)) -> (Eq.{u1} β x y))
-Case conversion may be inaccurate. Consider using '#align function.injective_of_partial_inv_right Function.injective_of_isPartialInv_rightₓ'. -/
 theorem injective_of_isPartialInv_right {α β} {f : α → β} {g} (H : IsPartialInv f g) (x y b)
     (h₁ : b ∈ g x) (h₂ : b ∈ g y) : x = y :=
   ((H _ _).1 h₁).symm.trans ((H _ _).1 h₂)
@@ -629,44 +396,20 @@ theorem rightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g
 #align function.right_inverse_iff_comp Function.rightInverse_iff_comp
 -/
 
-/- warning: function.left_inverse.comp -> Function.LeftInverse.comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {g : β -> α} {h : β -> γ} {i : γ -> β}, (Function.LeftInverse.{u2, u1} β α f g) -> (Function.LeftInverse.{u3, u2} γ β h i) -> (Function.LeftInverse.{u3, u1} γ α (Function.comp.{u1, u2, u3} α β γ h f) (Function.comp.{u3, u2, u1} γ β α g i))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : Sort.{u1}} {f : α -> β} {g : β -> α} {h : β -> γ} {i : γ -> β}, (Function.LeftInverse.{u3, u2} β α f g) -> (Function.LeftInverse.{u1, u3} γ β h i) -> (Function.LeftInverse.{u1, u2} γ α (Function.comp.{u2, u3, u1} α β γ h f) (Function.comp.{u1, u3, u2} γ β α g i))
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.comp Function.LeftInverse.compₓ'. -/
 theorem LeftInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : LeftInverse f g)
     (hh : LeftInverse h i) : LeftInverse (h ∘ f) (g ∘ i) := fun a =>
   show h (f (g (i a))) = a by rw [hf (i a), hh a]
 #align function.left_inverse.comp Function.LeftInverse.comp
 
-/- warning: function.right_inverse.comp -> Function.RightInverse.comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {g : β -> α} {h : β -> γ} {i : γ -> β}, (Function.RightInverse.{u2, u1} β α f g) -> (Function.RightInverse.{u3, u2} γ β h i) -> (Function.RightInverse.{u3, u1} γ α (Function.comp.{u1, u2, u3} α β γ h f) (Function.comp.{u3, u2, u1} γ β α g i))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : Sort.{u1}} {f : α -> β} {g : β -> α} {h : β -> γ} {i : γ -> β}, (Function.RightInverse.{u3, u2} β α f g) -> (Function.RightInverse.{u1, u3} γ β h i) -> (Function.RightInverse.{u1, u2} γ α (Function.comp.{u2, u3, u1} α β γ h f) (Function.comp.{u1, u3, u2} γ β α g i))
-Case conversion may be inaccurate. Consider using '#align function.right_inverse.comp Function.RightInverse.compₓ'. -/
 theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : RightInverse f g)
     (hh : RightInverse h i) : RightInverse (h ∘ f) (g ∘ i) :=
   LeftInverse.comp hh hf
 #align function.right_inverse.comp Function.RightInverse.comp
 
-/- warning: function.left_inverse.right_inverse -> Function.LeftInverse.rightInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {g : β -> α}, (Function.LeftInverse.{u1, u2} α β g f) -> (Function.RightInverse.{u2, u1} β α f g)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {g : β -> α}, (Function.LeftInverse.{u2, u1} α β g f) -> (Function.RightInverse.{u1, u2} β α f g)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.right_inverse Function.LeftInverse.rightInverseₓ'. -/
 theorem LeftInverse.rightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) : RightInverse f g :=
   h
 #align function.left_inverse.right_inverse Function.LeftInverse.rightInverse
 
-/- warning: function.right_inverse.left_inverse -> Function.RightInverse.leftInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {g : β -> α}, (Function.RightInverse.{u1, u2} α β g f) -> (Function.LeftInverse.{u2, u1} β α f g)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {g : β -> α}, (Function.RightInverse.{u2, u1} α β g f) -> (Function.LeftInverse.{u1, u2} β α f g)
-Case conversion may be inaccurate. Consider using '#align function.right_inverse.left_inverse Function.RightInverse.leftInverseₓ'. -/
 theorem RightInverse.leftInverse {f : α → β} {g : β → α} (h : RightInverse g f) : LeftInverse f g :=
   h
 #align function.right_inverse.left_inverse Function.RightInverse.leftInverse
@@ -711,12 +454,6 @@ theorem RightInverse.leftInverse_of_injective {f : α → β} {g : β → α} :
 #align function.right_inverse.left_inverse_of_injective Function.RightInverse.leftInverse_of_injective
 -/
 
-/- warning: function.left_inverse.eq_right_inverse -> Function.LeftInverse.eq_rightInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {f : α -> β} {g₁ : β -> α} {g₂ : β -> α}, (Function.LeftInverse.{u1, u2} α β g₁ f) -> (Function.RightInverse.{u1, u2} α β g₂ f) -> (Eq.{imax u2 u1} (β -> α) g₁ g₂)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {f : α -> β} {g₁ : β -> α} {g₂ : β -> α}, (Function.LeftInverse.{u2, u1} α β g₁ f) -> (Function.RightInverse.{u2, u1} α β g₂ f) -> (Eq.{imax u1 u2} (β -> α) g₁ g₂)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverseₓ'. -/
 theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
     (h₂ : RightInverse g₂ f) : g₁ = g₂ :=
   calc
@@ -735,12 +472,6 @@ noncomputable def partialInv {α β} (f : α → β) (b : β) : Option α :=
 #align function.partial_inv Function.partialInv
 -/
 
-/- warning: function.partial_inv_of_injective -> Function.partialInv_of_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{succ u1, u2} α β f) -> (Function.IsPartialInv.{u1, u2} α β f (Function.partialInv.{u1, u2} α β f))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{succ u2, u1} α β f) -> (Function.IsPartialInv.{u2, u1} α β f (Function.partialInv.{u2, u1} α β f))
-Case conversion may be inaccurate. Consider using '#align function.partial_inv_of_injective Function.partialInv_of_injectiveₓ'. -/
 theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPartialInv f (partialInv f)
   | a, b =>
     ⟨fun h =>
@@ -755,12 +486,6 @@ theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPa
         (dif_pos h).trans (congr_arg _ (I <| Classical.choose_spec h))⟩
 #align function.partial_inv_of_injective Function.partialInv_of_injective
 
-/- warning: function.partial_inv_left -> Function.partialInv_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Sort.{u2}} {f : α -> β}, (Function.Injective.{succ u1, u2} α β f) -> (forall (x : α), Eq.{succ u1} (Option.{u1} α) (Function.partialInv.{u1, u2} α β f (f x)) (Option.some.{u1} α x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Sort.{u1}} {f : α -> β}, (Function.Injective.{succ u2, u1} α β f) -> (forall (x : α), Eq.{succ u2} (Option.{u2} α) (Function.partialInv.{u2, u1} α β f (f x)) (Option.some.{u2} α x))
-Case conversion may be inaccurate. Consider using '#align function.partial_inv_left Function.partialInv_leftₓ'. -/
 theorem partialInv_left {α β} {f : α → β} (I : Injective f) : ∀ x, partialInv f (f x) = some x :=
   isPartialInv_left (partialInv_of_injective I)
 #align function.partial_inv_left Function.partialInv_left
@@ -781,93 +506,39 @@ noncomputable def invFun (f : α → β) : β → α := fun y =>
 #align function.inv_fun Function.invFun
 -/
 
-/- warning: function.inv_fun_eq -> Function.invFun_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β} {b : β}, (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b)) -> (Eq.{u2} β (f (Function.invFun.{u1, u2} α β _inst_1 f b)) b)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β} {b : β}, (Exists.{u2} α (fun (a : α) => Eq.{u1} β (f a) b)) -> (Eq.{u1} β (f (Function.invFun.{u2, u1} α β _inst_1 f b)) b)
-Case conversion may be inaccurate. Consider using '#align function.inv_fun_eq Function.invFun_eqₓ'. -/
 theorem invFun_eq (h : ∃ a, f a = b) : f (invFun f b) = b := by
   simp only [inv_fun, dif_pos h, h.some_spec]
 #align function.inv_fun_eq Function.invFun_eq
 
-/- warning: function.inv_fun_neg -> Function.invFun_neg is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β} {b : β}, (Not (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))) -> (Eq.{u1} α (Function.invFun.{u1, u2} α β _inst_1 f b) (Classical.choice.{u1} α _inst_1))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β} {b : β}, (Not (Exists.{u2} α (fun (a : α) => Eq.{u1} β (f a) b))) -> (Eq.{u2} α (Function.invFun.{u2, u1} α β _inst_1 f b) (Classical.choice.{u2} α _inst_1))
-Case conversion may be inaccurate. Consider using '#align function.inv_fun_neg Function.invFun_negₓ'. -/
 theorem invFun_neg (h : ¬∃ a, f a = b) : invFun f b = Classical.choice ‹_› :=
   dif_neg h
 #align function.inv_fun_neg Function.invFun_neg
 
-/- warning: function.inv_fun_eq_of_injective_of_right_inverse -> Function.invFun_eq_of_injective_of_rightInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β} {g : β -> α}, (Function.Injective.{u1, u2} α β f) -> (Function.RightInverse.{u1, u2} α β g f) -> (Eq.{imax u2 u1} (β -> α) (Function.invFun.{u1, u2} α β _inst_1 f) g)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β} {g : β -> α}, (Function.Injective.{u2, u1} α β f) -> (Function.RightInverse.{u2, u1} α β g f) -> (Eq.{imax u1 u2} (β -> α) (Function.invFun.{u2, u1} α β _inst_1 f) g)
-Case conversion may be inaccurate. Consider using '#align function.inv_fun_eq_of_injective_of_right_inverse Function.invFun_eq_of_injective_of_rightInverseₓ'. -/
 theorem invFun_eq_of_injective_of_rightInverse {g : β → α} (hf : Injective f)
     (hg : RightInverse g f) : invFun f = g :=
   funext fun b => hf (by rw [hg b]; exact inv_fun_eq ⟨g b, hg b⟩)
 #align function.inv_fun_eq_of_injective_of_right_inverse Function.invFun_eq_of_injective_of_rightInverse
 
-/- warning: function.right_inverse_inv_fun -> Function.rightInverse_invFun is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, (Function.Surjective.{u1, u2} α β f) -> (Function.RightInverse.{u1, u2} α β (Function.invFun.{u1, u2} α β _inst_1 f) f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, (Function.Surjective.{u2, u1} α β f) -> (Function.RightInverse.{u2, u1} α β (Function.invFun.{u2, u1} α β _inst_1 f) f)
-Case conversion may be inaccurate. Consider using '#align function.right_inverse_inv_fun Function.rightInverse_invFunₓ'. -/
 theorem rightInverse_invFun (hf : Surjective f) : RightInverse (invFun f) f := fun b =>
   invFun_eq <| hf b
 #align function.right_inverse_inv_fun Function.rightInverse_invFun
 
-/- warning: function.left_inverse_inv_fun -> Function.leftInverse_invFun is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (Function.LeftInverse.{u1, u2} α β (Function.invFun.{u1, u2} α β _inst_1 f) f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (Function.LeftInverse.{u2, u1} α β (Function.invFun.{u2, u1} α β _inst_1 f) f)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse_inv_fun Function.leftInverse_invFunₓ'. -/
 theorem leftInverse_invFun (hf : Injective f) : LeftInverse (invFun f) f := fun b =>
   hf <| invFun_eq ⟨b, rfl⟩
 #align function.left_inverse_inv_fun Function.leftInverse_invFun
 
-/- warning: function.inv_fun_surjective -> Function.invFun_surjective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (Function.Surjective.{u2, u1} β α (Function.invFun.{u1, u2} α β _inst_1 f))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (Function.Surjective.{u1, u2} β α (Function.invFun.{u2, u1} α β _inst_1 f))
-Case conversion may be inaccurate. Consider using '#align function.inv_fun_surjective Function.invFun_surjectiveₓ'. -/
 theorem invFun_surjective (hf : Injective f) : Surjective (invFun f) :=
   (leftInverse_invFun hf).Surjective
 #align function.inv_fun_surjective Function.invFun_surjective
 
-/- warning: function.inv_fun_comp -> Function.invFun_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (Eq.{u1} (α -> α) (Function.comp.{u1, u2, u1} α β α (Function.invFun.{u1, u2} α β _inst_1 f) f) (id.{u1} α))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (Eq.{u2} (α -> α) (Function.comp.{u2, u1, u2} α β α (Function.invFun.{u2, u1} α β _inst_1 f) f) (id.{u2} α))
-Case conversion may be inaccurate. Consider using '#align function.inv_fun_comp Function.invFun_compₓ'. -/
 theorem invFun_comp (hf : Injective f) : invFun f ∘ f = id :=
   funext <| leftInverse_invFun hf
 #align function.inv_fun_comp Function.invFun_comp
 
-/- warning: function.injective.has_left_inverse -> Function.Injective.hasLeftInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (Function.HasLeftInverse.{u1, u2} α β f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, (Function.Injective.{u2, u1} α β f) -> (Function.HasLeftInverse.{u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.injective.has_left_inverse Function.Injective.hasLeftInverseₓ'. -/
 theorem Injective.hasLeftInverse (hf : Injective f) : HasLeftInverse f :=
   ⟨invFun f, leftInverse_invFun hf⟩
 #align function.injective.has_left_inverse Function.Injective.hasLeftInverse
 
-/- warning: function.injective_iff_has_left_inverse -> Function.injective_iff_hasLeftInverse is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} [_inst_1 : Nonempty.{u1} α] {f : α -> β}, Iff (Function.Injective.{u1, u2} α β f) (Function.HasLeftInverse.{u1, u2} α β f)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} [_inst_1 : Nonempty.{u2} α] {f : α -> β}, Iff (Function.Injective.{u2, u1} α β f) (Function.HasLeftInverse.{u2, u1} α β f)
-Case conversion may be inaccurate. Consider using '#align function.injective_iff_has_left_inverse Function.injective_iff_hasLeftInverseₓ'. -/
 theorem injective_iff_hasLeftInverse : Injective f ↔ HasLeftInverse f :=
   ⟨Injective.hasLeftInverse, HasLeftInverse.injective⟩
 #align function.injective_iff_has_left_inverse Function.injective_iff_hasLeftInverse
@@ -967,12 +638,6 @@ def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
 #align function.update Function.update
 -/
 
-/- warning: function.update_apply -> Function.update_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} [_inst_1 : DecidableEq.{u1} α] {β : Sort.{u2}} (f : α -> β) (a' : α) (b : β) (a : α), Eq.{u2} β (Function.update.{u1, u2} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) f a' b a) (ite.{u2} β (Eq.{u1} α a a') (_inst_1 a a') b (f a))
-but is expected to have type
-  forall {α : Sort.{u2}} [_inst_1 : DecidableEq.{u2} α] {β : Sort.{u1}} (f : α -> β) (a' : α) (b : β) (a : α), Eq.{u1} β (Function.update.{u2, u1} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) f a' b a) (ite.{u1} β (Eq.{u2} α a a') (_inst_1 a a') b (f a))
-Case conversion may be inaccurate. Consider using '#align function.update_apply Function.update_applyₓ'. -/
 /-- On non-dependent functions, `function.update` can be expressed as an `ite` -/
 theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
     update f a' b a = if a = a' then b else f a :=
@@ -1076,23 +741,11 @@ theorem update_eq_self (a : α) (f : ∀ a, β a) : update f a (f a) = f :=
 #align function.update_eq_self Function.update_eq_self
 -/
 
-/- warning: function.update_comp_eq_of_forall_ne' -> Function.update_comp_eq_of_forall_ne' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : α -> Sort.{u2}} [_inst_1 : DecidableEq.{u1} α] {α' : Sort.{u3}} (g : forall (a : α), β a) {f : α' -> α} {i : α} (a : β i), (forall (x : α'), Ne.{u1} α (f x) i) -> (Eq.{imax u3 u2} (forall (j : α'), (fun (a : α) => β a) (f j)) (fun (j : α') => Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_1 a b) g i a (f j)) (fun (j : α') => g (f j)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : α -> Sort.{u3}} [_inst_1 : DecidableEq.{u2} α] {α' : Sort.{u1}} (g : forall (a : α), β a) {f : α' -> α} {i : α} (a : β i), (forall (x : α'), Ne.{u2} α (f x) i) -> (Eq.{imax u1 u3} (forall (j : α'), β (f j)) (fun (j : α') => Function.update.{u2, u3} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_1 a b) g i a (f j)) (fun (j : α') => g (f j)))
-Case conversion may be inaccurate. Consider using '#align function.update_comp_eq_of_forall_ne' Function.update_comp_eq_of_forall_ne'ₓ'. -/
 theorem update_comp_eq_of_forall_ne' {α'} (g : ∀ a, β a) {f : α' → α} {i : α} (a : β i)
     (h : ∀ x, f x ≠ i) : (fun j => (update g i a) (f j)) = fun j => g (f j) :=
   funext fun x => update_noteq (h _) _ _
 #align function.update_comp_eq_of_forall_ne' Function.update_comp_eq_of_forall_ne'
 
-/- warning: function.update_comp_eq_of_forall_ne -> Function.update_comp_eq_of_forall_ne is a dubious translation:
-lean 3 declaration is
-  forall {α' : Sort.{u1}} [_inst_2 : DecidableEq.{u1} α'] {α : Sort.{u2}} {β : Sort.{u3}} (g : α' -> β) {f : α -> α'} {i : α'} (a : β), (forall (x : α), Ne.{u1} α' (f x) i) -> (Eq.{imax u2 u3} (α -> β) (Function.comp.{u2, u1, u3} α α' β (Function.update.{u1, u3} α' (fun (ᾰ : α') => β) (fun (a : α') (b : α') => _inst_2 a b) g i a) f) (Function.comp.{u2, u1, u3} α α' β g f))
-but is expected to have type
-  forall {α' : Sort.{u3}} [_inst_2 : DecidableEq.{u3} α'] {α : Sort.{u2}} {β : Sort.{u1}} (g : α' -> β) {f : α -> α'} {i : α'} (a : β), (forall (x : α), Ne.{u3} α' (f x) i) -> (Eq.{imax u2 u1} (α -> β) (Function.comp.{u2, u3, u1} α α' β (Function.update.{u3, u1} α' (fun (ᾰ : α') => β) (fun (a : α') (b : α') => _inst_2 a b) g i a) f) (Function.comp.{u2, u3, u1} α α' β g f))
-Case conversion may be inaccurate. Consider using '#align function.update_comp_eq_of_forall_ne Function.update_comp_eq_of_forall_neₓ'. -/
 /-- Non-dependent version of `function.update_comp_eq_of_forall_ne'` -/
 theorem update_comp_eq_of_forall_ne {α β : Sort _} (g : α' → β) {f : α → α'} {i : α'} (a : β)
     (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f :=
@@ -1106,12 +759,6 @@ theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Fu
 #align function.update_comp_eq_of_injective' Function.update_comp_eq_of_injective'
 -/
 
-/- warning: function.update_comp_eq_of_injective -> Function.update_comp_eq_of_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {α' : Sort.{u2}} [_inst_1 : DecidableEq.{u1} α] [_inst_2 : DecidableEq.{u2} α'] {β : Sort.{u3}} (g : α' -> β) {f : α -> α'}, (Function.Injective.{u1, u2} α α' f) -> (forall (i : α) (a : β), Eq.{imax u1 u3} (α -> β) (Function.comp.{u1, u2, u3} α α' β (Function.update.{u2, u3} α' (fun (ᾰ : α') => β) (fun (a : α') (b : α') => _inst_2 a b) g (f i) a) f) (Function.update.{u1, u3} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) (Function.comp.{u1, u2, u3} α α' β g f) i a))
-but is expected to have type
-  forall {α : Sort.{u2}} {α' : Sort.{u3}} [_inst_1 : DecidableEq.{u2} α] [_inst_2 : DecidableEq.{u3} α'] {β : Sort.{u1}} (g : α' -> β) {f : α -> α'}, (Function.Injective.{u2, u3} α α' f) -> (forall (i : α) (a : β), Eq.{imax u2 u1} (α -> β) (Function.comp.{u2, u3, u1} α α' β (Function.update.{u3, u1} α' (fun (ᾰ : α') => β) (fun (a : α') (b : α') => _inst_2 a b) g (f i) a) f) (Function.update.{u2, u1} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) (Function.comp.{u2, u3, u1} α α' β g f) i a))
-Case conversion may be inaccurate. Consider using '#align function.update_comp_eq_of_injective Function.update_comp_eq_of_injectiveₓ'. -/
 /-- Non-dependent version of `function.update_comp_eq_of_injective'` -/
 theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → α'}
     (hf : Function.Injective f) (i : α) (a : β) :
@@ -1119,12 +766,6 @@ theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → 
   update_comp_eq_of_injective' g hf i a
 #align function.update_comp_eq_of_injective Function.update_comp_eq_of_injective
 
-/- warning: function.apply_update -> Function.apply_update is a dubious translation:
-lean 3 declaration is
-  forall {ι : Sort.{u1}} [_inst_3 : DecidableEq.{u1} ι] {α : ι -> Sort.{u2}} {β : ι -> Sort.{u3}} (f : forall (i : ι), (α i) -> (β i)) (g : forall (i : ι), α i) (i : ι) (v : α i) (j : ι), Eq.{u3} (β j) (f j (Function.update.{u1, u2} ι α (fun (a : ι) (b : ι) => _inst_3 a b) g i v j)) (Function.update.{u1, u3} ι β (fun (a : ι) (b : ι) => _inst_3 a b) (fun (k : ι) => f k (g k)) i (f i v) j)
-but is expected to have type
-  forall {ι : Sort.{u3}} [_inst_3 : DecidableEq.{u3} ι] {α : ι -> Sort.{u2}} {β : ι -> Sort.{u1}} (f : forall (i : ι), (α i) -> (β i)) (g : forall (i : ι), α i) (i : ι) (v : α i) (j : ι), Eq.{u1} (β j) (f j (Function.update.{u3, u2} ι (fun (a : ι) => α a) (fun (a : ι) (b : ι) => _inst_3 a b) g i v j)) (Function.update.{u3, u1} ι (fun (k : ι) => β k) (fun (a : ι) (b : ι) => _inst_3 a b) (fun (k : ι) => f k (g k)) i (f i v) j)
-Case conversion may be inaccurate. Consider using '#align function.apply_update Function.apply_updateₓ'. -/
 theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f : ∀ i, α i → β i)
     (g : ∀ i, α i) (i : ι) (v : α i) (j : ι) :
     f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j :=
@@ -1134,12 +775,6 @@ theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f :
   · simp [h]
 #align function.apply_update Function.apply_update
 
-/- warning: function.apply_update₂ -> Function.apply_update₂ is a dubious translation:
-lean 3 declaration is
-  forall {ι : Sort.{u1}} [_inst_3 : DecidableEq.{u1} ι] {α : ι -> Sort.{u2}} {β : ι -> Sort.{u3}} {γ : ι -> Sort.{u4}} (f : forall (i : ι), (α i) -> (β i) -> (γ i)) (g : forall (i : ι), α i) (h : forall (i : ι), β i) (i : ι) (v : α i) (w : β i) (j : ι), Eq.{u4} (γ j) (f j (Function.update.{u1, u2} ι α (fun (a : ι) (b : ι) => _inst_3 a b) g i v j) (Function.update.{u1, u3} ι β (fun (a : ι) (b : ι) => _inst_3 a b) h i w j)) (Function.update.{u1, u4} ι γ (fun (a : ι) (b : ι) => _inst_3 a b) (fun (k : ι) => f k (g k) (h k)) i (f i v w) j)
-but is expected to have type
-  forall {ι : Sort.{u4}} [_inst_3 : DecidableEq.{u4} ι] {α : ι -> Sort.{u3}} {β : ι -> Sort.{u2}} {γ : ι -> Sort.{u1}} (f : forall (i : ι), (α i) -> (β i) -> (γ i)) (g : forall (i : ι), α i) (h : forall (i : ι), β i) (i : ι) (v : α i) (w : β i) (j : ι), Eq.{u1} (γ j) (f j (Function.update.{u4, u3} ι (fun (a : ι) => α a) (fun (a : ι) (b : ι) => _inst_3 a b) g i v j) (Function.update.{u4, u2} ι (fun (a : ι) => β a) (fun (a : ι) (b : ι) => _inst_3 a b) h i w j)) (Function.update.{u4, u1} ι (fun (k : ι) => γ k) (fun (a : ι) (b : ι) => _inst_3 a b) (fun (k : ι) => f k (g k) (h k)) i (f i v w) j)
-Case conversion may be inaccurate. Consider using '#align function.apply_update₂ Function.apply_update₂ₓ'. -/
 theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _} (f : ∀ i, α i → β i → γ i)
     (g : ∀ i, α i) (h : ∀ i, β i) (i : ι) (v : α i) (w : β i) (j : ι) :
     f j (update g i v j) (update h i w j) = update (fun k => f k (g k) (h k)) i (f i v w) j :=
@@ -1149,23 +784,11 @@ theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _
   · simp [h]
 #align function.apply_update₂ Function.apply_update₂
 
-/- warning: function.comp_update -> Function.comp_update is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} [_inst_1 : DecidableEq.{u1} α] {α' : Sort.{u2}} {β : Sort.{u3}} (f : α' -> β) (g : α -> α') (i : α) (v : α'), Eq.{imax u1 u3} (α -> β) (Function.comp.{u1, u2, u3} α α' β f (Function.update.{u1, u2} α (fun (ᾰ : α) => α') (fun (a : α) (b : α) => _inst_1 a b) g i v)) (Function.update.{u1, u3} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) (Function.comp.{u1, u2, u3} α α' β f g) i (f v))
-but is expected to have type
-  forall {α : Sort.{u3}} [_inst_1 : DecidableEq.{u3} α] {α' : Sort.{u2}} {β : Sort.{u1}} (f : α' -> β) (g : α -> α') (i : α) (v : α'), Eq.{imax u3 u1} (α -> β) (Function.comp.{u3, u2, u1} α α' β f (Function.update.{u3, u2} α (fun (ᾰ : α) => α') (fun (a : α) (b : α) => _inst_1 a b) g i v)) (Function.update.{u3, u1} α (fun (ᾰ : α) => β) (fun (a : α) (b : α) => _inst_1 a b) (Function.comp.{u3, u2, u1} α α' β f g) i (f v))
-Case conversion may be inaccurate. Consider using '#align function.comp_update Function.comp_updateₓ'. -/
 theorem comp_update {α' : Sort _} {β : Sort _} (f : α' → β) (g : α → α') (i : α) (v : α') :
     f ∘ update g i v = update (f ∘ g) i (f v) :=
   funext <| apply_update _ _ _ _
 #align function.comp_update Function.comp_update
 
-/- warning: function.update_comm -> Function.update_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} [_inst_3 : DecidableEq.{u1} α] {β : α -> Sort.{u2}} {a : α} {b : α}, (Ne.{u1} α a b) -> (forall (v : β a) (w : β b) (f : forall (a : α), β a), Eq.{imax u1 u2} (forall (a : α), β a) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a v) b w) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f b w) a v))
-but is expected to have type
-  forall {α : Sort.{u2}} [_inst_3 : DecidableEq.{u2} α] {β : α -> Sort.{u1}} {a : α} {b : α}, (Ne.{u2} α a b) -> (forall (v : β a) (w : β b) (f : forall (a : α), β a), Eq.{imax u2 u1} (forall (a : α), β a) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a v) b w) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f b w) a v))
-Case conversion may be inaccurate. Consider using '#align function.update_comm Function.update_commₓ'. -/
 theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
     (f : ∀ a, β a) : update (update f a v) b w = update (update f b w) a v :=
   by
@@ -1174,12 +797,6 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a
   cases h (h₂.symm.trans h₁)
 #align function.update_comm Function.update_comm
 
-/- warning: function.update_idem -> Function.update_idem is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} [_inst_3 : DecidableEq.{u1} α] {β : α -> Sort.{u2}} {a : α} (v : β a) (w : β a) (f : forall (a : α), β a), Eq.{imax u1 u2} (forall (a : α), β a) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a v) a w) (Function.update.{u1, u2} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a w)
-but is expected to have type
-  forall {α : Sort.{u2}} [_inst_3 : DecidableEq.{u2} α] {β : α -> Sort.{u1}} {a : α} (v : β a) (w : β a) (f : forall (a : α), β a), Eq.{imax u2 u1} (forall (a : α), β a) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a v) a w) (Function.update.{u2, u1} α (fun (a : α) => β a) (fun (a : α) (b : α) => _inst_3 a b) f a w)
-Case conversion may be inaccurate. Consider using '#align function.update_idem Function.update_idemₓ'. -/
 @[simp]
 theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
     update (update f a v) a w = update f a w := by funext b; by_cases b = a <;> simp [update, h]
@@ -1214,33 +831,15 @@ def FactorsThrough (g : α → γ) (f : α → β) : Prop :=
 #align function.factors_through Function.FactorsThrough
 -/
 
-/- warning: function.injective.factors_through -> Function.Injective.FactorsThrough is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall (g : α -> γ), Function.FactorsThrough.{u1, u2, u3} α β γ g f)
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (forall (g : α -> γ), Function.FactorsThrough.{u3, u2, u1} α β γ g f)
-Case conversion may be inaccurate. Consider using '#align function.injective.factors_through Function.Injective.FactorsThroughₓ'. -/
 theorem Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f := fun a b h =>
   congr_arg g (hf h)
 #align function.injective.factors_through Function.Injective.FactorsThrough
 
-/- warning: function.extend_def -> Function.extend_def is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : α -> β) (g : α -> γ) (e' : β -> γ) (b : β) [_inst_1 : Decidable (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))], Eq.{u3} γ (Function.extend.{u1, u2, u3} α β γ f g e' b) (dite.{u3} γ (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b)) _inst_1 (fun (h : Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b)) => g (Classical.choose.{u1} α (fun (a : α) => Eq.{u2} β (f a) b) h)) (fun (h : Not (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))) => e' b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} (f : α -> β) (g : α -> γ) (e' : β -> γ) (b : β) [_inst_1 : Decidable (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b))], Eq.{u1} γ (Function.extend.{u3, u2, u1} α β γ f g e' b) (dite.{u1} γ (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b)) _inst_1 (fun (h : Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b)) => g (Classical.choose.{u3} α (fun (a : α) => Eq.{u2} β (f a) b) h)) (fun (h : Not (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b))) => e' b))
-Case conversion may be inaccurate. Consider using '#align function.extend_def Function.extend_defₓ'. -/
 theorem extend_def (f : α → β) (g : α → γ) (e' : β → γ) (b : β) [Decidable (∃ a, f a = b)] :
     extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b := by unfold extend;
   congr
 #align function.extend_def Function.extend_def
 
-/- warning: function.factors_through.extend_apply -> Function.FactorsThrough.extend_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {g : α -> γ}, (Function.FactorsThrough.{u1, u2, u3} α β γ g f) -> (forall (e' : β -> γ) (a : α), Eq.{u3} γ (Function.extend.{u1, u2, u3} α β γ f g e' (f a)) (g a))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β} {g : α -> γ}, (Function.FactorsThrough.{u3, u2, u1} α β γ g f) -> (forall (e' : β -> γ) (a : α), Eq.{u1} γ (Function.extend.{u3, u2, u1} α β γ f g e' (f a)) (g a))
-Case conversion may be inaccurate. Consider using '#align function.factors_through.extend_apply Function.FactorsThrough.extend_applyₓ'. -/
 theorem FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
   by
@@ -1248,35 +847,17 @@ theorem FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e
   exact hf (Classical.choose_spec (exists_apply_eq_apply f a))
 #align function.factors_through.extend_apply Function.FactorsThrough.extend_apply
 
-/- warning: function.injective.extend_apply -> Function.Injective.extend_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall (g : α -> γ) (e' : β -> γ) (a : α), Eq.{u3} γ (Function.extend.{u1, u2, u3} α β γ f g e' (f a)) (g a))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (forall (g : α -> γ) (e' : β -> γ) (a : α), Eq.{u1} γ (Function.extend.{u3, u2, u1} α β γ f g e' (f a)) (g a))
-Case conversion may be inaccurate. Consider using '#align function.injective.extend_apply Function.Injective.extend_applyₓ'. -/
 @[simp]
 theorem Injective.extend_apply (hf : f.Injective) (g : α → γ) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
   (hf.FactorsThrough g).extend_apply e' a
 #align function.injective.extend_apply Function.Injective.extend_apply
 
-/- warning: function.extend_apply' -> Function.extend_apply' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} (g : α -> γ) (e' : β -> γ) (b : β), (Not (Exists.{u1} α (fun (a : α) => Eq.{u2} β (f a) b))) -> (Eq.{u3} γ (Function.extend.{u1, u2, u3} α β γ f g e' b) (e' b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β} (g : α -> γ) (e' : β -> γ) (b : β), (Not (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b))) -> (Eq.{u1} γ (Function.extend.{u3, u2, u1} α β γ f g e' b) (e' b))
-Case conversion may be inaccurate. Consider using '#align function.extend_apply' Function.extend_apply'ₓ'. -/
 @[simp]
 theorem extend_apply' (g : α → γ) (e' : β → γ) (b : β) (hb : ¬∃ a, f a = b) :
     extend f g e' b = e' b := by simp [Function.extend_def, hb]
 #align function.extend_apply' Function.extend_apply'
 
-/- warning: function.factors_through_iff -> Function.factorsThrough_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} (g : α -> γ) [_inst_1 : Nonempty.{u3} γ], Iff (Function.FactorsThrough.{u1, u2, u3} α β γ g f) (Exists.{imax u2 u3} (β -> γ) (fun (e : β -> γ) => Eq.{imax u1 u3} (α -> γ) g (Function.comp.{u1, u2, u3} α β γ e f)))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} {f : α -> β} (g : α -> γ) [_inst_1 : Nonempty.{u3} γ], Iff (Function.FactorsThrough.{u2, u1, u3} α β γ g f) (Exists.{imax u1 u3} (β -> γ) (fun (e : β -> γ) => Eq.{imax u2 u3} (α -> γ) g (Function.comp.{u2, u1, u3} α β γ e f)))
-Case conversion may be inaccurate. Consider using '#align function.factors_through_iff Function.factorsThrough_iffₓ'. -/
 theorem factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔ ∃ e : β → γ, g = e ∘ f :=
   ⟨fun hf =>
     ⟨extend f g (const β (Classical.arbitrary γ)),
@@ -1284,12 +865,6 @@ theorem factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f 
     fun h a b hf => by rw [Classical.choose_spec h, comp_apply, hf]⟩
 #align function.factors_through_iff Function.factorsThrough_iff
 
-/- warning: function.factors_through.apply_extend -> Function.FactorsThrough.apply_extend is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {δ : Sort.{u4}} {g : α -> γ}, (Function.FactorsThrough.{u1, u2, u3} α β γ g f) -> (forall (F : γ -> δ) (e' : β -> γ) (b : β), Eq.{u4} δ (F (Function.extend.{u1, u2, u3} α β γ f g e' b)) (Function.extend.{u1, u2, u4} α β δ f (Function.comp.{u1, u3, u4} α γ δ F g) (Function.comp.{u2, u3, u4} β γ δ F e') b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β} {δ : Sort.{u4}} {g : α -> γ}, (Function.FactorsThrough.{u3, u2, u1} α β γ g f) -> (forall (F : γ -> δ) (e' : β -> γ) (b : β), Eq.{u4} δ (F (Function.extend.{u3, u2, u1} α β γ f g e' b)) (Function.extend.{u3, u2, u4} α β δ f (Function.comp.{u3, u1, u4} α γ δ F g) (Function.comp.{u2, u1, u4} β γ δ F e') b))
-Case conversion may be inaccurate. Consider using '#align function.factors_through.apply_extend Function.FactorsThrough.apply_extendₓ'. -/
 theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f) (F : γ → δ)
     (e' : β → γ) (b : β) : F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   by
@@ -1301,23 +876,11 @@ theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g
   · rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb]
 #align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
 
-/- warning: function.injective.apply_extend -> Function.Injective.apply_extend is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {δ : Sort.{u4}}, (Function.Injective.{u1, u2} α β f) -> (forall (F : γ -> δ) (g : α -> γ) (e' : β -> γ) (b : β), Eq.{u4} δ (F (Function.extend.{u1, u2, u3} α β γ f g e' b)) (Function.extend.{u1, u2, u4} α β δ f (Function.comp.{u1, u3, u4} α γ δ F g) (Function.comp.{u2, u3, u4} β γ δ F e') b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β} {δ : Sort.{u4}}, (Function.Injective.{u3, u2} α β f) -> (forall (F : γ -> δ) (g : α -> γ) (e' : β -> γ) (b : β), Eq.{u4} δ (F (Function.extend.{u3, u2, u1} α β γ f g e' b)) (Function.extend.{u3, u2, u4} α β δ f (Function.comp.{u3, u1, u4} α γ δ F g) (Function.comp.{u2, u1, u4} β γ δ F e') b))
-Case conversion may be inaccurate. Consider using '#align function.injective.apply_extend Function.Injective.apply_extendₓ'. -/
 theorem Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
     F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   (hf.FactorsThrough g).apply_extend F e' b
 #align function.injective.apply_extend Function.Injective.apply_extend
 
-/- warning: function.extend_injective -> Function.extend_injective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall (e' : β -> γ), Function.Injective.{imax u1 u3, imax u2 u3} (α -> γ) (β -> γ) (fun (g : α -> γ) => Function.extend.{u1, u2, u3} α β γ f g e'))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (forall (e' : β -> γ), Function.Injective.{imax u3 u1, imax u2 u1} (α -> γ) (β -> γ) (fun (g : α -> γ) => Function.extend.{u3, u2, u1} α β γ f g e'))
-Case conversion may be inaccurate. Consider using '#align function.extend_injective Function.extend_injectiveₓ'. -/
 theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g => extend f g e' :=
   by
   intro g₁ g₂ hg
@@ -1327,55 +890,25 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g =
   exact H
 #align function.extend_injective Function.extend_injective
 
-/- warning: function.factors_through.extend_comp -> Function.FactorsThrough.extend_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} {g : α -> γ} (e' : β -> γ), (Function.FactorsThrough.{u1, u2, u3} α β γ g f) -> (Eq.{imax u1 u3} (α -> γ) (Function.comp.{u1, u2, u3} α β γ (Function.extend.{u1, u2, u3} α β γ f g e') f) g)
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β} {g : α -> γ} (e' : β -> γ), (Function.FactorsThrough.{u3, u2, u1} α β γ g f) -> (Eq.{imax u3 u1} (α -> γ) (Function.comp.{u3, u2, u1} α β γ (Function.extend.{u3, u2, u1} α β γ f g e') f) g)
-Case conversion may be inaccurate. Consider using '#align function.factors_through.extend_comp Function.FactorsThrough.extend_compₓ'. -/
 theorem FactorsThrough.extend_comp {g : α → γ} (e' : β → γ) (hf : FactorsThrough g f) :
     extend f g e' ∘ f = g :=
   funext fun a => by simp only [comp_app, hf.extend_apply e']
 #align function.factors_through.extend_comp Function.FactorsThrough.extend_comp
 
-/- warning: function.extend_comp -> Function.extend_comp is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (forall (g : α -> γ) (e' : β -> γ), Eq.{imax u1 u3} (α -> γ) (Function.comp.{u1, u2, u3} α β γ (Function.extend.{u1, u2, u3} α β γ f g e') f) g)
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (forall (g : α -> γ) (e' : β -> γ), Eq.{imax u3 u1} (α -> γ) (Function.comp.{u3, u2, u1} α β γ (Function.extend.{u3, u2, u1} α β γ f g e') f) g)
-Case conversion may be inaccurate. Consider using '#align function.extend_comp Function.extend_compₓ'. -/
 @[simp]
 theorem extend_comp (hf : Injective f) (g : α → γ) (e' : β → γ) : extend f g e' ∘ f = g :=
   (hf.FactorsThrough g).extend_comp e'
 #align function.extend_comp Function.extend_comp
 
-/- warning: function.injective.surjective_comp_right' -> Function.Injective.surjective_comp_right' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Injective.{u1, u2} α β f) -> (β -> γ) -> (Function.Surjective.{imax u2 u3, imax u1 u3} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u1, u2, u3} α β γ g f))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Injective.{u3, u2} α β f) -> (β -> γ) -> (Function.Surjective.{imax u2 u1, imax u3 u1} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u3, u2, u1} α β γ g f))
-Case conversion may be inaccurate. Consider using '#align function.injective.surjective_comp_right' Function.Injective.surjective_comp_right'ₓ'. -/
 theorem Injective.surjective_comp_right' (hf : Injective f) (g₀ : β → γ) :
     Surjective fun g : β → γ => g ∘ f := fun g => ⟨extend f g g₀, extend_comp hf _ _⟩
 #align function.injective.surjective_comp_right' Function.Injective.surjective_comp_right'
 
-/- warning: function.injective.surjective_comp_right -> Function.Injective.surjective_comp_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β} [_inst_1 : Nonempty.{u3} γ], (Function.Injective.{u1, u2} α β f) -> (Function.Surjective.{imax u2 u3, imax u1 u3} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u1, u2, u3} α β γ g f))
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} {f : α -> β} [_inst_1 : Nonempty.{u3} γ], (Function.Injective.{u2, u1} α β f) -> (Function.Surjective.{imax u1 u3, imax u2 u3} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u2, u1, u3} α β γ g f))
-Case conversion may be inaccurate. Consider using '#align function.injective.surjective_comp_right Function.Injective.surjective_comp_rightₓ'. -/
 theorem Injective.surjective_comp_right [Nonempty γ] (hf : Injective f) :
     Surjective fun g : β → γ => g ∘ f :=
   hf.surjective_comp_right' fun _ => Classical.choice ‹_›
 #align function.injective.surjective_comp_right Function.Injective.surjective_comp_right
 
-/- warning: function.bijective.comp_right -> Function.Bijective.comp_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β}, (Function.Bijective.{u1, u2} α β f) -> (Function.Bijective.{imax u2 u3, imax u1 u3} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u1, u2, u3} α β γ g f))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β}, (Function.Bijective.{u3, u2} α β f) -> (Function.Bijective.{imax u2 u1, imax u3 u1} (β -> γ) (α -> γ) (fun (g : β -> γ) => Function.comp.{u3, u2, u1} α β γ g f))
-Case conversion may be inaccurate. Consider using '#align function.bijective.comp_right Function.Bijective.comp_rightₓ'. -/
 theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ => g ∘ f :=
   ⟨hf.Surjective.injective_comp_right, fun g =>
     ⟨g ∘ surjInv hf.Surjective, by
@@ -1384,33 +917,15 @@ theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ =>
 
 end Extend
 
-/- warning: function.uncurry_def -> Function.uncurry_def is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ), Eq.{max (max (succ u1) (succ u2)) (succ u3)} ((Prod.{u1, u2} α β) -> γ) (Function.uncurry.{u1, u2, u3} α β γ f) (fun (p : Prod.{u1, u2} α β) => f (Prod.fst.{u1, u2} α β p) (Prod.snd.{u1, u2} α β p))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ), Eq.{max (max (succ u1) (succ u2)) (succ u3)} ((Prod.{u3, u2} α β) -> γ) (Function.uncurry.{u3, u2, u1} α β γ f) (fun (p : Prod.{u3, u2} α β) => f (Prod.fst.{u3, u2} α β p) (Prod.snd.{u3, u2} α β p))
-Case conversion may be inaccurate. Consider using '#align function.uncurry_def Function.uncurry_defₓ'. -/
 theorem uncurry_def {α β γ} (f : α → β → γ) : uncurry f = fun p => f p.1 p.2 :=
   rfl
 #align function.uncurry_def Function.uncurry_def
 
-/- warning: function.uncurry_apply_pair -> Function.uncurry_apply_pair is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (x : α) (y : β), Eq.{succ u3} γ (Function.uncurry.{u1, u2, u3} α β γ f (Prod.mk.{u1, u2} α β x y)) (f x y)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (x : α) (y : β), Eq.{succ u1} γ (Function.uncurry.{u3, u2, u1} α β γ f (Prod.mk.{u3, u2} α β x y)) (f x y)
-Case conversion may be inaccurate. Consider using '#align function.uncurry_apply_pair Function.uncurry_apply_pairₓ'. -/
 @[simp]
 theorem uncurry_apply_pair {α β γ} (f : α → β → γ) (x : α) (y : β) : uncurry f (x, y) = f x y :=
   rfl
 #align function.uncurry_apply_pair Function.uncurry_apply_pair
 
-/- warning: function.curry_apply -> Function.curry_apply is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : (Prod.{u1, u2} α β) -> γ) (x : α) (y : β), Eq.{succ u3} γ (Function.curry.{u1, u2, u3} α β γ f x y) (f (Prod.mk.{u1, u2} α β x y))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : (Prod.{u3, u2} α β) -> γ) (x : α) (y : β), Eq.{succ u1} γ (Function.curry.{u3, u2, u1} α β γ f x y) (f (Prod.mk.{u3, u2} α β x y))
-Case conversion may be inaccurate. Consider using '#align function.curry_apply Function.curry_applyₓ'. -/
 @[simp]
 theorem curry_apply {α β γ} (f : α × β → γ) (x : α) (y : β) : curry f x y = f (x, y) :=
   rfl
@@ -1439,22 +954,10 @@ def bicompr (f : γ → δ) (g : α → β → γ) (a b) :=
 -- Suggested local notation:
 local notation f " ∘₂ " g => bicompr f g
 
-/- warning: function.uncurry_bicompr -> Function.uncurry_bicompr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} (f : α -> β -> γ) (g : γ -> δ), Eq.{max (max (succ u1) (succ u2)) (succ u4)} ((Prod.{u1, u2} α β) -> δ) (Function.uncurry.{u1, u2, u4} α β δ (Function.bicompr.{u1, u2, u3, u4} α β γ δ g f)) (Function.comp.{max (succ u1) (succ u2), succ u3, succ u4} (Prod.{u1, u2} α β) γ δ g (Function.uncurry.{u1, u2, u3} α β γ f))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u3}} {γ : Type.{u1}} {δ : Type.{u2}} (f : α -> β -> γ) (g : γ -> δ), Eq.{max (max (succ u4) (succ u3)) (succ u2)} ((Prod.{u4, u3} α β) -> δ) (Function.uncurry.{u4, u3, u2} α β δ (Function.bicompr.{u4, u3, u1, u2} α β γ δ g f)) (Function.comp.{max (succ u3) (succ u4), succ u1, succ u2} (Prod.{u4, u3} α β) γ δ g (Function.uncurry.{u4, u3, u1} α β γ f))
-Case conversion may be inaccurate. Consider using '#align function.uncurry_bicompr Function.uncurry_bicomprₓ'. -/
 theorem uncurry_bicompr (f : α → β → γ) (g : γ → δ) : uncurry (g ∘₂ f) = g ∘ uncurry f :=
   rfl
 #align function.uncurry_bicompr Function.uncurry_bicompr
 
-/- warning: function.uncurry_bicompl -> Function.uncurry_bicompl is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} (f : γ -> δ -> ε) (g : α -> γ) (h : β -> δ), Eq.{max (max (succ u1) (succ u2)) (succ u5)} ((Prod.{u1, u2} α β) -> ε) (Function.uncurry.{u1, u2, u5} α β ε (Function.bicompl.{u1, u2, u3, u4, u5} α β γ δ ε f g h)) (Function.comp.{max (succ u1) (succ u2), max (succ u3) (succ u4), succ u5} (Prod.{u1, u2} α β) (Prod.{u3, u4} γ δ) ε (Function.uncurry.{u3, u4, u5} γ δ ε f) (Prod.map.{u1, u3, u2, u4} α γ β δ g h))
-but is expected to have type
-  forall {α : Type.{u5}} {β : Type.{u4}} {γ : Type.{u2}} {δ : Type.{u1}} {ε : Type.{u3}} (f : γ -> δ -> ε) (g : α -> γ) (h : β -> δ), Eq.{max (max (succ u5) (succ u4)) (succ u3)} ((Prod.{u5, u4} α β) -> ε) (Function.uncurry.{u5, u4, u3} α β ε (Function.bicompl.{u5, u4, u2, u1, u3} α β γ δ ε f g h)) (Function.comp.{max (succ u4) (succ u5), max (succ u1) (succ u2), succ u3} (Prod.{u5, u4} α β) (Prod.{u2, u1} γ δ) ε (Function.uncurry.{u2, u1, u3} γ δ ε f) (Prod.map.{u5, u2, u4, u1} α γ β δ g h))
-Case conversion may be inaccurate. Consider using '#align function.uncurry_bicompl Function.uncurry_bicomplₓ'. -/
 theorem uncurry_bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) :
     uncurry (bicompl f g h) = uncurry f ∘ Prod.map g h :=
   rfl
@@ -1587,56 +1090,26 @@ namespace Injective2
 
 variable {α β γ : Sort _} {f : α → β → γ}
 
-/- warning: function.injective2.left -> Function.Injective2.left is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β -> γ}, (Function.Injective2.{u1, u2, u3} α β γ f) -> (forall (b : β), Function.Injective.{u1, u3} α γ (fun (a : α) => f a b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β -> γ}, (Function.Injective2.{u3, u2, u1} α β γ f) -> (forall (b : β), Function.Injective.{u3, u1} α γ (fun (a : α) => f a b))
-Case conversion may be inaccurate. Consider using '#align function.injective2.left Function.Injective2.leftₓ'. -/
 /-- A binary injective function is injective when only the left argument varies. -/
 protected theorem left (hf : Injective2 f) (b : β) : Function.Injective fun a => f a b :=
   fun a₁ a₂ h => (hf h).left
 #align function.injective2.left Function.Injective2.left
 
-/- warning: function.injective2.right -> Function.Injective2.right is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β -> γ}, (Function.Injective2.{u1, u2, u3} α β γ f) -> (forall (a : α), Function.Injective.{u2, u3} β γ (f a))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β -> γ}, (Function.Injective2.{u3, u2, u1} α β γ f) -> (forall (a : α), Function.Injective.{u2, u1} β γ (f a))
-Case conversion may be inaccurate. Consider using '#align function.injective2.right Function.Injective2.rightₓ'. -/
 /-- A binary injective function is injective when only the right argument varies. -/
 protected theorem right (hf : Injective2 f) (a : α) : Function.Injective (f a) := fun a₁ a₂ h =>
   (hf h).right
 #align function.injective2.right Function.Injective2.right
 
-/- warning: function.injective2.uncurry -> Function.Injective2.uncurry is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Function.Injective.{max (succ u1) (succ u2), succ u3} (Prod.{u1, u2} α β) γ (Function.uncurry.{u1, u2, u3} α β γ f))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Function.Injective.{max (succ u2) (succ u3), succ u1} (Prod.{u3, u2} α β) γ (Function.uncurry.{u3, u2, u1} α β γ f))
-Case conversion may be inaccurate. Consider using '#align function.injective2.uncurry Function.Injective2.uncurryₓ'. -/
 protected theorem uncurry {α β γ : Type _} {f : α → β → γ} (hf : Injective2 f) :
     Function.Injective (uncurry f) := fun ⟨a₁, b₁⟩ ⟨a₂, b₂⟩ h => And.elim (hf h) (congr_arg₂ _)
 #align function.injective2.uncurry Function.Injective2.uncurry
 
-/- warning: function.injective2.left' -> Function.Injective2.left' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β -> γ}, (Function.Injective2.{u1, u2, u3} α β γ f) -> (forall [_inst_1 : Nonempty.{u2} β], Function.Injective.{u1, imax u2 u3} α (β -> γ) f)
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β -> γ}, (Function.Injective2.{u3, u2, u1} α β γ f) -> (forall [_inst_1 : Nonempty.{u2} β], Function.Injective.{u3, imax u2 u1} α (β -> γ) f)
-Case conversion may be inaccurate. Consider using '#align function.injective2.left' Function.Injective2.left'ₓ'. -/
 /-- As a map from the left argument to a unary function, `f` is injective. -/
 theorem left' (hf : Injective2 f) [Nonempty β] : Function.Injective f := fun a₁ a₂ h =>
   let ⟨b⟩ := ‹Nonempty β›
   hf.left b <| (congr_fun h b : _)
 #align function.injective2.left' Function.Injective2.left'
 
-/- warning: function.injective2.right' -> Function.Injective2.right' is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β -> γ}, (Function.Injective2.{u1, u2, u3} α β γ f) -> (forall [_inst_1 : Nonempty.{u1} α], Function.Injective.{u2, imax u1 u3} β (α -> γ) (fun (b : β) (a : α) => f a b))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β -> γ}, (Function.Injective2.{u3, u2, u1} α β γ f) -> (forall [_inst_1 : Nonempty.{u3} α], Function.Injective.{u2, imax u3 u1} β (α -> γ) (fun (b : β) (a : α) => f a b))
-Case conversion may be inaccurate. Consider using '#align function.injective2.right' Function.Injective2.right'ₓ'. -/
 /-- As a map from the right argument to a unary function, `f` is injective. -/
 theorem right' (hf : Injective2 f) [Nonempty α] : Function.Injective fun b a => f a b :=
   fun b₁ b₂ h =>
@@ -1644,12 +1117,6 @@ theorem right' (hf : Injective2 f) [Nonempty α] : Function.Injective fun b a =>
   hf.right a <| (congr_fun h a : _)
 #align function.injective2.right' Function.Injective2.right'
 
-/- warning: function.injective2.eq_iff -> Function.Injective2.eq_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {f : α -> β -> γ}, (Function.Injective2.{u1, u2, u3} α β γ f) -> (forall {a₁ : α} {a₂ : α} {b₁ : β} {b₂ : β}, Iff (Eq.{u3} γ (f a₁ b₁) (f a₂ b₂)) (And (Eq.{u1} α a₁ a₂) (Eq.{u2} β b₁ b₂)))
-but is expected to have type
-  forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} {f : α -> β -> γ}, (Function.Injective2.{u3, u2, u1} α β γ f) -> (forall {a₁ : α} {a₂ : α} {b₁ : β} {b₂ : β}, Iff (Eq.{u1} γ (f a₁ b₁) (f a₂ b₂)) (And (Eq.{u3} α a₁ a₂) (Eq.{u2} β b₁ b₂)))
-Case conversion may be inaccurate. Consider using '#align function.injective2.eq_iff Function.Injective2.eq_iffₓ'. -/
 theorem eq_iff (hf : Injective2 f) {a₁ a₂ b₁ b₂} : f a₁ b₁ = f a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ :=
   ⟨fun h => hf h, And.ndrec <| congr_arg₂ f⟩
 #align function.injective2.eq_iff Function.Injective2.eq_iff
@@ -1695,12 +1162,6 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 /-! ### Bijectivity of `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` -/
 
 
-/- warning: eq_rec_on_bijective -> eq_rec_on_bijective is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {C : α -> Sort.{u2}} {a : α} {a' : α} (h : Eq.{u1} α a a'), Function.Bijective.{u2, u2} (C a) (C a') (Eq.recOn.{u2, u1} α a C a' h)
-but is expected to have type
-  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10838 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10838 a' h)
-Case conversion may be inaccurate. Consider using '#align eq_rec_on_bijective eq_rec_on_bijectiveₓ'. -/
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.recOn _ _ C _ h)
   | _, _, rfl => ⟨fun x y => id, fun x => ⟨x, rfl⟩⟩
@@ -1728,12 +1189,6 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
 is trivial anyway.-/
 
 
-/- warning: eq_rec_inj -> eq_rec_inj is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u1}} {a : α} {a' : α} (h : Eq.{u1} α a a') {C : α -> Type.{u2}} (x : C a) (y : C a), Iff (Eq.{succ u2} ((fun (_x : α) => C _x) a') (Eq.ndrec.{succ u2, u1} α a (fun (_x : α) => C _x) x a' h) (Eq.ndrec.{succ u2, u1} α a (fun (_x : α) => (fun (_x : α) => C _x) _x) y a' h)) (Eq.{succ u2} (C a) x y)
-but is expected to have type
-  forall {α : Sort.{u2}} {a : α} {a' : α} (h : Eq.{u2} α a a') {C : α -> Type.{u1}} (x : C a) (y : C a), Iff (Eq.{succ u1} (C a') (Eq.ndrec.{succ u1, u2} α a C x a' h) (Eq.ndrec.{succ u1, u2} α a C y a' h)) (Eq.{succ u1} (C a) x y)
-Case conversion may be inaccurate. Consider using '#align eq_rec_inj eq_rec_injₓ'. -/
 @[simp]
 theorem eq_rec_inj {α : Sort _} {a a' : α} (h : a = a') {C : α → Type _} (x y : C a) :
     (Eq.ndrec x h : C a') = Eq.ndrec y h ↔ x = y :=
@@ -1747,36 +1202,18 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
 #align cast_inj cast_inj
 -/
 
-/- warning: function.left_inverse.eq_rec_eq -> Function.LeftInverse.eq_rec_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.ndrec.{u1, u3} β (f (g (f a))) γ (C (g (f a))) (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a))) (C a)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11167 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     (congr_arg f (h a)).rec (C (g (f a))) = C a :=
   eq_of_hEq <| (eq_rec_hEq _ _).trans <| by rw [h]
 #align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eq
 
-/- warning: function.left_inverse.eq_rec_on_eq -> Function.LeftInverse.eq_rec_on_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.recOn.{u1, u3} β (f (g (f a))) γ (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11283 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     (congr_arg f (h a)).recOn (C (g (f a))) = C a :=
   h.eq_rec_eq _ _
 #align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eq
 
-/- warning: function.left_inverse.cast_eq -> Function.LeftInverse.cast_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (cast.{u1} (γ (f (g (f a)))) (γ (f a)) (congr_arg.{u2, succ u1} α Sort.{u1} (g (f a)) a (fun (a : α) => γ (f a)) (h a)) (C (g (f a)))) (C a)
-but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} ((fun (a : α) => γ (f a)) a) (cast.{u3} ((fun (a : α) => γ (f a)) (g (f a))) ((fun (a : α) => γ (f a)) a) (congr_arg.{u2, succ u3} α Sort.{u3} (g (f a)) a (fun (a : α) => γ (f a)) (h a)) (C (g (f a)))) (C a)
-Case conversion may be inaccurate. Consider using '#align function.left_inverse.cast_eq Function.LeftInverse.cast_eqₓ'. -/
 theorem Function.LeftInverse.cast_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     cast (congr_arg (fun a => γ (f a)) (h a)) (C (g (f a))) = C a :=
@@ -1791,12 +1228,6 @@ def Set.SeparatesPoints {α β : Type _} (A : Set (α → β)) : Prop :=
 #align set.separates_points Set.SeparatesPoints
 -/
 
-/- warning: is_symm_op.flip_eq -> IsSymmOp.flip_eq is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : outParam.{succ (succ u2)} Type.{u2}} (op : α -> α -> β) [_inst_1 : IsSymmOp.{u1, u2} α β op], Eq.{max (succ u1) (succ u2)} (α -> α -> β) (flip.{succ u1, succ u1, succ u2} α α β op) op
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} (op : α -> α -> β) [_inst_1 : IsSymmOp.{u2, u1} α β op], Eq.{max (succ u1) (succ u2)} (α -> α -> β) (flip.{succ u2, succ u2, succ u1} α α β op) op
-Case conversion may be inaccurate. Consider using '#align is_symm_op.flip_eq IsSymmOp.flip_eqₓ'. -/
 theorem IsSymmOp.flip_eq {α β} (op) [IsSymmOp α β op] : flip op = op :=
   funext fun a => funext fun b => (IsSymmOp.symm_op a b).symm
 #align is_symm_op.flip_eq IsSymmOp.flip_eq
Diff
@@ -143,12 +143,8 @@ theorem hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f
     (hα : α = α') (h : ∀ a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' :=
   by
   subst hα
-  have : ∀ a, HEq (f a) (f' a) := by
-    intro a
-    exact h a a (HEq.refl a)
-  have : β = β' := by
-    funext a
-    exact type_eq_of_hEq (this a)
+  have : ∀ a, HEq (f a) (f' a) := by intro a; exact h a a (HEq.refl a)
+  have : β = β' := by funext a; exact type_eq_of_hEq (this a)
   subst this
   apply hEq_of_eq
   funext a
@@ -313,14 +309,10 @@ theorem Injective.dite (p : α → Prop) [DecidablePred p] {f : { a : α // p a
   by
   dsimp only at h
   by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
-  · rw [dif_pos h₁, dif_pos h₂] at h
-    injection hf h
-  · rw [dif_pos h₁, dif_neg h₂] at h
-    exact (im_disj h).elim
-  · rw [dif_neg h₁, dif_pos h₂] at h
-    exact (im_disj h.symm).elim
-  · rw [dif_neg h₁, dif_neg h₂] at h
-    injection hf' h
+  · rw [dif_pos h₁, dif_pos h₂] at h; injection hf h
+  · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
+  · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
+  · rw [dif_neg h₁, dif_neg h₂] at h; injection hf' h
 #align function.injective.dite Function.Injective.dite
 
 #print Function.Surjective.of_comp /-
@@ -467,8 +459,7 @@ theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g
   · simp only [(· ∘ ·), exists_apply_eq_apply]
   · intro y
     have : True = ∃ x, f x = y := congr_fun h y
-    rw [← this]
-    exact trivial
+    rw [← this]; exact trivial
 #align function.surjective_of_right_cancellable_Prop Function.surjective_of_right_cancellable_Prop
 
 /- warning: function.bijective_iff_exists_unique -> Function.bijective_iff_existsUnique is a dubious translation:
@@ -568,12 +559,8 @@ theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjecti
   let g : Set T → T := fun s => ⟨U, cast hU.symm s⟩
   have hg : injective g := by
     intro s t h
-    suffices cast hU (g s).2 = cast hU (g t).2
-      by
-      simp only [cast_cast, cast_eq] at this
-      assumption
-    · congr
-      assumption
+    suffices cast hU (g s).2 = cast hU (g t).2 by simp only [cast_cast, cast_eq] at this; assumption
+    · congr ; assumption
   exact cantor_injective g hg
 #align function.not_surjective_Type Function.not_surjective_Type
 -/
@@ -1029,20 +1016,16 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
-    (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) :=
-  by
-  rw [← and_forall_ne a, update_same]
-  simp (config := { contextual := true })
+    (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) := by
+  rw [← and_forall_ne a, update_same]; simp (config := { contextual := true })
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
 /- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
-    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) :=
-  by
-  rw [← not_forall_not, forall_update_iff f fun a b => ¬p a b]
-  simp [not_and_or]
+    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) := by
+  rw [← not_forall_not, forall_update_iff f fun a b => ¬p a b]; simp [not_and_or]
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
@@ -1147,8 +1130,7 @@ theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f :
     f j (update g i v j) = update (fun k => f k (g k)) i (f i v) j :=
   by
   by_cases h : j = i
-  · subst j
-    simp
+  · subst j; simp
   · simp [h]
 #align function.apply_update Function.apply_update
 
@@ -1163,8 +1145,7 @@ theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _
     f j (update g i v j) (update h i w j) = update (fun k => f k (g k) (h k)) i (f i v w) j :=
   by
   by_cases h : j = i
-  · subst j
-    simp
+  · subst j; simp
   · simp [h]
 #align function.apply_update₂ Function.apply_update₂
 
@@ -1201,10 +1182,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align function.update_idem Function.update_idemₓ'. -/
 @[simp]
 theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
-    update (update f a v) a w = update f a w :=
-  by
-  funext b
-  by_cases b = a <;> simp [update, h]
+    update (update f a v) a w = update f a w := by funext b; by_cases b = a <;> simp [update, h]
 #align function.update_idem Function.update_idem
 
 end Update
@@ -1253,9 +1231,7 @@ but is expected to have type
   forall {α : Sort.{u3}} {β : Sort.{u2}} {γ : Sort.{u1}} (f : α -> β) (g : α -> γ) (e' : β -> γ) (b : β) [_inst_1 : Decidable (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b))], Eq.{u1} γ (Function.extend.{u3, u2, u1} α β γ f g e' b) (dite.{u1} γ (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b)) _inst_1 (fun (h : Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b)) => g (Classical.choose.{u3} α (fun (a : α) => Eq.{u2} β (f a) b) h)) (fun (h : Not (Exists.{u3} α (fun (a : α) => Eq.{u2} β (f a) b))) => e' b))
 Case conversion may be inaccurate. Consider using '#align function.extend_def Function.extend_defₓ'. -/
 theorem extend_def (f : α → β) (g : α → γ) (e' : β → γ) (b : β) [Decidable (∃ a, f a = b)] :
-    extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b :=
-  by
-  unfold extend
+    extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b := by unfold extend;
   congr
 #align function.extend_def Function.extend_def
 
@@ -1318,13 +1294,9 @@ theorem FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g
     (e' : β → γ) (b : β) : F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   by
   by_cases hb : ∃ a, f a = b
-  · cases' hb with a ha
-    subst b
+  · cases' hb with a ha; subst b
     rw [factors_through.extend_apply, factors_through.extend_apply]
-    · intro a b h
-      simp only [comp_apply]
-      apply congr_arg
-      exact hf h
+    · intro a b h; simp only [comp_apply]; apply congr_arg; exact hf h
     · exact hf
   · rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb]
 #align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
Diff
@@ -738,7 +738,7 @@ theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h
     
 #align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverse
 
-attribute [local instance] Classical.propDecidable
+attribute [local instance 10] Classical.propDecidable
 
 #print Function.partialInv /-
 /-- We can use choice to construct explicitly a partial inverse for
@@ -784,7 +784,7 @@ section InvFun
 
 variable {α β : Sort _} [Nonempty α] {f : α → β} {a : α} {b : β}
 
-attribute [local instance] Classical.propDecidable
+attribute [local instance 10] Classical.propDecidable
 
 #print Function.invFun /-
 /-- The inverse of a function (which is a left inverse if `f` is injective
@@ -1213,7 +1213,7 @@ section Extend
 
 noncomputable section
 
-attribute [local instance] Classical.propDecidable
+attribute [local instance 10] Classical.propDecidable
 
 variable {α β γ : Sort _} {f : α → β}
 
@@ -1686,7 +1686,7 @@ end Injective2
 
 section Sometimes
 
-attribute [local instance] Classical.propDecidable
+attribute [local instance 10] Classical.propDecidable
 
 #print Function.sometimes /-
 /-- `sometimes f` evaluates to some value of `f`, if it exists. This function is especially
Diff
@@ -127,6 +127,12 @@ theorem id_def : @id α = fun x => x :=
 #align function.id_def Function.id_def
 -/
 
+/- warning: function.on_fun_apply -> Function.onFun_apply is a dubious translation:
+lean 3 declaration is
+  forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} (f : β -> β -> γ) (g : α -> β) (a : α) (b : α), Eq.{u3} γ (Function.onFun.{u1, u2, u3} α β γ f g a b) (f (g a) (g b))
+but is expected to have type
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : Sort.{u3}} (f : β -> β -> γ) (g : α -> β) (a : α) (b : α), Eq.{u3} γ (Function.onFun.{u2, u1, u3} α β γ f g a b) (f (g a) (g b))
+Case conversion may be inaccurate. Consider using '#align function.on_fun_apply Function.onFun_applyₓ'. -/
 @[simp]
 theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
   rfl
@@ -276,7 +282,7 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
 lean 3 declaration is
   forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {g : β -> γ}, (Function.Injective.{u2, u3} β γ g) -> (Function.Injective.{imax u1 u2, imax u1 u3} (α -> β) (α -> γ) (Function.comp.{u1, u2, u3} α β γ g))
 but is expected to have type
-  forall {α : Sort.{u1}} {β : Sort.{u3}} {γ : Sort.{u2}} {g : β -> γ}, (Function.Injective.{u3, u2} β γ g) -> (Function.Injective.{imax u1 u3, imax u1 u2} (α -> β) (α -> γ) ((fun (x._@.Mathlib.Logic.Function.Basic._hyg.1114 : β -> γ) (x._@.Mathlib.Logic.Function.Basic._hyg.1116 : α -> β) => Function.comp.{u1, u3, u2} α β γ x._@.Mathlib.Logic.Function.Basic._hyg.1114 x._@.Mathlib.Logic.Function.Basic._hyg.1116) g))
+  forall {α : Sort.{u1}} {β : Sort.{u3}} {γ : Sort.{u2}} {g : β -> γ}, (Function.Injective.{u3, u2} β γ g) -> (Function.Injective.{imax u1 u3, imax u1 u2} (α -> β) (α -> γ) ((fun (x._@.Mathlib.Logic.Function.Basic._hyg.1150 : β -> γ) (x._@.Mathlib.Logic.Function.Basic._hyg.1152 : α -> β) => Function.comp.{u1, u3, u2} α β γ x._@.Mathlib.Logic.Function.Basic._hyg.1150 x._@.Mathlib.Logic.Function.Basic._hyg.1152) g))
 Case conversion may be inaccurate. Consider using '#align function.injective.comp_left Function.Injective.comp_leftₓ'. -/
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
@@ -1721,7 +1727,7 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 lean 3 declaration is
   forall {α : Sort.{u1}} {C : α -> Sort.{u2}} {a : α} {a' : α} (h : Eq.{u1} α a a'), Function.Bijective.{u2, u2} (C a) (C a') (Eq.recOn.{u2, u1} α a C a' h)
 but is expected to have type
-  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10802 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10802 a' h)
+  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10838 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10838 a' h)
 Case conversion may be inaccurate. Consider using '#align eq_rec_on_bijective eq_rec_on_bijectiveₓ'. -/
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.recOn _ _ C _ h)
@@ -1773,7 +1779,7 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.ndrec.{u1, u3} β (f (g (f a))) γ (C (g (f a))) (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11131 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11167 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
@@ -1785,7 +1791,7 @@ theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.recOn.{u1, u3} β (f (g (f a))) γ (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11247 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11283 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
 
 ! This file was ported from Lean 3 source module logic.function.basic
-! leanprover-community/mathlib commit 448144f7ae193a8990cb7473c9e9a01990f64ac7
+! leanprover-community/mathlib commit 29cb56a7b35f72758b05a30490e1f10bd62c35c1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -127,6 +127,11 @@ theorem id_def : @id α = fun x => x :=
 #align function.id_def Function.id_def
 -/
 
+@[simp]
+theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
+  rfl
+#align function.on_fun_apply Function.onFun_apply
+
 #print Function.hfunext /-
 theorem hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀ a, β a} {f' : ∀ a, β' a}
     (hα : α = α') (h : ∀ a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' :=
Diff
@@ -271,7 +271,7 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
 lean 3 declaration is
   forall {α : Sort.{u1}} {β : Sort.{u2}} {γ : Sort.{u3}} {g : β -> γ}, (Function.Injective.{u2, u3} β γ g) -> (Function.Injective.{imax u1 u2, imax u1 u3} (α -> β) (α -> γ) (Function.comp.{u1, u2, u3} α β γ g))
 but is expected to have type
-  forall {α : Sort.{u1}} {β : Sort.{u3}} {γ : Sort.{u2}} {g : β -> γ}, (Function.Injective.{u3, u2} β γ g) -> (Function.Injective.{imax u1 u3, imax u1 u2} (α -> β) (α -> γ) ((fun (x._@.Mathlib.Logic.Function.Basic._hyg.1113 : β -> γ) (x._@.Mathlib.Logic.Function.Basic._hyg.1115 : α -> β) => Function.comp.{u1, u3, u2} α β γ x._@.Mathlib.Logic.Function.Basic._hyg.1113 x._@.Mathlib.Logic.Function.Basic._hyg.1115) g))
+  forall {α : Sort.{u1}} {β : Sort.{u3}} {γ : Sort.{u2}} {g : β -> γ}, (Function.Injective.{u3, u2} β γ g) -> (Function.Injective.{imax u1 u3, imax u1 u2} (α -> β) (α -> γ) ((fun (x._@.Mathlib.Logic.Function.Basic._hyg.1114 : β -> γ) (x._@.Mathlib.Logic.Function.Basic._hyg.1116 : α -> β) => Function.comp.{u1, u3, u2} α β γ x._@.Mathlib.Logic.Function.Basic._hyg.1114 x._@.Mathlib.Logic.Function.Basic._hyg.1116) g))
 Case conversion may be inaccurate. Consider using '#align function.injective.comp_left Function.Injective.comp_leftₓ'. -/
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
@@ -1716,7 +1716,7 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 lean 3 declaration is
   forall {α : Sort.{u1}} {C : α -> Sort.{u2}} {a : α} {a' : α} (h : Eq.{u1} α a a'), Function.Bijective.{u2, u2} (C a) (C a') (Eq.recOn.{u2, u1} α a C a' h)
 but is expected to have type
-  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10798 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10798 a' h)
+  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10802 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10802 a' h)
 Case conversion may be inaccurate. Consider using '#align eq_rec_on_bijective eq_rec_on_bijectiveₓ'. -/
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.recOn _ _ C _ h)
@@ -1768,7 +1768,7 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.ndrec.{u1, u3} β (f (g (f a))) γ (C (g (f a))) (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11127 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11131 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
@@ -1780,7 +1780,7 @@ theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.recOn.{u1, u3} β (f (g (f a))) γ (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11243 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11247 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
Diff
@@ -1716,7 +1716,7 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 lean 3 declaration is
   forall {α : Sort.{u1}} {C : α -> Sort.{u2}} {a : α} {a' : α} (h : Eq.{u1} α a a'), Function.Bijective.{u2, u2} (C a) (C a') (Eq.recOn.{u2, u1} α a C a' h)
 but is expected to have type
-  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10800 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10800 a' h)
+  forall {α : Sort.{u2}} {C : α -> Sort.{u1}} {a : α} {a' : α} (h : Eq.{u2} α a a'), Function.Bijective.{u1, u1} (C a) (C a') (fun (x._@.Mathlib.Logic.Function.Basic._hyg.10798 : C a) => Eq.ndrec.{u1, u2} α a C x._@.Mathlib.Logic.Function.Basic._hyg.10798 a' h)
 Case conversion may be inaccurate. Consider using '#align eq_rec_on_bijective eq_rec_on_bijectiveₓ'. -/
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.recOn _ _ C _ h)
@@ -1768,7 +1768,7 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.ndrec.{u1, u3} β (f (g (f a))) γ (C (g (f a))) (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11129 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.rec.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11127 : Eq.{u1} β (f (g (f a))) x) => γ x) (C (g (f a))) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
@@ -1780,7 +1780,7 @@ theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f
 lean 3 declaration is
   forall {α : Sort.{u2}} {β : Sort.{u3}} {γ : β -> Sort.{u1}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u3} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u1} (γ (f a)) (Eq.recOn.{u1, u3} β (f (g (f a))) γ (f a) (congr_arg.{u2, u3} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 but is expected to have type
-  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11245 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
+  forall {α : Sort.{u2}} {β : Sort.{u1}} {γ : β -> Sort.{u3}} {f : α -> β} {g : β -> α} (h : Function.LeftInverse.{u2, u1} α β g f) (C : forall (a : α), γ (f a)) (a : α), Eq.{u3} (γ (f a)) (Eq.recOn.{u3, u1} β (f (g (f a))) (fun (x : β) (x._@.Mathlib.Logic.Function.Basic._hyg.11243 : Eq.{u1} β (f (g (f a))) x) => γ x) (f a) (congr_arg.{u2, u1} α β (g (f a)) a f (h a)) (C (g (f a)))) (C a)
 Case conversion may be inaccurate. Consider using '#align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eqₓ'. -/
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
Diff
@@ -1015,7 +1015,7 @@ theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) :
 #align function.update_noteq Function.update_noteq
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.forall_update_iff /-
 theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ (x) (_ : x ≠ a), p x (f x) :=
@@ -1025,7 +1025,7 @@ theorem forall_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.forall_update_iff Function.forall_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.exists_update_iff /-
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) :=
@@ -1035,7 +1035,7 @@ theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a
 #align function.exists_update_iff Function.exists_update_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.update_eq_iff /-
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
@@ -1043,7 +1043,7 @@ theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.update_eq_iff Function.update_eq_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Basic.lean:628:2: warning: expanding binder collection (x «expr ≠ » a) -/
+/- ./././Mathport/Syntax/Translate/Basic.lean:635:2: warning: expanding binder collection (x «expr ≠ » a) -/
 #print Function.eq_update_iff /-
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=

Changes in mathlib4

mathlib3
mathlib4
chore(Logic): reduce use of autoImplicit (#12135)

In one case, replacing this naively errored, so I just merged the single declaration using it.

Delete two unused variables in Logic/Basic.

Diff
@@ -13,8 +13,6 @@ import Mathlib.Logic.Basic
 # Miscellaneous function constructions and lemmas
 -/
 
-set_option autoImplicit true
-
 open Function
 
 universe u v w
@@ -446,7 +444,7 @@ theorem invFun_eq (h : ∃ a, f a = b) : f (invFun f b) = b :=
   by simp only [invFun, dif_pos h, h.choose_spec]
 #align function.inv_fun_eq Function.invFun_eq
 
-theorem apply_invFun_apply {α : Type u₁} {β : Type u₂} {f : α → β} {a : α} :
+theorem apply_invFun_apply {α β : Type*} {f : α → β} {a : α} :
     f (@invFun _ _ ⟨a⟩ f (f a)) = f a :=
   @invFun_eq _ _ ⟨a⟩ _ _ ⟨_, rfl⟩
 
@@ -805,13 +803,13 @@ end Extend
 
 namespace FactorsThrough
 
-protected theorem rfl {f : α → β} : FactorsThrough f f := fun _ _ ↦ id
+protected theorem rfl {α β : Sort*} {f : α → β} : FactorsThrough f f := fun _ _ ↦ id
 
-theorem comp_left {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : γ → δ) :
+theorem comp_left {α β γ δ : Sort*} {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : γ → δ) :
     FactorsThrough (g' ∘ g) f := fun _x _y hxy ↦
   congr_arg g' (h hxy)
 
-theorem comp_right {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : δ → α) :
+theorem comp_right {α β γ δ : Sort*} {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : δ → α) :
     FactorsThrough (g ∘ g') (f ∘ g') := fun _x _y hxy ↦
   h hxy
 
@@ -934,13 +932,13 @@ lemma not_surjective : Surjective Not := not_involutive.surjective
 lemma not_bijective : Bijective Not := not_involutive.bijective
 
 @[simp]
-lemma symmetric_apply_eq_iff {f : α → α} : Symmetric (f · = ·) ↔ Involutive f := by
+lemma symmetric_apply_eq_iff {α : Sort*} {f : α → α} : Symmetric (f · = ·) ↔ Involutive f := by
   simp [Symmetric, Involutive]
 
 /-- The property of a binary function `f : α → β → γ` being injective.
 Mathematically this should be thought of as the corresponding function `α × β → γ` being injective.
 -/
-def Injective2 {α β γ} (f : α → β → γ) : Prop :=
+def Injective2 {α β γ : Sort*} (f : α → β → γ) : Prop :=
   ∀ ⦃a₁ a₂ b₁ b₂⦄, f a₁ b₁ = f a₂ b₂ → a₁ = a₂ ∧ b₁ = b₂
 #align function.injective2 Function.Injective2
 
@@ -1006,6 +1004,8 @@ end Sometimes
 
 end Function
 
+variable {α β : Sort*}
+
 /-- A relation `r : α → β → Prop` is "function-like"
 (for each `a` there exists a unique `b` such that `r a b`)
 if and only if it is `(f · = ·)` for some function `f`. -/
@@ -1046,10 +1046,10 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
   fun i ↦ if i ∈ s then f i else g i
 #align set.piecewise Set.piecewise
 
-/-! ### Bijectivity of `Eq.rec`, `Eq.mp`, `Eq.mpr`, and `cast` -/
 
+/-! ### Bijectivity of `Eq.rec`, `Eq.mp`, `Eq.mpr`, and `cast` -/
 
-theorem eq_rec_on_bijective {α : Sort*} {C : α → Sort*} :
+theorem eq_rec_on_bijective {C : α → Sort*} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.ndrec _ _ C · _ h)
   | _, _, rfl => ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align eq_rec_on_bijective eq_rec_on_bijective
@@ -1074,9 +1074,8 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
 /-! Note these lemmas apply to `Type*` not `Sort*`, as the latter interferes with `simp`, and
 is trivial anyway. -/
 
-
 @[simp]
-theorem eq_rec_inj {α : Sort*} {a a' : α} (h : a = a') {C : α → Type*} (x y : C a) :
+theorem eq_rec_inj {a a' : α} (h : a = a') {C : α → Type*} (x y : C a) :
     (Eq.ndrec x h : C a') = Eq.ndrec y h ↔ x = y :=
   (eq_rec_on_bijective h).injective.eq_iff
 #align eq_rec_inj eq_rec_inj
@@ -1086,21 +1085,21 @@ theorem cast_inj {α β : Type u} (h : α = β) {x y : α} : cast h x = cast h y
   (cast_bijective h).injective.eq_iff
 #align cast_inj cast_inj
 
-theorem Function.LeftInverse.eq_rec_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.eq_rec_eq {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).rec (C (g (f a)))` for LHS
     @Eq.rec β (f (g (f a))) (fun x _ ↦ γ x) (C (g (f a))) (f a) (congr_arg f (h a)) = C a :=
   eq_of_heq <| (eq_rec_heq _ _).trans <| by rw [h]
 #align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eq
 
-theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.eq_rec_on_eq {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).recOn (C (g (f a)))` for LHS
     @Eq.recOn β (f (g (f a))) (fun x _ ↦ γ x) (f a) (congr_arg f (h a)) (C (g (f a))) = C a :=
   h.eq_rec_eq _ _
 #align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eq
 
-theorem Function.LeftInverse.cast_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.cast_eq {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     cast (congr_arg (fun a ↦ γ (f a)) (h a)) (C (g (f a))) = C a := by
   rw [cast_eq_iff_heq, h]
@@ -1112,7 +1111,7 @@ def Set.SeparatesPoints {α β : Type*} (A : Set (α → β)) : Prop :=
   ∀ ⦃x y : α⦄, x ≠ y → ∃ f ∈ A, (f x : β) ≠ f y
 #align set.separates_points Set.SeparatesPoints
 
-theorem IsSymmOp.flip_eq {α β} (op) [IsSymmOp α β op] : flip op = op :=
+theorem IsSymmOp.flip_eq (op) [IsSymmOp α β op] : flip op = op :=
   funext fun a ↦ funext fun b ↦ (IsSymmOp.symm_op a b).symm
 #align is_symm_op.flip_eq IsSymmOp.flip_eq
 
chore: update Std (#12210)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -69,8 +69,6 @@ lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f :
   exact eq_of_heq (this a)
 #align function.hfunext Function.hfunext
 
-theorem funext_iff {β : α → Sort*} {f₁ f₂ : ∀ x : α, β x} : f₁ = f₂ ↔ ∀ a, f₁ a = f₂ a :=
-  Iff.intro (fun h _ ↦ h ▸ rfl) funext
 #align function.funext_iff Function.funext_iff
 
 theorem ne_iff {β : α → Sort*} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔ ∃ a, f₁ a ≠ f₂ a :=
feat: Ordinal Approximants of the least/greatest fixed point in a complete lattice (#8996)

Define ordinal approximants for the least/greatest fixed points of a monotone function in a complete lattice. It is sometimes also called the constructive Knaster-Tarski Theorem, first introduced by Cousot & Cousot in 1979. This implementation is however not constructive.

This has a variety of applications in non standard logics and proofs such as quantitative logics or cyclic proofs.

Co-authored-by: Ira Fesefeldt <public@feuervogel.me>

Diff
@@ -112,6 +112,9 @@ theorem Injective.ne_iff' (hf : Injective f) {x y : α} {z : β} (h : f y = z) :
   h ▸ hf.ne_iff
 #align function.injective.ne_iff' Function.Injective.ne_iff'
 
+theorem not_injective_iff : ¬ Injective f ↔ ∃ a b, f a = f b ∧ a ≠ b := by
+  simp only [Injective, not_forall, exists_prop]
+
 /-- If the co-domain `β` of an injective function `f : α → β` has decidable equality, then
 the domain `α` also has decidable equality. -/
 protected def Injective.decidableEq [DecidableEq β] (I : Injective f) : DecidableEq α :=
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -869,7 +869,7 @@ is to recursively uncurry. For instance `f : α → β → γ → δ` will be tu
 class HasUncurry (α : Type*) (β : outParam (Type*)) (γ : outParam (Type*)) where
   /-- Uncurrying operator. The most generic use is to recursively uncurry. For instance
   `f : α → β → γ → δ` will be turned into `↿f : α × β × γ → δ`. One can also add instances
-  for bundled maps.-/
+  for bundled maps. -/
   uncurry : α → β → γ
 #align function.has_uncurry Function.HasUncurry
 
@@ -1071,7 +1071,7 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
 #align cast_bijective cast_bijective
 
 /-! Note these lemmas apply to `Type*` not `Sort*`, as the latter interferes with `simp`, and
-is trivial anyway.-/
+is trivial anyway. -/
 
 
 @[simp]
chore: tidy various files (#11624)
Diff
@@ -806,7 +806,7 @@ namespace FactorsThrough
 
 protected theorem rfl {f : α → β} : FactorsThrough f f := fun _ _ ↦ id
 
-theorem comp_left {f : α → β} {g : α → γ}  (h : FactorsThrough g f) (g' : γ → δ) :
+theorem comp_left {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : γ → δ) :
     FactorsThrough (g' ∘ g) f := fun _x _y hxy ↦
   congr_arg g' (h hxy)
 
feat: Not is involutive (#11192)
Diff
@@ -927,6 +927,11 @@ protected theorem eq_iff {x y : α} : f x = y ↔ x = f y :=
 
 end Involutive
 
+lemma not_involutive : Involutive Not := fun _ ↦ propext not_not
+lemma not_injective : Injective Not := not_involutive.injective
+lemma not_surjective : Surjective Not := not_involutive.surjective
+lemma not_bijective : Bijective Not := not_involutive.bijective
+
 @[simp]
 lemma symmetric_apply_eq_iff {f : α → α} : Symmetric (f · = ·) ↔ Involutive f := by
   simp [Symmetric, Involutive]
chore: tidy various files (#11490)
Diff
@@ -596,18 +596,18 @@ lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a →
 #align function.forall_update_iff Function.forall_update_iff
 
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
-    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
+    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ x ≠ a, p x (f x) := by
   rw [← not_forall_not, forall_update_iff f fun a b ↦ ¬p a b]
   simp [-not_and, not_and_or]
 #align function.exists_update_iff Function.exists_update_iff
 
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
-    update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
+    update f a b = g ↔ b = g a ∧ ∀ x ≠ a, f x = g x :=
   funext_iff.trans <| forall_update_iff _ fun x y ↦ y = g x
 #align function.update_eq_iff Function.update_eq_iff
 
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
-    g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
+    g = update f a b ↔ g a = b ∧ ∀ x ≠ a, g x = f x :=
   funext_iff.trans <| forall_update_iff _ fun x y ↦ g x = y
 #align function.eq_update_iff Function.eq_update_iff
 
chore: replace λ by fun (#11301)

Per the style guidelines, λ is disallowed in mathlib. This is close to exhaustive; I left some tactic code alone when it seemed to me that tactic could be upstreamed soon.

Notes

  • In lines I was modifying anyway, I also converted => to .
  • Also contains some mild in-passing indentation fixes in Mathlib/Order/SupClosed.
  • Some doc comments still contained Lean 3 syntax λ x, , which I also replaced.
Diff
@@ -61,9 +61,8 @@ theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f
 lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
     (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
   subst hα
-  have : ∀a, HEq (f a) (f' a) := λ a => h a a (HEq.refl a)
-  have : β = β' := by funext a
-                      exact type_eq_of_heq (this a)
+  have : ∀a, HEq (f a) (f' a) := fun a ↦ h a a (HEq.refl a)
+  have : β = β' := by funext a; exact type_eq_of_heq (this a)
   subst this
   apply heq_of_eq
   funext a
@@ -159,7 +158,7 @@ lemma Injective.dite (p : α → Prop) [DecidablePred p]
     {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
     (hf : Injective f) (hf' : Injective f')
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬ p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
-    Function.Injective (λ x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩) := fun x₁ x₂ h => by
+    Function.Injective (fun x ↦ if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩) := fun x₁ x₂ h => by
  dsimp only at h
  by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
  · rw [dif_pos h₁, dif_pos h₂] at h; injection (hf h)
@@ -291,7 +290,7 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
 to `α`. -/
 theorem cantor_injective {α : Type*} (f : Set α → α) : ¬Injective f
   | i => cantor_surjective (fun a ↦ {b | ∀ U, a = f U → U b}) <|
-         RightInverse.surjective (λ U => Set.ext fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
+         RightInverse.surjective (fun U ↦ Set.ext fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
 #align function.cantor_injective Function.cantor_injective
 
 /-- There is no surjection from `α : Type u` into `Type (max u v)`. This theorem
feat: funext_iff_of_subsingleton (#11140)

Add a lemma about equality of functions from a subsingleton type:

lemma funext_iff_of_subsingleton [Subsingleton α] {g : α → β} (x y : α) :
    f x = g y ↔ f = g := by

This isn't a simp lemma; it isn't entirely clear whether equality of functions or of particular values should necessarily be considered simpler, and making it a simp lemma introduces a simpNF linter failure for eq_rec_inj.

From AperiodicMonotilesLean.

Diff
@@ -78,6 +78,12 @@ theorem ne_iff {β : α → Sort*} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔
   funext_iff.not.trans not_forall
 #align function.ne_iff Function.ne_iff
 
+lemma funext_iff_of_subsingleton [Subsingleton α] {g : α → β} (x y : α) :
+    f x = g y ↔ f = g := by
+  refine ⟨fun h ↦ funext fun z ↦ ?_, fun h ↦ ?_⟩
+  · rwa [Subsingleton.elim x z, Subsingleton.elim y z] at h
+  · rw [h, Subsingleton.elim x y]
+
 protected theorem Bijective.injective {f : α → β} (hf : Bijective f) : Injective f := hf.1
 #align function.bijective.injective Function.Bijective.injective
 protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surjective f := hf.2
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -52,7 +52,7 @@ theorem id_def : @id α = fun x ↦ x :=
   rfl
 #align function.id_def Function.id_def
 
--- porting note: `Function.onFun` is now reducible
+-- Porting note: `Function.onFun` is now reducible
 -- @[simp]
 theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
   rfl
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -1047,17 +1047,17 @@ theorem eq_mp_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.
   -- TODO: mathlib3 uses `eq_rec_on_bijective`, difference in elaboration here
   -- due to `@[macro_inline]` possibly?
   cases h
-  refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+  exact ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align eq_mp_bijective eq_mp_bijective
 
 theorem eq_mpr_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mpr h) := by
   cases h
-  refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+  exact ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align eq_mpr_bijective eq_mpr_bijective
 
 theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast h) := by
   cases h
-  refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+  exact ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align cast_bijective cast_bijective
 
 /-! Note these lemmas apply to `Type*` not `Sort*`, as the latter interferes with `simp`, and
chore: Remove unnecessary "rw"s (#10704)

Remove unnecessary "rw"s.

Diff
@@ -681,8 +681,8 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort*} {a b : α} (h : a
   · rw [dif_pos h₁, dif_pos h₂]
     cases h (h₂.symm.trans h₁)
   · rw [dif_pos h₁, dif_pos h₁, dif_neg h₂]
-  · rw [dif_neg h₁, dif_neg h₁, dif_pos h₂]
-  · rw [dif_neg h₁, dif_neg h₁, dif_neg h₂]
+  · rw [dif_neg h₁, dif_neg h₁]
+  · rw [dif_neg h₁, dif_neg h₁]
 #align function.update_comm Function.update_comm
 
 @[simp]
feat(Function): add FactorsThrough.comp_{left,right} (#10449)
  • Add Function.FactorsThrough.rfl, Function.FactorsThrough.comp_left, and Function.FactorsThrough.comp_right.
  • Fix a typo in the module docstring of Function/OfArity.
Diff
@@ -797,6 +797,20 @@ theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ 
 
 end Extend
 
+namespace FactorsThrough
+
+protected theorem rfl {f : α → β} : FactorsThrough f f := fun _ _ ↦ id
+
+theorem comp_left {f : α → β} {g : α → γ}  (h : FactorsThrough g f) (g' : γ → δ) :
+    FactorsThrough (g' ∘ g) f := fun _x _y hxy ↦
+  congr_arg g' (h hxy)
+
+theorem comp_right {f : α → β} {g : α → γ} (h : FactorsThrough g f) (g' : δ → α) :
+    FactorsThrough (g ∘ g') (f ∘ g') := fun _x _y hxy ↦
+  h hxy
+
+end FactorsThrough
+
 theorem uncurry_def {α β γ} (f : α → β → γ) : uncurry f = fun p ↦ f p.1 p.2 :=
   rfl
 #align function.uncurry_def Function.uncurry_def
feat: change Type to Sort in Algebra/Classes, fix some priorities (#10354)
Diff
@@ -23,7 +23,7 @@ namespace Function
 
 section
 
-variable {α β γ : Sort _} {f : α → β}
+variable {α β γ : Sort*} {f : α → β}
 
 /-- Evaluate a function at an argument. Useful if you want to talk about the partially applied
   `Function.eval x : (∀ x, β x) → β x`. -/
@@ -87,7 +87,7 @@ theorem Injective.eq_iff (I : Injective f) {a b : α} : f a = f b ↔ a = b :=
   ⟨@I _ _, congr_arg f⟩
 #align function.injective.eq_iff Function.Injective.eq_iff
 
-theorem Injective.beq_eq [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β]
+theorem Injective.beq_eq {α β : Type*} [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β] {f : α → β}
     (I : Injective f) {a b : α} : (f a == f b) = (a == b) := by
   by_cases h : a == b <;> simp [h] <;> simpa [I.eq_iff] using h
 
doc: @[inherit_doc] on notations (#9942)

Make all the notations that unambiguously should inherit the docstring of their definition actually inherit it.

Also write a few docstrings by hand. I only wrote the ones I was competent to write and which I was sure of. Some docstrings come from mathlib3 as they were lost during the early port.

This PR is only intended as a first pass There are many more docstrings to add.

Diff
@@ -854,7 +854,7 @@ class HasUncurry (α : Type*) (β : outParam (Type*)) (γ : outParam (Type*)) wh
   uncurry : α → β → γ
 #align function.has_uncurry Function.HasUncurry
 
-notation:arg "↿" x:arg => HasUncurry.uncurry x
+@[inherit_doc] notation:arg "↿" x:arg => HasUncurry.uncurry x
 
 instance hasUncurryBase : HasUncurry (α → β) α β :=
   ⟨id⟩
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Mario Carneiro
 -/
 import Mathlib.Logic.Nonempty
 import Mathlib.Init.Set
+import Mathlib.Logic.Basic
 
 #align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
 
chore(Function): rename some lemmas (#9738)
  • Merge Function.left_id and Function.comp.left_id into Function.id_comp.
  • Merge Function.right_id and Function.comp.right_id into Function.comp_id.
  • Merge Function.comp_const_right and Function.comp_const into Function.comp_const, use explicit arguments.
  • Move Function.const_comp to Mathlib.Init.Function, use explicit arguments.
Diff
@@ -37,16 +37,6 @@ theorem const_def {y : β} : (fun _ : α ↦ y) = const α y :=
   rfl
 #align function.const_def Function.const_def
 
-@[simp]
-theorem const_comp {f : α → β} {c : γ} : const β c ∘ f = const α c :=
-  rfl
-#align function.const_comp Function.const_comp
-
-@[simp]
-theorem comp_const {f : β → γ} {b : β} : f ∘ const α b = const α (f b) :=
-  rfl
-#align function.comp_const Function.comp_const
-
 theorem const_injective [Nonempty α] : Injective (const α : β → α → β) := fun y₁ y₂ h ↦
   let ⟨x⟩ := ‹Nonempty α›
   congr_fun h x
@@ -162,14 +152,13 @@ lemma Injective.dite (p : α → Prop) [DecidablePred p]
     {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
     (hf : Injective f) (hf' : Injective f')
     (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬ p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
-  Function.Injective (λ x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩) :=
-by intros x₁ x₂ h
-   dsimp only at h
-   by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
-   · rw [dif_pos h₁, dif_pos h₂] at h; injection (hf h)
-   · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
-   · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
-   · rw [dif_neg h₁, dif_neg h₂] at h; injection (hf' h)
+    Function.Injective (λ x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩) := fun x₁ x₂ h => by
+ dsimp only at h
+ by_cases h₁ : p x₁ <;> by_cases h₂ : p x₂
+ · rw [dif_pos h₁, dif_pos h₂] at h; injection (hf h)
+ · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
+ · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
+ · rw [dif_neg h₁, dif_neg h₂] at h; injection (hf' h)
 #align function.injective.dite Function.Injective.dite
 
 theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjective f := fun y ↦
@@ -400,8 +389,8 @@ theorem RightInverse.leftInverse_of_injective {f : α → β} {g : β → α} :
 theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
     (h₂ : RightInverse g₂ f) : g₁ = g₂ :=
   calc
-    g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp.right_id]
-     _ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, comp.left_id]
+    g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp_id]
+     _ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, id_comp]
 #align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverse
 
 attribute [local instance] Classical.propDecidable
@@ -802,7 +791,7 @@ theorem Injective.surjective_comp_right [Nonempty γ] (hf : Injective f) :
 theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ ↦ g ∘ f :=
   ⟨hf.surjective.injective_comp_right, fun g ↦
     ⟨g ∘ surjInv hf.surjective,
-     by simp only [comp.assoc g _ f, (leftInverse_surjInv hf).comp_eq_id, comp.right_id]⟩⟩
+     by simp only [comp.assoc g _ f, (leftInverse_surjInv hf).comp_eq_id, comp_id]⟩⟩
 #align function.bijective.comp_right Function.Bijective.comp_right
 
 end Extend
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -209,12 +209,12 @@ protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
 
 protected theorem Surjective.forall₂ (hf : Surjective f) {p : β → β → Prop} :
     (∀ y₁ y₂, p y₁ y₂) ↔ ∀ x₁ x₂, p (f x₁) (f x₂) :=
-  hf.forall.trans $ forall_congr' fun _ ↦ hf.forall
+  hf.forall.trans <| forall_congr' fun _ ↦ hf.forall
 #align function.surjective.forall₂ Function.Surjective.forall₂
 
 protected theorem Surjective.forall₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∀ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∀ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
-  hf.forall.trans $ forall_congr' fun _ ↦ hf.forall₂
+  hf.forall.trans <| forall_congr' fun _ ↦ hf.forall₂
 #align function.surjective.forall₃ Function.Surjective.forall₃
 
 protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
chore(*): drop $/<| before fun (#9361)

Subset of #9319

Diff
@@ -295,7 +295,7 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
 to `α`. -/
 theorem cantor_injective {α : Type*} (f : Set α → α) : ¬Injective f
   | i => cantor_surjective (fun a ↦ {b | ∀ U, a = f U → U b}) <|
-         RightInverse.surjective (λ U => Set.ext <| fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
+         RightInverse.surjective (λ U => Set.ext fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
 #align function.cantor_injective Function.cantor_injective
 
 /-- There is no surjection from `α : Type u` into `Type (max u v)`. This theorem
@@ -781,7 +781,7 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g 
 
 lemma FactorsThrough.extend_comp {g : α → γ} (e' : β → γ) (hf : FactorsThrough g f) :
     extend f g e' ∘ f = g :=
-  funext $ fun a => hf.extend_apply e' a
+  funext fun a => hf.extend_apply e' a
 #align function.factors_through.extend_comp Function.FactorsThrough.extend_comp
 
 @[simp]
chore: Nsmul -> NSMul, Zpow -> ZPow, etc (#9067)

Normalising to naming convention rule number 6.

Diff
@@ -196,7 +196,7 @@ theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
   ⟨fun S ↦ S.of_comp_left hf.1, hf.surjective.comp⟩
 #align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
 
-instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type*) [∀ hp, DecidableEq (α hp)] :
+instance decidableEqPFun (p : Prop) [Decidable p] (α : p → Type*) [∀ hp, DecidableEq (α hp)] :
     DecidableEq (∀ hp, α hp)
   | f, g => decidable_of_iff (∀ hp, f hp = g hp) funext_iff.symm
 
chore: Replace (· op ·) a by (a op ·) (#8843)

I used the regex \(\(· (.) ·\) (.)\), replacing with ($2 $1 ·).

Diff
@@ -150,7 +150,7 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
 
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
-    Function.Injective ((· ∘ ·) g : (α → β) → α → γ) :=
+    Function.Injective (g ∘ · : (α → β) → α → γ) :=
   fun _ _ hgf ↦ funext fun i ↦ hg <| (congr_fun hgf i : _)
 #align function.injective.comp_left Function.Injective.comp_left
 
@@ -539,13 +539,13 @@ theorem surjective_to_subsingleton [na : Nonempty α] [Subsingleton β] (f : α
 
 /-- Composition by a surjective function on the left is itself surjective. -/
 theorem Surjective.comp_left {g : β → γ} (hg : Surjective g) :
-    Surjective ((· ∘ ·) g : (α → β) → α → γ) := fun f ↦
+    Surjective (g ∘ · : (α → β) → α → γ) := fun f ↦
   ⟨surjInv hg ∘ f, funext fun _ ↦ rightInverse_surjInv _ _⟩
 #align function.surjective.comp_left Function.Surjective.comp_left
 
 /-- Composition by a bijective function on the left is itself bijective. -/
 theorem Bijective.comp_left {g : β → γ} (hg : Bijective g) :
-    Bijective ((· ∘ ·) g : (α → β) → α → γ) :=
+    Bijective (g ∘ · : (α → β) → α → γ) :=
   ⟨hg.injective.comp_left, hg.surjective.comp_left⟩
 #align function.bijective.comp_left Function.Bijective.comp_left
 
feat: extend results on product measures from sigma-finite to s-finite measures (#8713)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -765,27 +765,11 @@ lemma factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔
   fun h _ _ hf => by rw [Classical.choose_spec h, comp_apply, comp_apply, hf]⟩
 #align function.factors_through_iff Function.factorsThrough_iff
 
-lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
-    (F : γ → δ) (e' : β → γ) (b : β) :
-    F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b := by
-  by_cases hb : ∃ a, f a = b
-  case pos =>
-    rcases hb with ⟨a, ha⟩
-    subst b
-    rw [hf.extend_apply, FactorsThrough.extend_apply, comp]
-    case intro.hf =>
-      intro a b h
-      simp only [comp_apply]
-      apply congr_arg
-      exact hf h
-  case neg =>
-    rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb, comp]
-#align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
-
-lemma Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
+lemma apply_extend {δ} {g : α → γ} (F : γ → δ) (f : α → β) (e' : β → γ) (b : β) :
     F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
-  (hf.factorsThrough g).apply_extend F e' b
-#align function.injective.apply_extend Function.Injective.apply_extend
+  apply_dite F _ _ _
+#align function.factors_through.apply_extend Function.apply_extend
+#align function.injective.apply_extend Function.apply_extend
 
 theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g ↦ extend f g e' := by
   intro g₁ g₂ hg
feat: a relation is "function-like" iff it is given by (f · = ·) (#8190)

Partially inspired by this thread on Zulip.

Diff
@@ -934,6 +934,10 @@ protected theorem eq_iff {x y : α} : f x = y ↔ x = f y :=
 
 end Involutive
 
+@[simp]
+lemma symmetric_apply_eq_iff {f : α → α} : Symmetric (f · = ·) ↔ Involutive f := by
+  simp [Symmetric, Involutive]
+
 /-- The property of a binary function `f : α → β → γ` being injective.
 Mathematically this should be thought of as the corresponding function `α × β → γ` being injective.
 -/
@@ -1003,6 +1007,40 @@ end Sometimes
 
 end Function
 
+/-- A relation `r : α → β → Prop` is "function-like"
+(for each `a` there exists a unique `b` such that `r a b`)
+if and only if it is `(f · = ·)` for some function `f`. -/
+lemma forall_existsUnique_iff {r : α → β → Prop} :
+    (∀ a, ∃! b, r a b) ↔ ∃ f : α → β, ∀ {a b}, r a b ↔ f a = b := by
+  refine ⟨fun h ↦ ?_, ?_⟩
+  · refine ⟨fun a ↦ (h a).choose, fun hr ↦ ?_, fun h' ↦ h' ▸ ?_⟩
+    exacts [((h _).choose_spec.2 _ hr).symm, (h _).choose_spec.1]
+  · rintro ⟨f, hf⟩
+    simp [hf]
+
+/-- A relation `r : α → β → Prop` is "function-like"
+(for each `a` there exists a unique `b` such that `r a b`)
+if and only if it is `(f · = ·)` for some function `f`. -/
+lemma forall_existsUnique_iff' {r : α → β → Prop} :
+    (∀ a, ∃! b, r a b) ↔ ∃ f : α → β, r = (f · = ·) := by
+  simp [forall_existsUnique_iff, Function.funext_iff]
+
+/-- A symmetric relation `r : α → α → Prop` is "function-like"
+(for each `a` there exists a unique `b` such that `r a b`)
+if and only if it is `(f · = ·)` for some involutive function `f`. -/
+protected lemma Symmetric.forall_existsUnique_iff' {r : α → α → Prop} (hr : Symmetric r) :
+    (∀ a, ∃! b, r a b) ↔ ∃ f : α → α, Involutive f ∧ r = (f · = ·) := by
+  refine ⟨fun h ↦ ?_, fun ⟨f, _, hf⟩ ↦ forall_existsUnique_iff'.2 ⟨f, hf⟩⟩
+  rcases forall_existsUnique_iff'.1 h with ⟨f, rfl : r = _⟩
+  exact ⟨f, symmetric_apply_eq_iff.1 hr, rfl⟩
+
+/-- A symmetric relation `r : α → α → Prop` is "function-like"
+(for each `a` there exists a unique `b` such that `r a b`)
+if and only if it is `(f · = ·)` for some involutive function `f`. -/
+protected lemma Symmetric.forall_existsUnique_iff {r : α → α → Prop} (hr : Symmetric r) :
+    (∀ a, ∃! b, r a b) ↔ ∃ f : α → α, Involutive f ∧ ∀ {a b}, r a b ↔ f a = b := by
+  simp [hr.forall_existsUnique_iff', funext_iff]
+
 /-- `s.piecewise f g` is the function equal to `f` on the set `s`, and to `g` on its complement. -/
 def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i, β i)
     [∀ j, Decidable (j ∈ s)] : ∀ i, β i :=
feat: define updateFinset which updates a finite number components of a vector (#7341)
  • from the Sobolev project (formerly: marginal project)

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -674,6 +674,9 @@ theorem apply_update₂ {ι : Sort*} [DecidableEq ι] {α β γ : ι → Sort*}
   · simp [h]
 #align function.apply_update₂ Function.apply_update₂
 
+theorem pred_update (P : ∀ ⦃a⦄, β a → Prop) (f : ∀ a, β a) (a' : α) (v : β a') (a : α) :
+    P (update f a' v a) ↔ a = a' ∧ P v ∨ a ≠ a' ∧ P (f a) := by
+  rw [apply_update P, update_apply, ite_prop_iff_or]
 
 theorem comp_update {α' : Sort*} {β : Sort*} (f : α' → β) (g : α → α') (i : α) (v : α') :
     f ∘ update g i v = update (f ∘ g) i (f v) :=
chore: golf IsSplittingField.algEquiv (#8142)

Also golfs Normal.of_algEquiv and Algebra.IsIntegral.of_finite and refactors Algebra.IsAlgebraic.bijective_of_isScalarTower.

Diff
@@ -127,7 +127,7 @@ theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective
 #align function.injective.of_comp Function.Injective.of_comp
 
 @[simp]
-theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α) :
+theorem Injective.of_comp_iff (hf : Injective f) (g : γ → α) :
     Injective (f ∘ g) ↔ Injective g :=
   ⟨Injective.of_comp, hf.comp⟩
 #align function.injective.of_comp_iff Function.Injective.of_comp_iff
@@ -138,6 +138,10 @@ theorem Injective.of_comp_right {g : γ → α} (I : Injective (f ∘ g)) (hg :
   obtain ⟨y, rfl⟩ := hg y
   exact congr_arg g (I h)
 
+theorem Surjective.bijective₂_of_injective {g : γ → α} (hf : Surjective f) (hg : Surjective g)
+    (I : Injective (f ∘ g)) : Bijective f ∧ Bijective g :=
+  ⟨⟨I.of_comp_right hg, hf⟩, I.of_comp, hg⟩
+
 @[simp]
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
@@ -182,6 +186,10 @@ theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective
 theorem Surjective.of_comp_left {g : γ → α} (S : Surjective (f ∘ g)) (hf : Injective f) :
     Surjective g := fun a ↦ let ⟨c, hc⟩ := S (f a); ⟨c, hf hc⟩
 
+theorem Injective.bijective₂_of_surjective {g : γ → α} (hf : Injective f) (hg : Injective g)
+    (S : Surjective (f ∘ g)) : Bijective f ∧ Bijective g :=
+  ⟨⟨hf, S.of_comp⟩, hg, S.of_comp_left hf⟩
+
 @[simp]
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
feat: Galois orbits in a normal extension are determined by minimal polynomials (#8028)

Add Normal.minpoly_eq_iff_mem_orbit: addresses https://github.com/leanprover-community/mathlib4/pull/6718/files#r1328899532

Also generalize AlgHom.normal_bijective to Algebra.IsAlgebraic.bijective_of_isScalarTower' and golf the proof using a set-theoretic lemma Surjective.of_comp_left (slow to build, awaiting CI).

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -122,8 +122,8 @@ protected def Injective.decidableEq [DecidableEq β] (I : Injective f) : Decidab
   fun _ _ ↦ decidable_of_iff _ I.eq_iff
 #align function.injective.decidable_eq Function.Injective.decidableEq
 
-theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective g := fun x y h ↦
-  I <| show f (g x) = f (g y) from congr_arg f h
+theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective g :=
+  fun _ _ h ↦ I <| congr_arg f h
 #align function.injective.of_comp Function.Injective.of_comp
 
 @[simp]
@@ -132,13 +132,16 @@ theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α)
   ⟨Injective.of_comp, hf.comp⟩
 #align function.injective.of_comp_iff Function.Injective.of_comp_iff
 
+theorem Injective.of_comp_right {g : γ → α} (I : Injective (f ∘ g)) (hg : Surjective g) :
+    Injective f := fun x y h ↦ by
+  obtain ⟨x, rfl⟩ := hg x
+  obtain ⟨y, rfl⟩ := hg y
+  exact congr_arg g (I h)
+
 @[simp]
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
-⟨ λ h x y => let ⟨_, hx⟩ := hg.surjective x
-             let ⟨_, hy⟩ := hg.surjective y
-             hx ▸ hy ▸ λ hf => h hf ▸ rfl,
-  λ h => h.comp hg.injective⟩
+  ⟨fun I ↦ I.of_comp_right hg.2, fun h ↦ h.comp hg.injective⟩
 #align function.injective.of_comp_iff' Function.Injective.of_comp_iff'
 
 /-- Composition by an injective function on the left is itself injective. -/
@@ -176,13 +179,13 @@ theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective
   ⟨Surjective.of_comp, fun h ↦ h.comp hg⟩
 #align function.surjective.of_comp_iff Function.Surjective.of_comp_iff
 
+theorem Surjective.of_comp_left {g : γ → α} (S : Surjective (f ∘ g)) (hf : Injective f) :
+    Surjective g := fun a ↦ let ⟨c, hc⟩ := S (f a); ⟨c, hf hc⟩
+
 @[simp]
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
-  ⟨fun h x ↦
-    let ⟨x', hx'⟩ := h (f x)
-    ⟨x', hf.injective hx'⟩,
-    hf.surjective.comp⟩
+  ⟨fun S ↦ S.of_comp_left hf.1, hf.surjective.comp⟩
 #align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
 
 instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type*) [∀ hp, DecidableEq (α hp)] :
chore: remove many Type _ before the colon (#7718)

We have turned to Type* instead of Type _, but many of them remained in mathlib because the straight replacement did not work. In general, having Type _ before the colon is a code smell, though, as it hides which types should be in the same universe and which shouldn't, and is not very robust.

This PR replaces most of the remaining Type _ before the colon (except those in category theory) by Type* or Type u. This has uncovered a few bugs (where declarations were not as polymorphic as they should be).

I had to increase heartbeats at two places when replacing Type _ by Type*, but I think it's worth it as it's really more robust.

Diff
@@ -1031,7 +1031,7 @@ theorem eq_rec_inj {α : Sort*} {a a' : α} (h : a = a') {C : α → Type*} (x y
 #align eq_rec_inj eq_rec_inj
 
 @[simp]
-theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y ↔ x = y :=
+theorem cast_inj {α β : Type u} (h : α = β) {x y : α} : cast h x = cast h y ↔ x = y :=
   (cast_bijective h).injective.eq_iff
 #align cast_inj cast_inj
 
doc: Clarify the use case of Function.extend (#7547)

Confusion was recently expressed so as to how to use Function.extend. This is an attempt to clear it up.

Also fix the name of Injective.factorsThrough.

Diff
@@ -696,15 +696,20 @@ attribute [local instance] Classical.propDecidable
 
 variable {α β γ : Sort*} {f : α → β}
 
-/-- `extend f g e'` extends a function `g : α → γ`
-along a function `f : α → β` to a function `β → γ`,
-by using the values of `g` on the range of `f`
-and the values of an auxiliary function `e' : β → γ` elsewhere.
+/-- Extension of a function `g : α → γ` along a function `f : α → β`.
 
-Mostly useful when `f` is injective, or more generally when `g.factors_through f` -/
--- Explicit Sort so that `α` isn't inferred to be Prop via `exists_prop_decidable`
-def extend {α : Sort u} {β γ} (f : α → β) (g : α → γ) (e' : β → γ) : β → γ := fun b ↦
-  if h : ∃ a, f a = b then g (Classical.choose h) else e' b
+For every `a : α`, `f a` is sent to `g a`. `f` might not be surjective, so we use an auxiliary
+function `j : β → γ` by sending `b : β` not in the range of `f` to `j b`. If you do not care about
+the behavior outside the range, `j` can be used as a junk value by setting it to be `0` or
+`Classical.arbitrary` (assuming `γ` is nonempty).
+
+This definition is mathematically meaningful only when `f a₁ = f a₂ → g a₁ = g a₂` (spelled
+`g.FactorsThrough f`). In particular this holds if `f` is injective.
+
+A typical use case is extending a function from a subtype to the entire type. If you wish to extend
+`g : {b : β // p b} → γ` to a function `β → γ`, you should use `Function.extend Subtype.val g j`. -/
+def extend (f : α → β) (g : α → γ) (j : β → γ) : β → γ := fun b ↦
+  if h : ∃ a, f a = b then g (Classical.choose h) else j b
 #align function.extend Function.extend
 
 /-- g factors through f : `f a = f b → g a = g b` -/
@@ -718,9 +723,9 @@ theorem extend_def (f : α → β) (g : α → γ) (e' : β → γ) (b : β) [De
   congr
 #align function.extend_def Function.extend_def
 
-lemma Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f :=
+lemma Injective.factorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f :=
   fun _ _ h => congr_arg g (hf h)
-#align function.injective.factors_through Function.Injective.FactorsThrough
+#align function.injective.factors_through Function.Injective.factorsThrough
 
 lemma FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a := by
@@ -731,7 +736,7 @@ lemma FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e'
 @[simp]
 theorem Injective.extend_apply (hf : Injective f) (g : α → γ) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
-  (hf.FactorsThrough g).extend_apply e' a
+  (hf.factorsThrough g).extend_apply e' a
 #align function.injective.extend_apply Function.Injective.extend_apply
 
 @[simp]
@@ -765,7 +770,7 @@ lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
 
 lemma Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
     F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
-  (hf.FactorsThrough g).apply_extend F e' b
+  (hf.factorsThrough g).apply_extend F e' b
 #align function.injective.apply_extend Function.Injective.apply_extend
 
 theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g ↦ extend f g e' := by
chore: exactly 4 spaces in theorems (#7328)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -68,7 +68,7 @@ theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f
 #align function.on_fun_apply Function.onFun_apply
 
 lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
-  (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
+    (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
   subst hα
   have : ∀a, HEq (f a) (f' a) := λ a => h a a (HEq.refl a)
   have : β = β' := by funext a
@@ -152,9 +152,9 @@ theorem injective_of_subsingleton [Subsingleton α] (f : α → β) : Injective
 #align function.injective_of_subsingleton Function.injective_of_subsingleton
 
 lemma Injective.dite (p : α → Prop) [DecidablePred p]
-  {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
-  (hf : Injective f) (hf' : Injective f')
-  (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬ p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
+    {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
+    (hf : Injective f) (hf' : Injective f')
+    (im_disj : ∀ {x x' : α} {hx : p x} {hx' : ¬ p x'}, f ⟨x, hx⟩ ≠ f' ⟨x', hx'⟩) :
   Function.Injective (λ x => if h : p x then f ⟨x, h⟩ else f' ⟨x, h⟩) :=
 by intros x₁ x₂ h
    dsimp only at h
@@ -747,8 +747,8 @@ lemma factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔
 #align function.factors_through_iff Function.factorsThrough_iff
 
 lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
-  (F : γ → δ) (e' : β → γ) (b : β) :
-  F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b := by
+    (F : γ → δ) (e' : β → γ) (b : β) :
+    F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b := by
   by_cases hb : ∃ a, f a = b
   case pos =>
     rcases hb with ⟨a, ha⟩
chore: only four spaces for subsequent lines (#7286)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -584,7 +584,7 @@ theorem update_injective (f : ∀ a, β a) (a' : α) : Injective (update f a') :
 #align function.update_injective Function.update_injective
 
 lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a → Prop) :
-  (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ x, x ≠ a → p x (f x) := by
+    (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ x, x ≠ a → p x (f x) := by
   rw [← and_forall_ne a, update_same]
   simp (config := { contextual := true })
 #align function.forall_update_iff Function.forall_update_iff
@@ -723,7 +723,7 @@ lemma Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThr
 #align function.injective.factors_through Function.Injective.FactorsThrough
 
 lemma FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
-  extend f g e' (f a) = g a := by
+    extend f g e' (f a) = g a := by
   simp only [extend_def, dif_pos, exists_apply_eq_apply]
   exact hf (Classical.choose_spec (exists_apply_eq_apply f a))
 #align function.factors_through.extend_apply Function.FactorsThrough.extend_apply
@@ -740,8 +740,7 @@ theorem extend_apply' (g : α → γ) (e' : β → γ) (b : β) (hb : ¬∃ a, f
   simp [Function.extend_def, hb]
 #align function.extend_apply' Function.extend_apply'
 
-lemma factorsThrough_iff (g : α → γ) [Nonempty γ] :
-  g.FactorsThrough f ↔ ∃ (e : β → γ), g = e ∘ f :=
+lemma factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔ ∃ (e : β → γ), g = e ∘ f :=
 ⟨fun hf => ⟨extend f g (const β (Classical.arbitrary γ)),
       funext (fun x => by simp only [comp_apply, hf.extend_apply])⟩,
   fun h _ _ hf => by rw [Classical.choose_spec h, comp_apply, comp_apply, hf]⟩
@@ -765,7 +764,7 @@ lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
 #align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
 
 lemma Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
-  F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
+    F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   (hf.FactorsThrough g).apply_extend F e' b
 #align function.injective.apply_extend Function.Injective.apply_extend
 
@@ -778,7 +777,7 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g 
 #align function.extend_injective Function.extend_injective
 
 lemma FactorsThrough.extend_comp {g : α → γ} (e' : β → γ) (hf : FactorsThrough g f) :
-  extend f g e' ∘ f = g :=
+    extend f g e' ∘ f = g :=
   funext $ fun a => hf.extend_apply e' a
 #align function.factors_through.extend_comp Function.FactorsThrough.extend_comp
 
feat: add Function.update_eq_const and eq_const_of_subsingleton (#7275)

Also golf Function.update_apply.

Diff
@@ -551,23 +551,27 @@ def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
   if h : a = a' then Eq.ndrec v h.symm else f a
 #align function.update Function.update
 
-/-- On non-dependent functions, `Function.update` can be expressed as an `ite` -/
-theorem update_apply {β : Sort*} (f : α → β) (a' : α) (b : β) (a : α) :
-    update f a' b a = if a = a' then b else f a :=
-by have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
-     by intro h
-        rw [eq_rec_constant]
-   have h3 : (λ h : a = a' => Eq.rec (motive := λ _ _ => β) b h.symm) =
-             (λ _ : a = a' => b) := funext h2
-   let f := λ x => dite (a = a') x (λ (_: ¬ a = a') => (f a))
-   exact congrArg f h3
-#align function.update_apply Function.update_apply
-
 @[simp]
 theorem update_same (a : α) (v : β a) (f : ∀ a, β a) : update f a v a = v :=
   dif_pos rfl
 #align function.update_same Function.update_same
 
+@[simp]
+theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) : update f a' v a = f a :=
+  dif_neg h
+#align function.update_noteq Function.update_noteq
+
+/-- On non-dependent functions, `Function.update` can be expressed as an `ite` -/
+theorem update_apply {β : Sort*} (f : α → β) (a' : α) (b : β) (a : α) :
+    update f a' b a = if a = a' then b else f a := by
+  rcases Decidable.eq_or_ne a a' with rfl | hne <;> simp [*]
+#align function.update_apply Function.update_apply
+
+@[nontriviality]
+theorem update_eq_const_of_subsingleton [Subsingleton α] (a : α) (v : α') (f : α → α') :
+    update f a v = const α v :=
+  funext fun a' ↦ Subsingleton.elim a a' ▸ update_same _ _ _
+
 theorem surjective_eval {α : Sort u} {β : α → Sort v} [h : ∀ a, Nonempty (β a)] (a : α) :
     Surjective (eval a : (∀ a, β a) → β a) := fun b ↦
   ⟨@update _ _ (Classical.decEq α) (fun a ↦ (h a).some) a b,
@@ -579,11 +583,6 @@ theorem update_injective (f : ∀ a, β a) (a' : α) : Injective (update f a') :
   rwa [update_same, update_same] at this
 #align function.update_injective Function.update_injective
 
-@[simp]
-theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) : update f a' v a = f a :=
-  dif_neg h
-#align function.update_noteq Function.update_noteq
-
 lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a → Prop) :
   (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ x, x ≠ a → p x (f x) := by
   rw [← and_forall_ne a, update_same]
chore: avoid using cases' early (#6997)

This will help with my cleanup of the early library, facilitating moving tactics upstream.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
 -/
 import Mathlib.Logic.Nonempty
-import Mathlib.Tactic.Cases
 import Mathlib.Init.Set
 
 #align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
@@ -293,7 +292,7 @@ theorem cantor_injective {α : Type*} (f : Set α → α) : ¬Injective f
 theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjective f := by
   intro hf
   let T : Type max u v := Sigma f
-  cases' hf (Set T) with U hU
+  cases hf (Set T) with | intro U hU =>
   let g : Set T → T := fun s ↦ ⟨U, cast hU.symm s⟩
   have hg : Injective g := by
     intro s t h
chore: cleanup in Mathlib.Init (#6977)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
 -/
 import Mathlib.Logic.Nonempty
-import Mathlib.Init.Data.Nat.Lemmas
+import Mathlib.Tactic.Cases
 import Mathlib.Init.Set
 
 #align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
@@ -879,10 +879,6 @@ def Involutive {α} (f : α → α) : Prop :=
   ∀ x, f (f x) = x
 #align function.involutive Function.Involutive
 
-theorem involutive_iff_iter_2_eq_id {α} {f : α → α} : Involutive f ↔ f^[2] = id :=
-  funext_iff.symm
-#align function.involutive_iff_iter_2_eq_id Function.involutive_iff_iter_2_eq_id
-
 theorem _root_.Bool.involutive_not : Involutive not :=
   Bool.not_not
 
fix: disable autoImplicit globally (#6528)

Autoimplicits are highly controversial and also defeat the performance-improving work in #6474.

The intent of this PR is to make autoImplicit opt-in on a per-file basis, by disabling it in the lakefile and enabling it again with set_option autoImplicit true in the few files that rely on it.

That also keeps this PR small, as opposed to attempting to "fix" files to not need it any more.

I claim that many of the uses of autoImplicit in these files are accidental; situations such as:

  • Assuming variables are in scope, but pasting the lemma in the wrong section
  • Pasting in a lemma from a scratch file without checking to see if the variable names are consistent with the rest of the file
  • Making a copy-paste error between lemmas and forgetting to add an explicit arguments.

Having set_option autoImplicit false as the default prevents these types of mistake being made in the 90% of files where autoImplicits are not used at all, and causes them to be caught by CI during review.

I think there were various points during the port where we encouraged porters to delete the universes u v lines; I think having autoparams for universe variables only would cover a lot of the cases we actually use them, while avoiding any real shortcomings.

A Zulip poll (after combining overlapping votes accordingly) was in favor of this change with 5:5:18 as the no:dontcare:yes vote ratio.

While this PR was being reviewed, a handful of files gained some more likely-accidental autoImplicits. In these places, set_option autoImplicit true has been placed locally within a section, rather than at the top of the file.

Diff
@@ -13,6 +13,8 @@ import Mathlib.Init.Set
 # Miscellaneous function constructions and lemmas
 -/
 
+set_option autoImplicit true
+
 open Function
 
 universe u v w
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -25,10 +25,10 @@ variable {α β γ : Sort _} {f : α → β}
 
 /-- Evaluate a function at an argument. Useful if you want to talk about the partially applied
   `Function.eval x : (∀ x, β x) → β x`. -/
-@[reducible, simp] def eval {β : α → Sort _} (x : α) (f : ∀ x, β x) : β x := f x
+@[reducible, simp] def eval {β : α → Sort*} (x : α) (f : ∀ x, β x) : β x := f x
 #align function.eval Function.eval
 
-theorem eval_apply {β : α → Sort _} (x : α) (f : ∀ x, β x) : eval x f = f x :=
+theorem eval_apply {β : α → Sort*} (x : α) (f : ∀ x, β x) : eval x f = f x :=
   rfl
 #align function.eval_apply Function.eval_apply
 
@@ -78,11 +78,11 @@ lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f :
   exact eq_of_heq (this a)
 #align function.hfunext Function.hfunext
 
-theorem funext_iff {β : α → Sort _} {f₁ f₂ : ∀ x : α, β x} : f₁ = f₂ ↔ ∀ a, f₁ a = f₂ a :=
+theorem funext_iff {β : α → Sort*} {f₁ f₂ : ∀ x : α, β x} : f₁ = f₂ ↔ ∀ a, f₁ a = f₂ a :=
   Iff.intro (fun h _ ↦ h ▸ rfl) funext
 #align function.funext_iff Function.funext_iff
 
-theorem ne_iff {β : α → Sort _} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔ ∃ a, f₁ a ≠ f₂ a :=
+theorem ne_iff {β : α → Sort*} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔ ∃ a, f₁ a ≠ f₂ a :=
   funext_iff.not.trans not_forall
 #align function.ne_iff Function.ne_iff
 
@@ -184,7 +184,7 @@ theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     hf.surjective.comp⟩
 #align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
 
-instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, DecidableEq (α hp)] :
+instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type*) [∀ hp, DecidableEq (α hp)] :
     DecidableEq (∀ hp, α hp)
   | f, g => decidable_of_iff (∀ hp, f hp = g hp) funext_iff.symm
 
@@ -281,7 +281,7 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
 
 /-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
 to `α`. -/
-theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Injective f
+theorem cantor_injective {α : Type*} (f : Set α → α) : ¬Injective f
   | i => cantor_surjective (fun a ↦ {b | ∀ U, a = f U → U b}) <|
          RightInverse.surjective (λ U => Set.ext <| fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
 #align function.cantor_injective Function.cantor_injective
@@ -423,7 +423,7 @@ end
 
 section InvFun
 
-variable {α β : Sort _} [Nonempty α] {f : α → β} {a : α} {b : β}
+variable {α β : Sort*} [Nonempty α] {f : α → β} {a : α} {b : β}
 
 attribute [local instance] Classical.propDecidable
 
@@ -551,7 +551,7 @@ def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
 #align function.update Function.update
 
 /-- On non-dependent functions, `Function.update` can be expressed as an `ite` -/
-theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
+theorem update_apply {β : Sort*} (f : α → β) (a' : α) (b : β) (a : α) :
     update f a' b a = if a = a' then b else f a :=
 by have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
      by intro h
@@ -628,7 +628,7 @@ theorem update_comp_eq_of_forall_ne' {α'} (g : ∀ a, β a) {f : α' → α} {i
 #align function.update_comp_eq_of_forall_ne' Function.update_comp_eq_of_forall_ne'
 
 /-- Non-dependent version of `Function.update_comp_eq_of_forall_ne'` -/
-theorem update_comp_eq_of_forall_ne {α β : Sort _} (g : α' → β) {f : α → α'} {i : α'} (a : β)
+theorem update_comp_eq_of_forall_ne {α β : Sort*} (g : α' → β) {f : α → α'} {i : α'} (a : β)
     (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f :=
   update_comp_eq_of_forall_ne' g a h
 #align function.update_comp_eq_of_forall_ne Function.update_comp_eq_of_forall_ne
@@ -639,13 +639,13 @@ theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Fu
 #align function.update_comp_eq_of_injective' Function.update_comp_eq_of_injective'
 
 /-- Non-dependent version of `Function.update_comp_eq_of_injective'` -/
-theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → α'}
+theorem update_comp_eq_of_injective {β : Sort*} (g : α' → β) {f : α → α'}
     (hf : Function.Injective f) (i : α) (a : β) :
     Function.update g (f i) a ∘ f = Function.update (g ∘ f) i a :=
   update_comp_eq_of_injective' g hf i a
 #align function.update_comp_eq_of_injective Function.update_comp_eq_of_injective
 
-theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f : ∀ i, α i → β i)
+theorem apply_update {ι : Sort*} [DecidableEq ι] {α β : ι → Sort*} (f : ∀ i, α i → β i)
     (g : ∀ i, α i) (i : ι) (v : α i) (j : ι) :
     f j (update g i v j) = update (fun k ↦ f k (g k)) i (f i v) j := by
   by_cases h:j = i
@@ -654,7 +654,7 @@ theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f :
   · simp [h]
 #align function.apply_update Function.apply_update
 
-theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _} (f : ∀ i, α i → β i → γ i)
+theorem apply_update₂ {ι : Sort*} [DecidableEq ι] {α β γ : ι → Sort*} (f : ∀ i, α i → β i → γ i)
     (g : ∀ i, α i) (h : ∀ i, β i) (i : ι) (v : α i) (w : β i) (j : ι) :
     f j (update g i v j) (update h i w j) = update (fun k ↦ f k (g k) (h k)) i (f i v w) j := by
   by_cases h:j = i
@@ -664,12 +664,12 @@ theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _
 #align function.apply_update₂ Function.apply_update₂
 
 
-theorem comp_update {α' : Sort _} {β : Sort _} (f : α' → β) (g : α → α') (i : α) (v : α') :
+theorem comp_update {α' : Sort*} {β : Sort*} (f : α' → β) (g : α → α') (i : α) (v : α') :
     f ∘ update g i v = update (f ∘ g) i (f v) :=
   funext <| apply_update _ _ _ _
 #align function.comp_update Function.comp_update
 
-theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
+theorem update_comm {α} [DecidableEq α] {β : α → Sort*} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
     (f : ∀ a, β a) : update (update f a v) b w = update (update f b w) a v := by
   funext c
   simp only [update]
@@ -682,7 +682,7 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a
 #align function.update_comm Function.update_comm
 
 @[simp]
-theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
+theorem update_idem {α} [DecidableEq α] {β : α → Sort*} {a : α} (v w : β a) (f : ∀ a, β a) :
     update (update f a v) a w = update f a w := by
   funext b
   by_cases h : b = a <;> simp [update, h]
@@ -694,7 +694,7 @@ noncomputable section Extend
 
 attribute [local instance] Classical.propDecidable
 
-variable {α β γ : Sort _} {f : α → β}
+variable {α β γ : Sort*} {f : α → β}
 
 /-- `extend f g e'` extends a function `g : α → γ`
 along a function `f : α → β` to a function `β → γ`,
@@ -821,7 +821,7 @@ theorem curry_apply {α β γ} (f : α × β → γ) (x : α) (y : β) : curry f
 
 section Bicomp
 
-variable {α β γ δ ε : Type _}
+variable {α β γ δ ε : Type*}
 
 /-- Compose a binary function `f` with a pair of unary functions `g` and `h`.
 If both arguments of `f` have the same type and `g = h`, then `bicompl f g g = f on g`. -/
@@ -850,12 +850,12 @@ end Bicomp
 
 section Uncurry
 
-variable {α β γ δ : Type _}
+variable {α β γ δ : Type*}
 
 /-- Records a way to turn an element of `α` into a function from `β` to `γ`. The most generic use
 is to recursively uncurry. For instance `f : α → β → γ → δ` will be turned into
 `↿f : α × β × γ → δ`. One can also add instances for bundled maps. -/
-class HasUncurry (α : Type _) (β : outParam (Type _)) (γ : outParam (Type _)) where
+class HasUncurry (α : Type*) (β : outParam (Type*)) (γ : outParam (Type*)) where
   /-- Uncurrying operator. The most generic use is to recursively uncurry. For instance
   `f : α → β → γ → δ` will be turned into `↿f : α × β × γ → δ`. One can also add instances
   for bundled maps.-/
@@ -929,7 +929,7 @@ def Injective2 {α β γ} (f : α → β → γ) : Prop :=
 
 namespace Injective2
 
-variable {α β γ : Sort _} {f : α → β → γ}
+variable {α β γ : Sort*} {f : α → β → γ}
 
 /-- A binary injective function is injective when only the left argument varies. -/
 protected theorem left (hf : Injective2 f) (b : β) : Function.Injective fun a ↦ f a b :=
@@ -941,7 +941,7 @@ protected theorem right (hf : Injective2 f) (a : α) : Function.Injective (f a)
   fun _ _ h ↦ (hf h).right
 #align function.injective2.right Function.Injective2.right
 
-protected theorem uncurry {α β γ : Type _} {f : α → β → γ} (hf : Injective2 f) :
+protected theorem uncurry {α β γ : Type*} {f : α → β → γ} (hf : Injective2 f) :
     Function.Injective (uncurry f) :=
   fun ⟨_, _⟩ ⟨_, _⟩ h ↦ (hf h).elim (congr_arg₂ _)
 #align function.injective2.uncurry Function.Injective2.uncurry
@@ -998,7 +998,7 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 /-! ### Bijectivity of `Eq.rec`, `Eq.mp`, `Eq.mpr`, and `cast` -/
 
 
-theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
+theorem eq_rec_on_bijective {α : Sort*} {C : α → Sort*} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.ndrec _ _ C · _ h)
   | _, _, rfl => ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align eq_rec_on_bijective eq_rec_on_bijective
@@ -1020,12 +1020,12 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align cast_bijective cast_bijective
 
-/-! Note these lemmas apply to `Type _` not `Sort*`, as the latter interferes with `simp`, and
+/-! Note these lemmas apply to `Type*` not `Sort*`, as the latter interferes with `simp`, and
 is trivial anyway.-/
 
 
 @[simp]
-theorem eq_rec_inj {α : Sort _} {a a' : α} (h : a = a') {C : α → Type _} (x y : C a) :
+theorem eq_rec_inj {α : Sort*} {a a' : α} (h : a = a') {C : α → Type*} (x y : C a) :
     (Eq.ndrec x h : C a') = Eq.ndrec y h ↔ x = y :=
   (eq_rec_on_bijective h).injective.eq_iff
 #align eq_rec_inj eq_rec_inj
@@ -1035,21 +1035,21 @@ theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y
   (cast_bijective h).injective.eq_iff
 #align cast_inj cast_inj
 
-theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.eq_rec_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).rec (C (g (f a)))` for LHS
     @Eq.rec β (f (g (f a))) (fun x _ ↦ γ x) (C (g (f a))) (f a) (congr_arg f (h a)) = C a :=
   eq_of_heq <| (eq_rec_heq _ _).trans <| by rw [h]
 #align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eq
 
-theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).recOn (C (g (f a)))` for LHS
     @Eq.recOn β (f (g (f a))) (fun x _ ↦ γ x) (f a) (congr_arg f (h a)) (C (g (f a))) = C a :=
   h.eq_rec_eq _ _
 #align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eq
 
-theorem Function.LeftInverse.cast_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
+theorem Function.LeftInverse.cast_eq {α β : Sort*} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     cast (congr_arg (fun a ↦ γ (f a)) (h a)) (C (g (f a))) = C a := by
   rw [cast_eq_iff_heq, h]
@@ -1057,7 +1057,7 @@ theorem Function.LeftInverse.cast_eq {α β : Sort _} {γ : β → Sort v} {f :
 
 /-- A set of functions "separates points"
 if for each pair of distinct points there is a function taking different values on them. -/
-def Set.SeparatesPoints {α β : Type _} (A : Set (α → β)) : Prop :=
+def Set.SeparatesPoints {α β : Type*} (A : Set (α → β)) : Prop :=
   ∀ ⦃x y : α⦄, x ≠ y → ∃ f ∈ A, (f x : β) ≠ f y
 #align set.separates_points Set.SeparatesPoints
 
@@ -1070,10 +1070,10 @@ theorem InvImage.equivalence {α : Sort u} {β : Sort v} (r : β → β → Prop
   ⟨fun _ ↦ h.1 _, fun w ↦ h.symm w, fun h₁ h₂ ↦ InvImage.trans r f (fun _ _ _ ↦ h.trans) h₁ h₂⟩
 #align inv_image.equivalence InvImage.equivalence
 
-instance {α β : Type _} {r : α → β → Prop} {x : α × β} [Decidable (r x.1 x.2)] :
+instance {α β : Type*} {r : α → β → Prop} {x : α × β} [Decidable (r x.1 x.2)] :
   Decidable (uncurry r x) :=
 ‹Decidable _›
 
-instance {α β : Type _} {r : α × β → Prop} {a : α} {b : β} [Decidable (r (a, b))] :
+instance {α β : Type*} {r : α × β → Prop} {a : α} {b : β} [Decidable (r (a, b))] :
   Decidable (curry r a b) :=
 ‹Decidable _›
chore(Logic/Function/Basic): @[simp] lemmas (#6303)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -125,11 +125,13 @@ theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective
   I <| show f (g x) = f (g y) from congr_arg f h
 #align function.injective.of_comp Function.Injective.of_comp
 
+@[simp]
 theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α) :
     Injective (f ∘ g) ↔ Injective g :=
   ⟨Injective.of_comp, hf.comp⟩
 #align function.injective.of_comp_iff Function.Injective.of_comp_iff
 
+@[simp]
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
 ⟨ λ h x y => let ⟨_, hx⟩ := hg.surjective x
@@ -167,11 +169,13 @@ theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjecti
   ⟨g x, h⟩
 #align function.surjective.of_comp Function.Surjective.of_comp
 
+@[simp]
 theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective g) :
     Surjective (f ∘ g) ↔ Surjective f :=
   ⟨Surjective.of_comp, fun h ↦ h.comp hg⟩
 #align function.surjective.of_comp_iff Function.Surjective.of_comp_iff
 
+@[simp]
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
   ⟨fun h x ↦
feat: generalize universes for connected categories (#6237)
Diff
@@ -434,6 +434,10 @@ theorem invFun_eq (h : ∃ a, f a = b) : f (invFun f b) = b :=
   by simp only [invFun, dif_pos h, h.choose_spec]
 #align function.inv_fun_eq Function.invFun_eq
 
+theorem apply_invFun_apply {α : Type u₁} {β : Type u₂} {f : α → β} {a : α} :
+    f (@invFun _ _ ⟨a⟩ f (f a)) = f a :=
+  @invFun_eq _ _ ⟨a⟩ _ _ ⟨_, rfl⟩
+
 theorem invFun_neg (h : ¬∃ a, f a = b) : invFun f b = Classical.choice ‹_› :=
   dif_neg h
 #align function.inv_fun_neg Function.invFun_neg
chore: fix some Set defeq abuse, golf (#6114)
  • Use {x | p x} instead of fun x ↦ p x to define a set here and there.
  • Golf some proofs.
  • Replace Con.ker_apply_eq_preimage with Con.ker_apply. The old version used to abuse definitional equality between Set M and M → Prop.
  • Fix Submonoid.mk* lemmas to use ⟨_, _⟩, not ⟨⟨_, _⟩, _⟩.
Diff
@@ -271,19 +271,18 @@ theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α
 /-- **Cantor's diagonal argument** implies that there are no surjective functions from `α`
 to `Set α`. -/
 theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
-  | h => let ⟨D, e⟩ := h (λ a => ¬ f a a)
-        (@iff_not_self (f D D)) $ iff_of_eq (congr_fun e D)
+  | h => let ⟨D, e⟩ := h {a | ¬ f a a}
+        @iff_not_self (D ∈ f D) <| iff_of_eq <| congr_arg (D ∈ ·) e
 #align function.cantor_surjective Function.cantor_surjective
 
 /-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
 to `α`. -/
 theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Injective f
-  | i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
-        RightInverse.surjective
-          (λ U => funext $ λ _a => propext ⟨λ h => h U rfl, λ h' _U e => i e ▸ h'⟩)
+  | i => cantor_surjective (fun a ↦ {b | ∀ U, a = f U → U b}) <|
+         RightInverse.surjective (λ U => Set.ext <| fun _ ↦ ⟨fun h ↦ h U rfl, fun h _ e ↦ i e ▸ h⟩)
 #align function.cantor_injective Function.cantor_injective
 
-/-- There is no surjection from `α : Type u` into `Type u`. This theorem
+/-- There is no surjection from `α : Type u` into `Type (max u v)`. This theorem
   demonstrates why `Type : Type` would be inconsistent in Lean. -/
 theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjective f := by
   intro hf
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2016 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
-
-! This file was ported from Lean 3 source module logic.function.basic
-! leanprover-community/mathlib commit 29cb56a7b35f72758b05a30490e1f10bd62c35c1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Logic.Nonempty
 import Mathlib.Init.Data.Nat.Lemmas
 import Mathlib.Init.Set
 
+#align_import logic.function.basic from "leanprover-community/mathlib"@"29cb56a7b35f72758b05a30490e1f10bd62c35c1"
+
 /-!
 # Miscellaneous function constructions and lemmas
 -/
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -553,7 +553,7 @@ by have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
      by intro h
         rw [eq_rec_constant]
    have h3 : (λ h : a = a' => Eq.rec (motive := λ _ _ => β) b h.symm) =
-             (λ _ : a = a' =>  b) := funext h2
+             (λ _ : a = a' => b) := funext h2
    let f := λ x => dite (a = a') x (λ (_: ¬ a = a') => (f a))
    exact congrArg f h3
 #align function.update_apply Function.update_apply
feat: count_heartbeats in command (#5365)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -11,7 +11,6 @@ Authors: Johannes Hölzl, Mario Carneiro
 import Mathlib.Logic.Nonempty
 import Mathlib.Init.Data.Nat.Lemmas
 import Mathlib.Init.Set
-import Mathlib.Util.WhatsNew
 
 /-!
 # Miscellaneous function constructions and lemmas
chore: tidy various files (#5268)
Diff
@@ -603,14 +603,16 @@ theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
 #align function.eq_update_iff Function.eq_update_iff
 
 @[simp] lemma update_eq_self_iff : update f a b = f ↔ b = f a := by simp [update_eq_iff]
+#align function.update_eq_self_iff Function.update_eq_self_iff
+
 @[simp] lemma eq_update_self_iff : f = update f a b ↔ f a = b := by simp [eq_update_iff]
 #align function.eq_update_self_iff Function.eq_update_self_iff
-#align function.update_eq_self_iff Function.update_eq_self_iff
 
 lemma ne_update_self_iff : f ≠ update f a b ↔ f a ≠ b := eq_update_self_iff.not
+#align function.ne_update_self_iff Function.ne_update_self_iff
+
 lemma update_ne_self_iff : update f a b ≠ f ↔ b ≠ f a := update_eq_self_iff.not
 #align function.update_ne_self_iff Function.update_ne_self_iff
-#align function.ne_update_self_iff Function.ne_update_self_iff
 
 @[simp]
 theorem update_eq_self (a : α) (f : ∀ a, β a) : update f a (f a) = f :=
@@ -990,7 +992,7 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
   fun i ↦ if i ∈ s then f i else g i
 #align set.piecewise Set.piecewise
 
-/-! ### Bijectivity of `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` -/
+/-! ### Bijectivity of `Eq.rec`, `Eq.mp`, `Eq.mpr`, and `cast` -/
 
 
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
chore: fix backtick in docs (#5077)

I wrote a script to find lines that contain an odd number of backticks

Diff
@@ -1000,7 +1000,7 @@ theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
 
 theorem eq_mp_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mp h) := by
   -- TODO: mathlib3 uses `eq_rec_on_bijective`, difference in elaboration here
-  -- due to `@[macro_inline] possibly?
+  -- due to `@[macro_inline]` possibly?
   cases h
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 #align eq_mp_bijective eq_mp_bijective
chore: fix grammar 2/3 (#5002)

Part 2 of #5001

Diff
@@ -522,13 +522,13 @@ theorem surjective_to_subsingleton [na : Nonempty α] [Subsingleton β] (f : α
   fun _ ↦ let ⟨a⟩ := na; ⟨a, Subsingleton.elim _ _⟩
 #align function.surjective_to_subsingleton Function.surjective_to_subsingleton
 
-/-- Composition by an surjective function on the left is itself surjective. -/
+/-- Composition by a surjective function on the left is itself surjective. -/
 theorem Surjective.comp_left {g : β → γ} (hg : Surjective g) :
     Surjective ((· ∘ ·) g : (α → β) → α → γ) := fun f ↦
   ⟨surjInv hg ∘ f, funext fun _ ↦ rightInverse_surjInv _ _⟩
 #align function.surjective.comp_left Function.Surjective.comp_left
 
-/-- Composition by an bijective function on the left is itself bijective. -/
+/-- Composition by a bijective function on the left is itself bijective. -/
 theorem Bijective.comp_left {g : β → γ} (hg : Bijective g) :
     Bijective ((· ∘ ·) g : (α → β) → α → γ) :=
   ⟨hg.injective.comp_left, hg.surjective.comp_left⟩
@@ -824,7 +824,7 @@ def bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) (a b) :=
   f (g a) (h b)
 #align function.bicompl Function.bicompl
 
-/-- Compose an unary function `f` with a binary function `g`. -/
+/-- Compose a unary function `f` with a binary function `g`. -/
 def bicompr (f : γ → δ) (g : α → β → γ) (a b) :=
   f (g a b)
 #align function.bicompr Function.bicompr
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -70,7 +70,7 @@ theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f
   rfl
 #align function.on_fun_apply Function.onFun_apply
 
-lemma hfunext {α α': Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
+lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
   (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
   subst hα
   have : ∀a, HEq (f a) (f' a) := λ a => h a a (HEq.refl a)
@@ -282,9 +282,9 @@ theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
 /-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
 to `α`. -/
 theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Injective f
-| i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
-       RightInverse.surjective
-         (λ U => funext $ λ _a => propext ⟨λ h => h U rfl, λ h' _U e => i e ▸ h'⟩)
+  | i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
+        RightInverse.surjective
+          (λ U => funext $ λ _a => propext ⟨λ h => h U rfl, λ h' _U e => i e ▸ h'⟩)
 #align function.cantor_injective Function.cantor_injective
 
 /-- There is no surjection from `α : Type u` into `Type u`. This theorem
@@ -402,17 +402,18 @@ noncomputable def partialInv {α β} (f : α → β) (b : β) : Option α :=
 #align function.partial_inv Function.partialInv
 
 theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPartialInv f (partialInv f)
-| a, b =>
-⟨λ h => have hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none :=
-          rfl
-        if h' : ∃ a, f a = b
-        then by rw [hpi, dif_pos h'] at h
-                injection h with h
-                subst h
-                apply Classical.choose_spec h'
-        else by rw [hpi, dif_neg h'] at h; contradiction,
- λ e => e ▸ have h : ∃ a', f a' = f a := ⟨_, rfl⟩
-            (dif_pos h).trans (congr_arg _ (I $ Classical.choose_spec h))⟩
+  | a, b =>
+  ⟨fun h =>
+    have hpi : partialInv f b = if h : ∃ a, f a = b then some (Classical.choose h) else none :=
+      rfl
+    if h' : ∃ a, f a = b
+    then by rw [hpi, dif_pos h'] at h
+            injection h with h
+            subst h
+            apply Classical.choose_spec h'
+    else by rw [hpi, dif_neg h'] at h; contradiction,
+  fun e => e ▸ have h : ∃ a', f a' = f a := ⟨_, rfl⟩
+              (dif_pos h).trans (congr_arg _ (I <| Classical.choose_spec h))⟩
 #align function.partial_inv_of_injective Function.partialInv_of_injective
 
 theorem partialInv_left {α β} {f : α → β} (I : Injective f) : ∀ x, partialInv f (f x) = some x :=
@@ -586,7 +587,7 @@ lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a →
 #align function.forall_update_iff Function.forall_update_iff
 
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
-    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) := by
+    (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _) (_ : x ≠ a), p x (f x) := by
   rw [← not_forall_not, forall_update_iff f fun a b ↦ ¬p a b]
   simp [-not_and, not_and_or]
 #align function.exists_update_iff Function.exists_update_iff
chore: fix #align lines (#3640)

This PR fixes two things:

  • Most align statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align). This is often seen in the mathport output after ending calc blocks.
  • All remaining more-than-one-line #align statements. (This was needed for a script I wrote for #3630.)
Diff
@@ -352,12 +352,10 @@ theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : 
 
 theorem LeftInverse.rightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) : RightInverse f g :=
   h
-
 #align function.left_inverse.right_inverse Function.LeftInverse.rightInverse
 
 theorem RightInverse.leftInverse {f : α → β} {g : β → α} (h : RightInverse g f) : LeftInverse f g :=
   h
-
 #align function.right_inverse.left_inverse Function.RightInverse.leftInverse
 
 theorem LeftInverse.surjective {f : α → β} {g : β → α} (h : LeftInverse f g) : Surjective f :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
 
 ! This file was ported from Lean 3 source module logic.function.basic
-! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! leanprover-community/mathlib commit 29cb56a7b35f72758b05a30490e1f10bd62c35c1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -64,6 +64,12 @@ theorem id_def : @id α = fun x ↦ x :=
   rfl
 #align function.id_def Function.id_def
 
+-- porting note: `Function.onFun` is now reducible
+-- @[simp]
+theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b) :=
+  rfl
+#align function.on_fun_apply Function.onFun_apply
+
 lemma hfunext {α α': Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
   (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
   subst hα
feat: Decidability of curry/uncurry (#3116)
Diff
@@ -17,6 +17,7 @@ import Mathlib.Util.WhatsNew
 # Miscellaneous function constructions and lemmas
 -/
 
+open Function
 
 universe u v w
 
@@ -1058,3 +1059,11 @@ theorem InvImage.equivalence {α : Sort u} {β : Sort v} (r : β → β → Prop
     (h : Equivalence r) : Equivalence (InvImage r f) :=
   ⟨fun _ ↦ h.1 _, fun w ↦ h.symm w, fun h₁ h₂ ↦ InvImage.trans r f (fun _ _ _ ↦ h.trans) h₁ h₂⟩
 #align inv_image.equivalence InvImage.equivalence
+
+instance {α β : Type _} {r : α → β → Prop} {x : α × β} [Decidable (r x.1 x.2)] :
+  Decidable (uncurry r x) :=
+‹Decidable _›
+
+instance {α β : Type _} {r : α × β → Prop} {a : α} {b : β} [Decidable (r (a, b))] :
+  Decidable (curry r a b) :=
+‹Decidable _›
chore: add missing hypothesis names to by_cases (#2679)
Diff
@@ -674,7 +674,7 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a
 theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
     update (update f a v) a w = update f a w := by
   funext b
-  by_cases b = a <;> simp [update, h]
+  by_cases h : b = a <;> simp [update, h]
 #align function.update_idem Function.update_idem
 
 end Update
chore: add missing #align statements (#1902)

This PR is the result of a slight variant on the following "algorithm"

  • take all mathlib 3 names, remove _ and make all uppercase letters into lowercase
  • take all mathlib 4 names, remove _ and make all uppercase letters into lowercase
  • look for matches, and create pairs (original_lean3_name, OriginalLean4Name)
  • for pairs that do not have an align statement:
    • use Lean 4 to lookup the file + position of the Lean 4 name
    • add an #align statement just before the next empty line
  • manually fix some tiny mistakes (e.g., empty lines in proofs might cause the #align statement to have been inserted too early)
Diff
@@ -29,31 +29,39 @@ variable {α β γ : Sort _} {f : α → β}
 /-- Evaluate a function at an argument. Useful if you want to talk about the partially applied
   `Function.eval x : (∀ x, β x) → β x`. -/
 @[reducible, simp] def eval {β : α → Sort _} (x : α) (f : ∀ x, β x) : β x := f x
+#align function.eval Function.eval
 
 theorem eval_apply {β : α → Sort _} (x : α) (f : ∀ x, β x) : eval x f = f x :=
   rfl
+#align function.eval_apply Function.eval_apply
 
 theorem const_def {y : β} : (fun _ : α ↦ y) = const α y :=
   rfl
+#align function.const_def Function.const_def
 
 @[simp]
 theorem const_comp {f : α → β} {c : γ} : const β c ∘ f = const α c :=
   rfl
+#align function.const_comp Function.const_comp
 
 @[simp]
 theorem comp_const {f : β → γ} {b : β} : f ∘ const α b = const α (f b) :=
   rfl
+#align function.comp_const Function.comp_const
 
 theorem const_injective [Nonempty α] : Injective (const α : β → α → β) := fun y₁ y₂ h ↦
   let ⟨x⟩ := ‹Nonempty α›
   congr_fun h x
+#align function.const_injective Function.const_injective
 
 @[simp]
 theorem const_inj [Nonempty α] {y₁ y₂ : β} : const α y₁ = const α y₂ ↔ y₁ = y₂ :=
   ⟨fun h ↦ const_injective h, fun h ↦ h ▸ rfl⟩
+#align function.const_inj Function.const_inj
 
 theorem id_def : @id α = fun x ↦ x :=
   rfl
+#align function.id_def Function.id_def
 
 lemma hfunext {α α': Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
   (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f' := by
@@ -65,12 +73,15 @@ lemma hfunext {α α': Sort u} {β : α → Sort v} {β' : α' → Sort v} {f :
   apply heq_of_eq
   funext a
   exact eq_of_heq (this a)
+#align function.hfunext Function.hfunext
 
 theorem funext_iff {β : α → Sort _} {f₁ f₂ : ∀ x : α, β x} : f₁ = f₂ ↔ ∀ a, f₁ a = f₂ a :=
   Iff.intro (fun h _ ↦ h ▸ rfl) funext
+#align function.funext_iff Function.funext_iff
 
 theorem ne_iff {β : α → Sort _} {f₁ f₂ : ∀ a, β a} : f₁ ≠ f₂ ↔ ∃ a, f₁ a ≠ f₂ a :=
   funext_iff.not.trans not_forall
+#align function.ne_iff Function.ne_iff
 
 protected theorem Bijective.injective {f : α → β} (hf : Bijective f) : Injective f := hf.1
 #align function.bijective.injective Function.Bijective.injective
@@ -79,6 +90,7 @@ protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surj
 
 theorem Injective.eq_iff (I : Injective f) {a b : α} : f a = f b ↔ a = b :=
   ⟨@I _ _, congr_arg f⟩
+#align function.injective.eq_iff Function.Injective.eq_iff
 
 theorem Injective.beq_eq [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β]
     (I : Injective f) {a b : α} : (f a == f b) = (a == b) := by
@@ -86,6 +98,7 @@ theorem Injective.beq_eq [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β]
 
 theorem Injective.eq_iff' (I : Injective f) {a b : α} {c : β} (h : f b = c) : f a = c ↔ a = b :=
   h ▸ I.eq_iff
+#align function.injective.eq_iff' Function.Injective.eq_iff'
 
 theorem Injective.ne (hf : Injective f) {a₁ a₂ : α} : a₁ ≠ a₂ → f a₁ ≠ f a₂ :=
   mt fun h ↦ hf h
@@ -93,21 +106,26 @@ theorem Injective.ne (hf : Injective f) {a₁ a₂ : α} : a₁ ≠ a₂ → f a
 
 theorem Injective.ne_iff (hf : Injective f) {x y : α} : f x ≠ f y ↔ x ≠ y :=
   ⟨mt <| congr_arg f, hf.ne⟩
+#align function.injective.ne_iff Function.Injective.ne_iff
 
 theorem Injective.ne_iff' (hf : Injective f) {x y : α} {z : β} (h : f y = z) : f x ≠ z ↔ x ≠ y :=
   h ▸ hf.ne_iff
+#align function.injective.ne_iff' Function.Injective.ne_iff'
 
 /-- If the co-domain `β` of an injective function `f : α → β` has decidable equality, then
 the domain `α` also has decidable equality. -/
 protected def Injective.decidableEq [DecidableEq β] (I : Injective f) : DecidableEq α :=
   fun _ _ ↦ decidable_of_iff _ I.eq_iff
+#align function.injective.decidable_eq Function.Injective.decidableEq
 
 theorem Injective.of_comp {g : γ → α} (I : Injective (f ∘ g)) : Injective g := fun x y h ↦
   I <| show f (g x) = f (g y) from congr_arg f h
+#align function.injective.of_comp Function.Injective.of_comp
 
 theorem Injective.of_comp_iff {f : α → β} (hf : Injective f) (g : γ → α) :
     Injective (f ∘ g) ↔ Injective g :=
   ⟨Injective.of_comp, hf.comp⟩
+#align function.injective.of_comp_iff Function.Injective.of_comp_iff
 
 theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g) :
     Injective (f ∘ g) ↔ Injective f :=
@@ -115,14 +133,17 @@ theorem Injective.of_comp_iff' (f : α → β) {g : γ → α} (hg : Bijective g
              let ⟨_, hy⟩ := hg.surjective y
              hx ▸ hy ▸ λ hf => h hf ▸ rfl,
   λ h => h.comp hg.injective⟩
+#align function.injective.of_comp_iff' Function.Injective.of_comp_iff'
 
 /-- Composition by an injective function on the left is itself injective. -/
 theorem Injective.comp_left {g : β → γ} (hg : Function.Injective g) :
     Function.Injective ((· ∘ ·) g : (α → β) → α → γ) :=
   fun _ _ hgf ↦ funext fun i ↦ hg <| (congr_fun hgf i : _)
+#align function.injective.comp_left Function.Injective.comp_left
 
 theorem injective_of_subsingleton [Subsingleton α] (f : α → β) : Injective f :=
   fun _ _ _ ↦ Subsingleton.elim _ _
+#align function.injective_of_subsingleton Function.injective_of_subsingleton
 
 lemma Injective.dite (p : α → Prop) [DecidablePred p]
   {f : {a : α // p a} → β} {f' : {a : α // ¬ p a} → β}
@@ -136,14 +157,17 @@ by intros x₁ x₂ h
    · rw [dif_pos h₁, dif_neg h₂] at h; exact (im_disj h).elim
    · rw [dif_neg h₁, dif_pos h₂] at h; exact (im_disj h.symm).elim
    · rw [dif_neg h₁, dif_neg h₂] at h; injection (hf' h)
+#align function.injective.dite Function.Injective.dite
 
 theorem Surjective.of_comp {g : γ → α} (S : Surjective (f ∘ g)) : Surjective f := fun y ↦
   let ⟨x, h⟩ := S y
   ⟨g x, h⟩
+#align function.surjective.of_comp Function.Surjective.of_comp
 
 theorem Surjective.of_comp_iff (f : α → β) {g : γ → α} (hg : Surjective g) :
     Surjective (f ∘ g) ↔ Surjective f :=
   ⟨Surjective.of_comp, fun h ↦ h.comp hg⟩
+#align function.surjective.of_comp_iff Function.Surjective.of_comp_iff
 
 theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     Surjective (f ∘ g) ↔ Surjective g :=
@@ -151,6 +175,7 @@ theorem Surjective.of_comp_iff' (hf : Bijective f) (g : γ → α) :
     let ⟨x', hx'⟩ := h (f x)
     ⟨x', hf.injective hx'⟩,
     hf.surjective.comp⟩
+#align function.surjective.of_comp_iff' Function.Surjective.of_comp_iff'
 
 instance decidableEqPfun (p : Prop) [Decidable p] (α : p → Type _) [∀ hp, DecidableEq (α hp)] :
     DecidableEq (∀ hp, α hp)
@@ -161,14 +186,17 @@ protected theorem Surjective.forall (hf : Surjective f) {p : β → Prop} :
   ⟨fun h x ↦ h (f x), fun h y ↦
     let ⟨x, hx⟩ := hf y
     hx ▸ h x⟩
+#align function.surjective.forall Function.Surjective.forall
 
 protected theorem Surjective.forall₂ (hf : Surjective f) {p : β → β → Prop} :
     (∀ y₁ y₂, p y₁ y₂) ↔ ∀ x₁ x₂, p (f x₁) (f x₂) :=
   hf.forall.trans $ forall_congr' fun _ ↦ hf.forall
+#align function.surjective.forall₂ Function.Surjective.forall₂
 
 protected theorem Surjective.forall₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∀ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∀ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.forall.trans $ forall_congr' fun _ ↦ hf.forall₂
+#align function.surjective.forall₃ Function.Surjective.forall₃
 
 protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     (∃ y, p y) ↔ ∃ x, p (f x) :=
@@ -176,26 +204,32 @@ protected theorem Surjective.exists (hf : Surjective f) {p : β → Prop} :
     let ⟨x, hx⟩ := hf y
     ⟨x, hx.symm ▸ hy⟩,
     fun ⟨x, hx⟩ ↦ ⟨f x, hx⟩⟩
+#align function.surjective.exists Function.Surjective.exists
 
 protected theorem Surjective.exists₂ (hf : Surjective f) {p : β → β → Prop} :
     (∃ y₁ y₂, p y₁ y₂) ↔ ∃ x₁ x₂, p (f x₁) (f x₂) :=
   hf.exists.trans <| exists_congr fun _ ↦ hf.exists
+#align function.surjective.exists₂ Function.Surjective.exists₂
 
 protected theorem Surjective.exists₃ (hf : Surjective f) {p : β → β → β → Prop} :
     (∃ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∃ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃) :=
   hf.exists.trans <| exists_congr fun _ ↦ hf.exists₂
+#align function.surjective.exists₃ Function.Surjective.exists₃
 
 theorem Surjective.injective_comp_right (hf : Surjective f) : Injective fun g : β → γ ↦ g ∘ f :=
   fun _ _ h ↦ funext <| hf.forall.2 <| congr_fun h
+#align function.surjective.injective_comp_right Function.Surjective.injective_comp_right
 
 protected theorem Surjective.right_cancellable (hf : Surjective f) {g₁ g₂ : β → γ} :
     g₁ ∘ f = g₂ ∘ f ↔ g₁ = g₂ :=
   hf.injective_comp_right.eq_iff
+#align function.surjective.right_cancellable Function.Surjective.right_cancellable
 
 theorem surjective_of_right_cancellable_Prop (h : ∀ g₁ g₂ : β → Prop, g₁ ∘ f = g₂ ∘ f → g₁ = g₂) :
     Surjective f := by
   specialize h (fun y ↦ ∃ x, f x = y) (fun _ ↦ True) (funext fun x ↦ eq_true ⟨_, rfl⟩)
   intro y; rw [congr_fun h y]; trivial
+#align function.surjective_of_right_cancellable_Prop Function.surjective_of_right_cancellable_Prop
 
 theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β, ∃! a : α, f a = b :=
   ⟨fun hf b ↦
@@ -224,16 +258,19 @@ theorem Bijective.existsUnique_iff {f : α → β} (hf : Bijective f) {p : β 
 theorem Bijective.of_comp_iff (f : α → β) {g : γ → α} (hg : Bijective g) :
     Bijective (f ∘ g) ↔ Bijective f :=
   and_congr (Injective.of_comp_iff' _ hg) (Surjective.of_comp_iff _ hg.surjective)
+#align function.bijective.of_comp_iff Function.Bijective.of_comp_iff
 
 theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α) :
     Function.Bijective (f ∘ g) ↔ Function.Bijective g :=
   and_congr (Injective.of_comp_iff hf.injective _) (Surjective.of_comp_iff' hf _)
+#align function.bijective.of_comp_iff' Function.Bijective.of_comp_iff'
 
 /-- **Cantor's diagonal argument** implies that there are no surjective functions from `α`
 to `Set α`. -/
 theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
   | h => let ⟨D, e⟩ := h (λ a => ¬ f a a)
         (@iff_not_self (f D D)) $ iff_of_eq (congr_fun e D)
+#align function.cantor_surjective Function.cantor_surjective
 
 /-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
 to `α`. -/
@@ -241,6 +278,7 @@ theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Injective f
 | i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
        RightInverse.surjective
          (λ U => funext $ λ _a => propext ⟨λ h => h U rfl, λ h' _U e => i e ▸ h'⟩)
+#align function.cantor_injective Function.cantor_injective
 
 /-- There is no surjection from `α : Type u` into `Type u`. This theorem
   demonstrates why `Type : Type` would be inconsistent in Lean. -/
@@ -256,12 +294,14 @@ theorem not_surjective_Type {α : Type u} (f : α → Type max u v) : ¬Surjecti
       assumption
     · congr
   exact cantor_injective g hg
+#align function.not_surjective_Type Function.not_surjective_Type
 
 /-- `g` is a partial inverse to `f` (an injective but not necessarily
   surjective function) if `g y = some x` implies `f x = y`, and `g y = none`
   implies that `y` is not in the range of `f`. -/
 def IsPartialInv {α β} (f : α → β) (g : β → Option α) : Prop :=
   ∀ x y, g y = some x ↔ f x = y
+#align function.is_partial_inv Function.IsPartialInv
 
 theorem isPartialInv_left {α β} {f : α → β} {g} (H : IsPartialInv f g) (x) : g (f x) = some x :=
   (H _ _).2 rfl
@@ -279,6 +319,7 @@ theorem injective_of_isPartialInv_right {α β} {f : α → β} {g} (H : IsParti
 
 theorem LeftInverse.comp_eq_id {f : α → β} {g : β → α} (h : LeftInverse f g) : f ∘ g = id :=
   funext h
+#align function.left_inverse.comp_eq_id Function.LeftInverse.comp_eq_id
 
 theorem leftInverse_iff_comp {f : α → β} {g : β → α} : LeftInverse f g ↔ f ∘ g = id :=
   ⟨LeftInverse.comp_eq_id, congr_fun⟩
@@ -286,6 +327,7 @@ theorem leftInverse_iff_comp {f : α → β} {g : β → α} : LeftInverse f g 
 
 theorem RightInverse.comp_eq_id {f : α → β} {g : β → α} (h : RightInverse f g) : g ∘ f = id :=
   funext h
+#align function.right_inverse.comp_eq_id Function.RightInverse.comp_eq_id
 
 theorem rightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g ↔ g ∘ f = id :=
   ⟨RightInverse.comp_eq_id, congr_fun⟩
@@ -294,10 +336,12 @@ theorem rightInverse_iff_comp {f : α → β} {g : β → α} : RightInverse f g
 theorem LeftInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : LeftInverse f g)
     (hh : LeftInverse h i) : LeftInverse (h ∘ f) (g ∘ i) :=
   fun a ↦ show h (f (g (i a))) = a by rw [hf (i a), hh a]
+#align function.left_inverse.comp Function.LeftInverse.comp
 
 theorem RightInverse.comp {f : α → β} {g : β → α} {h : β → γ} {i : γ → β} (hf : RightInverse f g)
     (hh : RightInverse h i) : RightInverse (h ∘ f) (g ∘ i) :=
   LeftInverse.comp hh hf
+#align function.right_inverse.comp Function.RightInverse.comp
 
 theorem LeftInverse.rightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) : RightInverse f g :=
   h
@@ -311,9 +355,11 @@ theorem RightInverse.leftInverse {f : α → β} {g : β → α} (h : RightInver
 
 theorem LeftInverse.surjective {f : α → β} {g : β → α} (h : LeftInverse f g) : Surjective f :=
   h.rightInverse.surjective
+#align function.left_inverse.surjective Function.LeftInverse.surjective
 
 theorem RightInverse.injective {f : α → β} {g : β → α} (h : RightInverse f g) : Injective f :=
   h.leftInverse.injective
+#align function.right_inverse.injective Function.RightInverse.injective
 
 theorem LeftInverse.rightInverse_of_injective {f : α → β} {g : β → α} (h : LeftInverse f g)
     (hf : Injective f) : RightInverse f g :=
@@ -348,6 +394,7 @@ attribute [local instance] Classical.propDecidable
   a given injective function `f`. -/
 noncomputable def partialInv {α β} (f : α → β) (b : β) : Option α :=
   if h : ∃ a, f a = b then some (Classical.choose h) else none
+#align function.partial_inv Function.partialInv
 
 theorem partialInv_of_injective {α β} {f : α → β} (I : Injective f) : IsPartialInv f (partialInv f)
 | a, b =>
@@ -380,6 +427,7 @@ attribute [local instance] Classical.propDecidable
 -- Explicit Sort so that `α` isn't inferred to be Prop via `exists_prop_decidable`
 noncomputable def invFun {α : Sort u} {β} [Nonempty α] (f : α → β) : β → α :=
   fun y ↦ if h : (∃ x, f x = y) then h.choose else Classical.arbitrary α
+#align function.inv_fun Function.invFun
 
 theorem invFun_eq (h : ∃ a, f a = b) : f (invFun f b) = b :=
   by simp only [invFun, dif_pos h, h.choose_spec]
@@ -432,6 +480,7 @@ variable {α : Sort u} {β : Sort v} {γ : Sort w} {f : α → β}
   `α` to be inhabited.) -/
 noncomputable def surjInv {f : α → β} (h : Surjective f) (b : β) : α :=
   Classical.choose (h b)
+#align function.surj_inv Function.surjInv
 
 theorem surjInv_eq (h : Surjective f) (b) : f (surjInv h b) = b :=
   Classical.choose_spec (h b)
@@ -456,6 +505,7 @@ theorem surjective_iff_hasRightInverse : Surjective f ↔ HasRightInverse f :=
 theorem bijective_iff_has_inverse : Bijective f ↔ ∃ g, LeftInverse g f ∧ RightInverse g f :=
   ⟨fun hf ↦ ⟨_, leftInverse_surjInv hf, rightInverse_surjInv hf.2⟩, fun ⟨_, gl, gr⟩ ↦
     ⟨gl.injective, gr.surjective⟩⟩
+#align function.bijective_iff_has_inverse Function.bijective_iff_has_inverse
 
 theorem injective_surjInv (h : Surjective f) : Injective (surjInv h) :=
   (rightInverse_surjInv h).injective
@@ -464,16 +514,19 @@ theorem injective_surjInv (h : Surjective f) : Injective (surjInv h) :=
 theorem surjective_to_subsingleton [na : Nonempty α] [Subsingleton β] (f : α → β) :
     Surjective f :=
   fun _ ↦ let ⟨a⟩ := na; ⟨a, Subsingleton.elim _ _⟩
+#align function.surjective_to_subsingleton Function.surjective_to_subsingleton
 
 /-- Composition by an surjective function on the left is itself surjective. -/
 theorem Surjective.comp_left {g : β → γ} (hg : Surjective g) :
     Surjective ((· ∘ ·) g : (α → β) → α → γ) := fun f ↦
   ⟨surjInv hg ∘ f, funext fun _ ↦ rightInverse_surjInv _ _⟩
+#align function.surjective.comp_left Function.Surjective.comp_left
 
 /-- Composition by an bijective function on the left is itself bijective. -/
 theorem Bijective.comp_left {g : β → γ} (hg : Bijective g) :
     Bijective ((· ∘ ·) g : (α → β) → α → γ) :=
   ⟨hg.injective.comp_left, hg.surjective.comp_left⟩
+#align function.bijective.comp_left Function.Bijective.comp_left
 
 end SurjInv
 
@@ -486,6 +539,7 @@ variable {α : Sort u} {β : α → Sort v} {α' : Sort w} [DecidableEq α] [Dec
 /-- Replacing the value of a function at a given point by a given value. -/
 def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
   if h : a = a' then Eq.ndrec v h.symm else f a
+#align function.update Function.update
 
 /-- On non-dependent functions, `Function.update` can be expressed as an `ite` -/
 theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
@@ -497,70 +551,88 @@ by have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
              (λ _ : a = a' =>  b) := funext h2
    let f := λ x => dite (a = a') x (λ (_: ¬ a = a') => (f a))
    exact congrArg f h3
+#align function.update_apply Function.update_apply
 
 @[simp]
 theorem update_same (a : α) (v : β a) (f : ∀ a, β a) : update f a v a = v :=
   dif_pos rfl
+#align function.update_same Function.update_same
 
 theorem surjective_eval {α : Sort u} {β : α → Sort v} [h : ∀ a, Nonempty (β a)] (a : α) :
     Surjective (eval a : (∀ a, β a) → β a) := fun b ↦
   ⟨@update _ _ (Classical.decEq α) (fun a ↦ (h a).some) a b,
    @update_same _ _ (Classical.decEq α) _ _ _⟩
+#align function.surjective_eval Function.surjective_eval
 
 theorem update_injective (f : ∀ a, β a) (a' : α) : Injective (update f a') := fun v v' h ↦ by
   have := congr_fun h a'
   rwa [update_same, update_same] at this
+#align function.update_injective Function.update_injective
 
 @[simp]
 theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) : update f a' v a = f a :=
   dif_neg h
+#align function.update_noteq Function.update_noteq
 
 lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a → Prop) :
   (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ x, x ≠ a → p x (f x) := by
   rw [← and_forall_ne a, update_same]
   simp (config := { contextual := true })
+#align function.forall_update_iff Function.forall_update_iff
 
 theorem exists_update_iff (f : ∀ a, β a) {a : α} {b : β a} (p : ∀ a, β a → Prop) :
     (∃ x, p x (update f a b x)) ↔ p a b ∨ ∃ (x : _)(_ : x ≠ a), p x (f x) := by
   rw [← not_forall_not, forall_update_iff f fun a b ↦ ¬p a b]
   simp [-not_and, not_and_or]
+#align function.exists_update_iff Function.exists_update_iff
 
 theorem update_eq_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     update f a b = g ↔ b = g a ∧ ∀ (x) (_ : x ≠ a), f x = g x :=
   funext_iff.trans <| forall_update_iff _ fun x y ↦ y = g x
+#align function.update_eq_iff Function.update_eq_iff
 
 theorem eq_update_iff {a : α} {b : β a} {f g : ∀ a, β a} :
     g = update f a b ↔ g a = b ∧ ∀ (x) (_ : x ≠ a), g x = f x :=
   funext_iff.trans <| forall_update_iff _ fun x y ↦ g x = y
+#align function.eq_update_iff Function.eq_update_iff
 
 @[simp] lemma update_eq_self_iff : update f a b = f ↔ b = f a := by simp [update_eq_iff]
 @[simp] lemma eq_update_self_iff : f = update f a b ↔ f a = b := by simp [eq_update_iff]
+#align function.eq_update_self_iff Function.eq_update_self_iff
+#align function.update_eq_self_iff Function.update_eq_self_iff
 
 lemma ne_update_self_iff : f ≠ update f a b ↔ f a ≠ b := eq_update_self_iff.not
 lemma update_ne_self_iff : update f a b ≠ f ↔ b ≠ f a := update_eq_self_iff.not
+#align function.update_ne_self_iff Function.update_ne_self_iff
+#align function.ne_update_self_iff Function.ne_update_self_iff
 
 @[simp]
 theorem update_eq_self (a : α) (f : ∀ a, β a) : update f a (f a) = f :=
   update_eq_iff.2 ⟨rfl, fun _ _ ↦ rfl⟩
+#align function.update_eq_self Function.update_eq_self
 
 theorem update_comp_eq_of_forall_ne' {α'} (g : ∀ a, β a) {f : α' → α} {i : α} (a : β i)
     (h : ∀ x, f x ≠ i) : (fun j ↦ (update g i a) (f j)) = fun j ↦ g (f j) :=
   funext fun _ ↦ update_noteq (h _) _ _
+#align function.update_comp_eq_of_forall_ne' Function.update_comp_eq_of_forall_ne'
 
 /-- Non-dependent version of `Function.update_comp_eq_of_forall_ne'` -/
 theorem update_comp_eq_of_forall_ne {α β : Sort _} (g : α' → β) {f : α → α'} {i : α'} (a : β)
     (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f :=
   update_comp_eq_of_forall_ne' g a h
+#align function.update_comp_eq_of_forall_ne Function.update_comp_eq_of_forall_ne
 
 theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Function.Injective f)
     (i : α') (a : β (f i)) : (fun j ↦ update g (f i) a (f j)) = update (fun i ↦ g (f i)) i a :=
   eq_update_iff.2 ⟨update_same _ _ _, fun _ hj ↦ update_noteq (hf.ne hj) _ _⟩
+#align function.update_comp_eq_of_injective' Function.update_comp_eq_of_injective'
 
 /-- Non-dependent version of `Function.update_comp_eq_of_injective'` -/
 theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → α'}
     (hf : Function.Injective f) (i : α) (a : β) :
     Function.update g (f i) a ∘ f = Function.update (g ∘ f) i a :=
   update_comp_eq_of_injective' g hf i a
+#align function.update_comp_eq_of_injective Function.update_comp_eq_of_injective
 
 theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f : ∀ i, α i → β i)
     (g : ∀ i, α i) (i : ι) (v : α i) (j : ι) :
@@ -569,6 +641,7 @@ theorem apply_update {ι : Sort _} [DecidableEq ι] {α β : ι → Sort _} (f :
   · subst j
     simp
   · simp [h]
+#align function.apply_update Function.apply_update
 
 theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _} (f : ∀ i, α i → β i → γ i)
     (g : ∀ i, α i) (h : ∀ i, β i) (i : ι) (v : α i) (w : β i) (j : ι) :
@@ -577,11 +650,13 @@ theorem apply_update₂ {ι : Sort _} [DecidableEq ι] {α β γ : ι → Sort _
   · subst j
     simp
   · simp [h]
+#align function.apply_update₂ Function.apply_update₂
 
 
 theorem comp_update {α' : Sort _} {β : Sort _} (f : α' → β) (g : α → α') (i : α) (v : α') :
     f ∘ update g i v = update (f ∘ g) i (f v) :=
   funext <| apply_update _ _ _ _
+#align function.comp_update Function.comp_update
 
 theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a ≠ b) (v : β a) (w : β b)
     (f : ∀ a, β a) : update (update f a v) b w = update (update f b w) a v := by
@@ -593,12 +668,14 @@ theorem update_comm {α} [DecidableEq α] {β : α → Sort _} {a b : α} (h : a
   · rw [dif_pos h₁, dif_pos h₁, dif_neg h₂]
   · rw [dif_neg h₁, dif_neg h₁, dif_pos h₂]
   · rw [dif_neg h₁, dif_neg h₁, dif_neg h₂]
+#align function.update_comm Function.update_comm
 
 @[simp]
 theorem update_idem {α} [DecidableEq α] {β : α → Sort _} {a : α} (v w : β a) (f : ∀ a, β a) :
     update (update f a v) a w = update f a w := by
   funext b
   by_cases b = a <;> simp [update, h]
+#align function.update_idem Function.update_idem
 
 end Update
 
@@ -617,39 +694,47 @@ Mostly useful when `f` is injective, or more generally when `g.factors_through f
 -- Explicit Sort so that `α` isn't inferred to be Prop via `exists_prop_decidable`
 def extend {α : Sort u} {β γ} (f : α → β) (g : α → γ) (e' : β → γ) : β → γ := fun b ↦
   if h : ∃ a, f a = b then g (Classical.choose h) else e' b
+#align function.extend Function.extend
 
 /-- g factors through f : `f a = f b → g a = g b` -/
 def FactorsThrough (g : α → γ) (f : α → β) : Prop :=
   ∀ ⦃a b⦄, f a = f b → g a = g b
+#align function.factors_through Function.FactorsThrough
 
 theorem extend_def (f : α → β) (g : α → γ) (e' : β → γ) (b : β) [Decidable (∃ a, f a = b)] :
     extend f g e' b = if h : ∃ a, f a = b then g (Classical.choose h) else e' b := by
   unfold extend
   congr
+#align function.extend_def Function.extend_def
 
 lemma Injective.FactorsThrough (hf : Injective f) (g : α → γ) : g.FactorsThrough f :=
   fun _ _ h => congr_arg g (hf h)
+#align function.injective.factors_through Function.Injective.FactorsThrough
 
 lemma FactorsThrough.extend_apply {g : α → γ} (hf : g.FactorsThrough f) (e' : β → γ) (a : α) :
   extend f g e' (f a) = g a := by
   simp only [extend_def, dif_pos, exists_apply_eq_apply]
   exact hf (Classical.choose_spec (exists_apply_eq_apply f a))
+#align function.factors_through.extend_apply Function.FactorsThrough.extend_apply
 
 @[simp]
 theorem Injective.extend_apply (hf : Injective f) (g : α → γ) (e' : β → γ) (a : α) :
     extend f g e' (f a) = g a :=
   (hf.FactorsThrough g).extend_apply e' a
+#align function.injective.extend_apply Function.Injective.extend_apply
 
 @[simp]
 theorem extend_apply' (g : α → γ) (e' : β → γ) (b : β) (hb : ¬∃ a, f a = b) :
     extend f g e' b = e' b := by
   simp [Function.extend_def, hb]
+#align function.extend_apply' Function.extend_apply'
 
 lemma factorsThrough_iff (g : α → γ) [Nonempty γ] :
   g.FactorsThrough f ↔ ∃ (e : β → γ), g = e ∘ f :=
 ⟨fun hf => ⟨extend f g (const β (Classical.arbitrary γ)),
       funext (fun x => by simp only [comp_apply, hf.extend_apply])⟩,
   fun h _ _ hf => by rw [Classical.choose_spec h, comp_apply, comp_apply, hf]⟩
+#align function.factors_through_iff Function.factorsThrough_iff
 
 lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
   (F : γ → δ) (e' : β → γ) (b : β) :
@@ -666,10 +751,12 @@ lemma FactorsThrough.apply_extend {δ} {g : α → γ} (hf : FactorsThrough g f)
       exact hf h
   case neg =>
     rw [extend_apply' _ _ _ hb, extend_apply' _ _ _ hb, comp]
+#align function.factors_through.apply_extend Function.FactorsThrough.apply_extend
 
 lemma Injective.apply_extend {δ} (hf : Injective f) (F : γ → δ) (g : α → γ) (e' : β → γ) (b : β) :
   F (extend f g e' b) = extend f (F ∘ g) (F ∘ e') b :=
   (hf.FactorsThrough g).apply_extend F e' b
+#align function.injective.apply_extend Function.Injective.apply_extend
 
 theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g ↦ extend f g e' := by
   intro g₁ g₂ hg
@@ -677,40 +764,49 @@ theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g 
   have H := congr_fun hg (f x)
   simp only [hf.extend_apply] at H
   exact H
+#align function.extend_injective Function.extend_injective
 
 lemma FactorsThrough.extend_comp {g : α → γ} (e' : β → γ) (hf : FactorsThrough g f) :
   extend f g e' ∘ f = g :=
   funext $ fun a => hf.extend_apply e' a
+#align function.factors_through.extend_comp Function.FactorsThrough.extend_comp
 
 @[simp]
 theorem extend_comp (hf : Injective f) (g : α → γ) (e' : β → γ) : extend f g e' ∘ f = g :=
   funext fun a ↦ hf.extend_apply g e' a
+#align function.extend_comp Function.extend_comp
 
 theorem Injective.surjective_comp_right' (hf : Injective f) (g₀ : β → γ) :
     Surjective fun g : β → γ ↦ g ∘ f :=
   fun g ↦ ⟨extend f g g₀, extend_comp hf _ _⟩
+#align function.injective.surjective_comp_right' Function.Injective.surjective_comp_right'
 
 theorem Injective.surjective_comp_right [Nonempty γ] (hf : Injective f) :
     Surjective fun g : β → γ ↦ g ∘ f :=
   hf.surjective_comp_right' fun _ ↦ Classical.choice ‹_›
+#align function.injective.surjective_comp_right Function.Injective.surjective_comp_right
 
 theorem Bijective.comp_right (hf : Bijective f) : Bijective fun g : β → γ ↦ g ∘ f :=
   ⟨hf.surjective.injective_comp_right, fun g ↦
     ⟨g ∘ surjInv hf.surjective,
      by simp only [comp.assoc g _ f, (leftInverse_surjInv hf).comp_eq_id, comp.right_id]⟩⟩
+#align function.bijective.comp_right Function.Bijective.comp_right
 
 end Extend
 
 theorem uncurry_def {α β γ} (f : α → β → γ) : uncurry f = fun p ↦ f p.1 p.2 :=
   rfl
+#align function.uncurry_def Function.uncurry_def
 
 @[simp]
 theorem uncurry_apply_pair {α β γ} (f : α → β → γ) (x : α) (y : β) : uncurry f (x, y) = f x y :=
   rfl
+#align function.uncurry_apply_pair Function.uncurry_apply_pair
 
 @[simp]
 theorem curry_apply {α β γ} (f : α × β → γ) (x : α) (y : β) : curry f x y = f (x, y) :=
   rfl
+#align function.curry_apply Function.curry_apply
 
 section Bicomp
 
@@ -720,20 +816,24 @@ variable {α β γ δ ε : Type _}
 If both arguments of `f` have the same type and `g = h`, then `bicompl f g g = f on g`. -/
 def bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) (a b) :=
   f (g a) (h b)
+#align function.bicompl Function.bicompl
 
 /-- Compose an unary function `f` with a binary function `g`. -/
 def bicompr (f : γ → δ) (g : α → β → γ) (a b) :=
   f (g a b)
+#align function.bicompr Function.bicompr
 
 -- Suggested local notation:
 local notation f " ∘₂ " g => bicompr f g
 
 theorem uncurry_bicompr (f : α → β → γ) (g : γ → δ) : uncurry (g ∘₂ f) = g ∘ uncurry f :=
   rfl
+#align function.uncurry_bicompr Function.uncurry_bicompr
 
 theorem uncurry_bicompl (f : γ → δ → ε) (g : α → γ) (h : β → δ) :
     uncurry (bicompl f g h) = uncurry f ∘ Prod.map g h :=
   rfl
+#align function.uncurry_bicompl Function.uncurry_bicompl
 
 end Bicomp
 
@@ -749,6 +849,7 @@ class HasUncurry (α : Type _) (β : outParam (Type _)) (γ : outParam (Type _))
   `f : α → β → γ → δ` will be turned into `↿f : α × β × γ → δ`. One can also add instances
   for bundled maps.-/
   uncurry : α → β → γ
+#align function.has_uncurry Function.HasUncurry
 
 notation:arg "↿" x:arg => HasUncurry.uncurry x
 
@@ -763,9 +864,11 @@ end Uncurry
 /-- A function is involutive, if `f ∘ f = id`. -/
 def Involutive {α} (f : α → α) : Prop :=
   ∀ x, f (f x) = x
+#align function.involutive Function.Involutive
 
 theorem involutive_iff_iter_2_eq_id {α} {f : α → α} : Involutive f ↔ f^[2] = id :=
   funext_iff.symm
+#align function.involutive_iff_iter_2_eq_id Function.involutive_iff_iter_2_eq_id
 
 theorem _root_.Bool.involutive_not : Involutive not :=
   Bool.not_not
@@ -777,6 +880,7 @@ variable {α : Sort u} {f : α → α} (h : Involutive f)
 @[simp]
 theorem comp_self : f ∘ f = id :=
   funext h
+#align function.involutive.comp_self Function.Involutive.comp_self
 
 protected theorem leftInverse : LeftInverse f f := h
 #align function.involutive.left_inverse Function.Involutive.leftInverse
@@ -796,10 +900,12 @@ protected theorem bijective : Bijective f := ⟨h.injective, h.surjective⟩
 /-- Involuting an `ite` of an involuted value `x : α` negates the `Prop` condition in the `ite`. -/
 protected theorem ite_not (P : Prop) [Decidable P] (x : α) : f (ite P x (f x)) = ite (¬P) x (f x) :=
   by rw [apply_ite f, h, ite_not]
+#align function.involutive.ite_not Function.Involutive.ite_not
 
 /-- An involution commutes across an equality. Compare to `Function.Injective.eq_iff`. -/
 protected theorem eq_iff {x y : α} : f x = y ↔ x = f y :=
   h.injective.eq_iff' (h y)
+#align function.involutive.eq_iff Function.Involutive.eq_iff
 
 end Involutive
 
@@ -808,6 +914,7 @@ Mathematically this should be thought of as the corresponding function `α × β
 -/
 def Injective2 {α β γ} (f : α → β → γ) : Prop :=
   ∀ ⦃a₁ a₂ b₁ b₂⦄, f a₁ b₁ = f a₂ b₂ → a₁ = a₂ ∧ b₁ = b₂
+#align function.injective2 Function.Injective2
 
 namespace Injective2
 
@@ -816,28 +923,34 @@ variable {α β γ : Sort _} {f : α → β → γ}
 /-- A binary injective function is injective when only the left argument varies. -/
 protected theorem left (hf : Injective2 f) (b : β) : Function.Injective fun a ↦ f a b :=
   fun _ _ h ↦ (hf h).left
+#align function.injective2.left Function.Injective2.left
 
 /-- A binary injective function is injective when only the right argument varies. -/
 protected theorem right (hf : Injective2 f) (a : α) : Function.Injective (f a) :=
   fun _ _ h ↦ (hf h).right
+#align function.injective2.right Function.Injective2.right
 
 protected theorem uncurry {α β γ : Type _} {f : α → β → γ} (hf : Injective2 f) :
     Function.Injective (uncurry f) :=
   fun ⟨_, _⟩ ⟨_, _⟩ h ↦ (hf h).elim (congr_arg₂ _)
+#align function.injective2.uncurry Function.Injective2.uncurry
 
 /-- As a map from the left argument to a unary function, `f` is injective. -/
 theorem left' (hf : Injective2 f) [Nonempty β] : Function.Injective f := fun a₁ a₂ h ↦
   let ⟨b⟩ := ‹Nonempty β›
   hf.left b <| (congr_fun h b : _)
+#align function.injective2.left' Function.Injective2.left'
 
 /-- As a map from the right argument to a unary function, `f` is injective. -/
 theorem right' (hf : Injective2 f) [Nonempty α] : Function.Injective fun b a ↦ f a b :=
   fun b₁ b₂ h ↦
     let ⟨a⟩ := ‹Nonempty α›
     hf.right a <| (congr_fun h a : _)
+#align function.injective2.right' Function.Injective2.right'
 
 theorem eq_iff (hf : Injective2 f) {a₁ a₂ b₁ b₂} : f a₁ b₁ = f a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ :=
   ⟨fun h ↦ hf h, fun ⟨h1, h2⟩ ↦ congr_arg₂ f h1 h2⟩
+#align function.injective2.eq_iff Function.Injective2.eq_iff
 
 end Injective2
 
@@ -850,13 +963,16 @@ interesting in the case where `α` is a proposition, in which case `f` is necess
 constant function, so that `sometimes f = f a` for all `a`. -/
 noncomputable def sometimes {α β} [Nonempty β] (f : α → β) : β :=
   if h : Nonempty α then f (Classical.choice h) else Classical.choice ‹_›
+#align function.sometimes Function.sometimes
 
 theorem sometimes_eq {p : Prop} {α} [Nonempty α] (f : p → α) (a : p) : sometimes f = f a :=
   dif_pos ⟨a⟩
+#align function.sometimes_eq Function.sometimes_eq
 
 theorem sometimes_spec {p : Prop} {α} [Nonempty α] (P : α → Prop) (f : p → α) (a : p)
     (h : P (f a)) : P (sometimes f) :=
   by rwa [sometimes_eq]
+#align function.sometimes_spec Function.sometimes_spec
 
 end Sometimes
 
@@ -866,6 +982,7 @@ end Function
 def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i, β i)
     [∀ j, Decidable (j ∈ s)] : ∀ i, β i :=
   fun i ↦ if i ∈ s then f i else g i
+#align set.piecewise Set.piecewise
 
 /-! ### Bijectivity of `eq.rec`, `eq.mp`, `eq.mpr`, and `cast` -/
 
@@ -873,20 +990,24 @@ def Set.piecewise {α : Type u} {β : α → Sort v} (s : Set α) (f g : ∀ i,
 theorem eq_rec_on_bijective {α : Sort _} {C : α → Sort _} :
     ∀ {a a' : α} (h : a = a'), Function.Bijective (@Eq.ndrec _ _ C · _ h)
   | _, _, rfl => ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+#align eq_rec_on_bijective eq_rec_on_bijective
 
 theorem eq_mp_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mp h) := by
   -- TODO: mathlib3 uses `eq_rec_on_bijective`, difference in elaboration here
   -- due to `@[macro_inline] possibly?
   cases h
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+#align eq_mp_bijective eq_mp_bijective
 
 theorem eq_mpr_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mpr h) := by
   cases h
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+#align eq_mpr_bijective eq_mpr_bijective
 
 theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast h) := by
   cases h
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
+#align cast_bijective cast_bijective
 
 /-! Note these lemmas apply to `Type _` not `Sort*`, as the latter interferes with `simp`, and
 is trivial anyway.-/
@@ -896,36 +1017,44 @@ is trivial anyway.-/
 theorem eq_rec_inj {α : Sort _} {a a' : α} (h : a = a') {C : α → Type _} (x y : C a) :
     (Eq.ndrec x h : C a') = Eq.ndrec y h ↔ x = y :=
   (eq_rec_on_bijective h).injective.eq_iff
+#align eq_rec_inj eq_rec_inj
 
 @[simp]
 theorem cast_inj {α β : Type _} (h : α = β) {x y : α} : cast h x = cast h y ↔ x = y :=
   (cast_bijective h).injective.eq_iff
+#align cast_inj cast_inj
 
 theorem Function.LeftInverse.eq_rec_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).rec (C (g (f a)))` for LHS
     @Eq.rec β (f (g (f a))) (fun x _ ↦ γ x) (C (g (f a))) (f a) (congr_arg f (h a)) = C a :=
   eq_of_heq <| (eq_rec_heq _ _).trans <| by rw [h]
+#align function.left_inverse.eq_rec_eq Function.LeftInverse.eq_rec_eq
 
 theorem Function.LeftInverse.eq_rec_on_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     -- TODO: mathlib3 uses `(congr_arg f (h a)).recOn (C (g (f a)))` for LHS
     @Eq.recOn β (f (g (f a))) (fun x _ ↦ γ x) (f a) (congr_arg f (h a)) (C (g (f a))) = C a :=
   h.eq_rec_eq _ _
+#align function.left_inverse.eq_rec_on_eq Function.LeftInverse.eq_rec_on_eq
 
 theorem Function.LeftInverse.cast_eq {α β : Sort _} {γ : β → Sort v} {f : α → β} {g : β → α}
     (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
     cast (congr_arg (fun a ↦ γ (f a)) (h a)) (C (g (f a))) = C a := by
   rw [cast_eq_iff_heq, h]
+#align function.left_inverse.cast_eq Function.LeftInverse.cast_eq
 
 /-- A set of functions "separates points"
 if for each pair of distinct points there is a function taking different values on them. -/
 def Set.SeparatesPoints {α β : Type _} (A : Set (α → β)) : Prop :=
   ∀ ⦃x y : α⦄, x ≠ y → ∃ f ∈ A, (f x : β) ≠ f y
+#align set.separates_points Set.SeparatesPoints
 
 theorem IsSymmOp.flip_eq {α β} (op) [IsSymmOp α β op] : flip op = op :=
   funext fun a ↦ funext fun b ↦ (IsSymmOp.symm_op a b).symm
+#align is_symm_op.flip_eq IsSymmOp.flip_eq
 
 theorem InvImage.equivalence {α : Sort u} {β : Sort v} (r : β → β → Prop) (f : α → β)
     (h : Equivalence r) : Equivalence (InvImage r f) :=
   ⟨fun _ ↦ h.1 _, fun w ↦ h.symm w, fun h₁ h₂ ↦ InvImage.trans r f (fun _ _ _ ↦ h.trans) h₁ h₂⟩
+#align inv_image.equivalence InvImage.equivalence
chore: Rename Type* to Type _ (#1866)

A bunch of docstrings were still mentioning Type*. This changes them to Type _.

Diff
@@ -888,7 +888,7 @@ theorem cast_bijective {α β : Sort _} (h : α = β) : Function.Bijective (cast
   cases h
   refine ⟨fun _ _ ↦ id, fun x ↦ ⟨x, rfl⟩⟩
 
-/-! Note these lemmas apply to `Type*` not `Sort*`, as the latter interferes with `simp`, and
+/-! Note these lemmas apply to `Type _` not `Sort*`, as the latter interferes with `simp`, and
 is trivial anyway.-/
 
 
chore: fix most phantom #aligns (#1794)
Diff
@@ -420,7 +420,7 @@ theorem Injective.hasLeftInverse (hf : Injective f) : HasLeftInverse f :=
 
 theorem injective_iff_hasLeftInverse : Injective f ↔ HasLeftInverse f :=
   ⟨Injective.hasLeftInverse, HasLeftInverse.injective⟩
-#align function.injective_iff_has_leftInverse Function.injective_iff_hasLeftInverse
+#align function.injective_iff_has_left_inverse Function.injective_iff_hasLeftInverse
 
 end InvFun
 
@@ -439,7 +439,7 @@ theorem surjInv_eq (h : Surjective f) (b) : f (surjInv h b) = b :=
 
 theorem rightInverse_surjInv (hf : Surjective f) : RightInverse (surjInv hf) f :=
   surjInv_eq hf
-#align function.right_inverse_surjInv Function.rightInverse_surjInv
+#align function.right_inverse_surj_inv Function.rightInverse_surjInv
 
 theorem leftInverse_surjInv (hf : Bijective f) : LeftInverse (surjInv hf.2) f :=
   rightInverse_of_injective_of_leftInverse hf.1 (rightInverse_surjInv hf.2)
@@ -779,12 +779,10 @@ theorem comp_self : f ∘ f = id :=
   funext h
 
 protected theorem leftInverse : LeftInverse f f := h
-
-#align involutive.left_inverse Function.Involutive.leftInverse
+#align function.involutive.left_inverse Function.Involutive.leftInverse
 
 protected theorem rightInverse : RightInverse f f := h
-
-#align involutive.right_inverse Function.Involutive.rightInverse
+#align function.involutive.right_inverse Function.Involutive.rightInverse
 
 protected theorem injective : Injective f := h.leftInverse.injective
 #align function.involutive.injective Function.Involutive.injective
chore: the style linter shouldn't complain about long #align lines (#1643)
Diff
@@ -318,34 +318,29 @@ theorem RightInverse.injective {f : α → β} {g : β → α} (h : RightInverse
 theorem LeftInverse.rightInverse_of_injective {f : α → β} {g : β → α} (h : LeftInverse f g)
     (hf : Injective f) : RightInverse f g :=
   fun x ↦ hf <| h (f x)
-#align function.left_inverse.right_inverse_of_injective
-Function.LeftInverse.rightInverse_of_injective
+#align function.left_inverse.right_inverse_of_injective Function.LeftInverse.rightInverse_of_injective
 
 theorem LeftInverse.rightInverse_of_surjective {f : α → β} {g : β → α} (h : LeftInverse f g)
     (hg : Surjective g) : RightInverse f g :=
   fun x ↦ let ⟨y, hy⟩ := hg x; hy ▸ congr_arg g (h y)
-#align function.left_inverse.right_inverse_of_surjective
-Function.LeftInverse.rightInverse_of_surjective
+#align function.left_inverse.right_inverse_of_surjective Function.LeftInverse.rightInverse_of_surjective
 
 theorem RightInverse.leftInverse_of_surjective {f : α → β} {g : β → α} :
     RightInverse f g → Surjective f → LeftInverse f g :=
   LeftInverse.rightInverse_of_surjective
-#align function.right_inverse.left_inverse_of_surjective
-Function.RightInverse.leftInverse_of_surjective
+#align function.right_inverse.left_inverse_of_surjective Function.RightInverse.leftInverse_of_surjective
 
 theorem RightInverse.leftInverse_of_injective {f : α → β} {g : β → α} :
     RightInverse f g → Injective g → LeftInverse f g :=
   LeftInverse.rightInverse_of_injective
-#align function.right_inverse.left_inverse_of_injective
-Function.RightInverse.leftInverse_of_injective
+#align function.right_inverse.left_inverse_of_injective Function.RightInverse.leftInverse_of_injective
 
 theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
     (h₂ : RightInverse g₂ f) : g₁ = g₂ :=
   calc
     g₁ = g₁ ∘ f ∘ g₂ := by rw [h₂.comp_eq_id, comp.right_id]
      _ = g₂ := by rw [← comp.assoc, h₁.comp_eq_id, comp.left_id]
-#align function.left_inverse.eq_right_inverse
-Function.LeftInverse.eq_rightInverse
+#align function.left_inverse.eq_right_inverse Function.LeftInverse.eq_rightInverse
 
 attribute [local instance] Classical.propDecidable
 
@@ -401,8 +396,7 @@ theorem invFun_eq_of_injective_of_rightInverse {g : β → α} (hf : Injective f
       (by
         rw [hg b]
         exact invFun_eq ⟨g b, hg b⟩)
-#align function.inv_fun_eq_of_injective_of_right_inverse
-Function.invFun_eq_of_injective_of_rightInverse
+#align function.inv_fun_eq_of_injective_of_right_inverse Function.invFun_eq_of_injective_of_rightInverse
 
 theorem rightInverse_invFun (hf : Surjective f) : RightInverse (invFun f) f :=
   fun b ↦ invFun_eq <| hf b
@@ -453,13 +447,11 @@ theorem leftInverse_surjInv (hf : Bijective f) : LeftInverse (surjInv hf.2) f :=
 
 theorem Surjective.hasRightInverse (hf : Surjective f) : HasRightInverse f :=
   ⟨_, rightInverse_surjInv hf⟩
-#align function.surjective.has_right_inverse
-Function.Surjective.hasRightInverse
+#align function.surjective.has_right_inverse Function.Surjective.hasRightInverse
 
 theorem surjective_iff_hasRightInverse : Surjective f ↔ HasRightInverse f :=
   ⟨Surjective.hasRightInverse, HasRightInverse.surjective⟩
-#align function.surjective_iff_has_right_inverse
-Function.surjective_iff_hasRightInverse
+#align function.surjective_iff_has_right_inverse Function.surjective_iff_hasRightInverse
 
 theorem bijective_iff_has_inverse : Bijective f ↔ ∃ g, LeftInverse g f ∧ RightInverse g f :=
   ⟨fun hf ↦ ⟨_, leftInverse_surjInv hf, rightInverse_surjInv hf.2⟩, fun ⟨_, gl, gr⟩ ↦
feat: port Data.List.Count (#1410)

Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: thirdsgames <thirdsgames2018@gmail.com> Co-authored-by: zeramorphic <zeramorphic@proton.me> Co-authored-by: zeramorphic <50671761+zeramorphic@users.noreply.github.com>

Diff
@@ -80,6 +80,10 @@ protected theorem Bijective.surjective {f : α → β} (hf : Bijective f) : Surj
 theorem Injective.eq_iff (I : Injective f) {a b : α} : f a = f b ↔ a = b :=
   ⟨@I _ _, congr_arg f⟩
 
+theorem Injective.beq_eq [BEq α] [LawfulBEq α] [BEq β] [LawfulBEq β]
+    (I : Injective f) {a b : α} : (f a == f b) = (a == b) := by
+  by_cases h : a == b <;> simp [h] <;> simpa [I.eq_iff] using h
+
 theorem Injective.eq_iff' (I : Injective f) {a b : α} {c : β} (h : f b = c) : f a = c ↔ a = b :=
   h ▸ I.eq_iff
 
feat: refactor of solve_by_elim (#856)

This is a thorough refactor of solve_by_elim.

  • Bug fixes and additional tests.
  • Support for removing local hypotheses using solve_by_elim [-h].
  • Use symm on hypotheses and exfalso on the goal, as needed.
  • To support that, MetaM level tooling for the symm tactic. (rfl and trans deserve the same treatment at some point.)
  • Additional hooks for flow control in solve_by_elim (suspending goals to return to the user, rejecting branches, running arbitrary procedures on the goals).
  • Using those hooks, reimplement apply_assumption and apply_rules as thin wrappers around solve_by_elim, allowing access to new features (removing hypotheses, symm and exfalso) for free.
  • Using those hooks, fix library_search using so example (P Q : List ℕ) (h : ℕ) : List ℕ := by library_search using P, Q -- exact P ∩ Q

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -11,7 +11,6 @@ Authors: Johannes Hölzl, Mario Carneiro
 import Mathlib.Logic.Nonempty
 import Mathlib.Init.Data.Nat.Lemmas
 import Mathlib.Init.Set
-import Mathlib.Tactic.LibrarySearch
 import Mathlib.Util.WhatsNew
 
 /-!
chore: fix casing per naming scheme (#1183)

Fix a lot of wrong casing mostly in the docstrings but also sometimes in def/theorem names. E.g. fin 2 --> Fin 2, add_monoid_hom --> AddMonoidHom

Remove \n from to_additive docstrings that were inserted by mathport.

Move files and directories with Gcd and Smul to GCD and SMul

Diff
@@ -201,7 +201,7 @@ theorem bijective_iff_existsUnique (f : α → β) : Bijective f ↔ ∀ b : β,
     fun he ↦ ⟨fun {_a a'} h ↦ (he (f a')).unique h rfl, fun b ↦ (he b).exists⟩⟩
 #align function.bijective_iff_exists_unique Function.bijective_iff_existsUnique
 
-/-- Shorthand for using projection notation with `function.bijective_iff_existsUnique`. -/
+/-- Shorthand for using projection notation with `Function.bijective_iff_existsUnique`. -/
 protected theorem Bijective.existsUnique {f : α → β} (hf : Bijective f) (b : β) :
     ∃! a : α, f a = b :=
   (bijective_iff_existsUnique f).mp hf b
@@ -227,12 +227,12 @@ theorem Bijective.of_comp_iff' {f : α → β} (hf : Bijective f) (g : γ → α
   and_congr (Injective.of_comp_iff hf.injective _) (Surjective.of_comp_iff' hf _)
 
 /-- **Cantor's diagonal argument** implies that there are no surjective functions from `α`
-to `set α`. -/
+to `Set α`. -/
 theorem cantor_surjective {α} (f : α → Set α) : ¬Surjective f
   | h => let ⟨D, e⟩ := h (λ a => ¬ f a a)
         (@iff_not_self (f D D)) $ iff_of_eq (congr_fun e D)
 
-/-- **Cantor's diagonal argument** implies that there are no injective functions from `set α`
+/-- **Cantor's diagonal argument** implies that there are no injective functions from `Set α`
 to `α`. -/
 theorem cantor_injective {α : Type _} (f : Set α → α) : ¬Injective f
 | i => cantor_surjective (λ a b => ∀ U, a = f U → U b) $
@@ -492,7 +492,7 @@ variable {α : Sort u} {β : α → Sort v} {α' : Sort w} [DecidableEq α] [Dec
 def update (f : ∀ a, β a) (a' : α) (v : β a') (a : α) : β a :=
   if h : a = a' then Eq.ndrec v h.symm else f a
 
-/-- On non-dependent functions, `function.update` can be expressed as an `ite` -/
+/-- On non-dependent functions, `Function.update` can be expressed as an `ite` -/
 theorem update_apply {β : Sort _} (f : α → β) (a' : α) (b : β) (a : α) :
     update f a' b a = if a = a' then b else f a :=
 by have h2 : (h : a = a') → Eq.rec (motive := λ _ _ => β) b h.symm = b :=
@@ -552,7 +552,7 @@ theorem update_comp_eq_of_forall_ne' {α'} (g : ∀ a, β a) {f : α' → α} {i
     (h : ∀ x, f x ≠ i) : (fun j ↦ (update g i a) (f j)) = fun j ↦ g (f j) :=
   funext fun _ ↦ update_noteq (h _) _ _
 
-/-- Non-dependent version of `function.update_comp_eq_of_forall_ne'` -/
+/-- Non-dependent version of `Function.update_comp_eq_of_forall_ne'` -/
 theorem update_comp_eq_of_forall_ne {α β : Sort _} (g : α' → β) {f : α → α'} {i : α'} (a : β)
     (h : ∀ x, f x ≠ i) : update g i a ∘ f = g ∘ f :=
   update_comp_eq_of_forall_ne' g a h
@@ -561,7 +561,7 @@ theorem update_comp_eq_of_injective' (g : ∀ a, β a) {f : α' → α} (hf : Fu
     (i : α') (a : β (f i)) : (fun j ↦ update g (f i) a (f j)) = update (fun i ↦ g (f i)) i a :=
   eq_update_iff.2 ⟨update_same _ _ _, fun _ hj ↦ update_noteq (hf.ne hj) _ _⟩
 
-/-- Non-dependent version of `function.update_comp_eq_of_injective'` -/
+/-- Non-dependent version of `Function.update_comp_eq_of_injective'` -/
 theorem update_comp_eq_of_injective {β : Sort _} (g : α' → β) {f : α → α'}
     (hf : Function.Injective f) (i : α) (a : β) :
     Function.update g (f i) a ∘ f = Function.update (g ∘ f) i a :=
@@ -804,7 +804,7 @@ protected theorem bijective : Bijective f := ⟨h.injective, h.surjective⟩
 protected theorem ite_not (P : Prop) [Decidable P] (x : α) : f (ite P x (f x)) = ite (¬P) x (f x) :=
   by rw [apply_ite f, h, ite_not]
 
-/-- An involution commutes across an equality. Compare to `function.injective.eq_iff`. -/
+/-- An involution commutes across an equality. Compare to `Function.Injective.eq_iff`. -/
 protected theorem eq_iff {x y : α} : f x = y ↔ x = f y :=
   h.injective.eq_iff' (h y)
 
chore: add source headers to ported theory files (#1094)

The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2016 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Mario Carneiro
+
+! This file was ported from Lean 3 source module logic.function.basic
+! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Logic.Nonempty
 import Mathlib.Init.Data.Nat.Lemmas

Dependencies 3

4 files ported (100.0%)
2799 lines ported (100.0%)

All dependencies are ported!