data.option.n_aryMathlib.Data.Option.NAry

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

refactor(*): use option.map₂ (#18081)

Relevant parts are forward-ported as leanprover-community/mathlib4#1439

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -42,8 +42,10 @@ because of the lack of universe polymorphism. -/
 lemma map₂_def {α β γ : Type*} (f : α → β → γ) (a : option α) (b : option β) :
   map₂ f a b = f <$> a <*> b := by cases a; refl
 
-@[simp] lemma map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b :=
+@[simp] lemma map₂_some_some (f : α → β → γ) (a : α) (b : β) :
+  map₂ f (some a) (some b) = some (f a b) :=
 rfl
+
 lemma map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b := rfl
 @[simp] lemma map₂_none_left (f : α → β → γ) (b : option β) : map₂ f none b = none := rfl
 @[simp] lemma map₂_none_right (f : α → β → γ) (a : option α) : map₂ f a none = none :=
@@ -170,4 +172,16 @@ lemma map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : 
   map₂ f a (b.map g) = (map₂ f' b a).map g' :=
 by cases a; cases b; simp [h_right_anticomm]
 
+/-- If `a` is a left identity for a binary operation `f`, then `some a` is a left identity for
+`option.map₂ f`. -/
+lemma map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (o : option β) :
+  map₂ f (some a) o = o :=
+by { cases o, exacts [rfl, congr_arg some (h _)] }
+
+/-- If `b` is a right identity for a binary operation `f`, then `some b` is a right identity for
+`option.map₂ f`. -/
+lemma map₂_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (o : option α) :
+  map₂ f o (some b) = o :=
+by simp [h, map₂]
+
 end option

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

refactor(data/set/n_ary): extract from data/set/basic (#17836)

This is essentially just a copy paste, with one or two whitespace fixes.

This split is consistent with how finset/n_ary is its own file, and does a nice job of making data/set/basic a bit shorter.

The comment fixes referring to this new file are thanks to #17825.

Diff
@@ -21,8 +21,8 @@ on intervals.
 
 ## Notes
 
-This file is very similar to the n-ary section of `data.set.basic`, to `data.finset.n_ary` and to
-`order.filter.n_ary`. Please keep them in sync.
+This file is very similar to `data.set.n_ary`, `data.finset.n_ary` and `order.filter.n_ary`. Please
+keep them in sync.
 
 We do not define `option.map₃` as its only purpose so far would be to prove properties of
 `option.map₂` and casing already fulfills this task.

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -3,7 +3,7 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Option.Basic
+import Data.Option.Basic
 
 #align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.option.n_ary
-! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Option.Basic
 
+#align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
+
 /-!
 # Binary map of options
 
Diff
@@ -48,76 +48,106 @@ def map₂ (f : α → β → γ) (a : Option α) (b : Option β) : Option γ :=
 #align option.map₂ Option.map₂
 -/
 
+#print Option.map₂_def /-
 /-- `option.map₂` in terms of monadic operations. Note that this can't be taken as the definition
 because of the lack of universe polymorphism. -/
 theorem map₂_def {α β γ : Type _} (f : α → β → γ) (a : Option α) (b : Option β) :
     map₂ f a b = f <$> a <*> b := by cases a <;> rfl
 #align option.map₂_def Option.map₂_def
+-/
 
+#print Option.map₂_some_some /-
 @[simp]
 theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = some (f a b) :=
   rfl
 #align option.map₂_some_some Option.map₂_some_some
+-/
 
+#print Option.map₂_coe_coe /-
 theorem map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b :=
   rfl
 #align option.map₂_coe_coe Option.map₂_coe_coe
+-/
 
+#print Option.map₂_none_left /-
 @[simp]
 theorem map₂_none_left (f : α → β → γ) (b : Option β) : map₂ f none b = none :=
   rfl
 #align option.map₂_none_left Option.map₂_none_left
+-/
 
+#print Option.map₂_none_right /-
 @[simp]
 theorem map₂_none_right (f : α → β → γ) (a : Option α) : map₂ f a none = none := by cases a <;> rfl
 #align option.map₂_none_right Option.map₂_none_right
+-/
 
+#print Option.map₂_coe_left /-
 @[simp]
 theorem map₂_coe_left (f : α → β → γ) (a : α) (b : Option β) : map₂ f a b = b.map fun b => f a b :=
   rfl
 #align option.map₂_coe_left Option.map₂_coe_left
+-/
 
+#print Option.map₂_coe_right /-
 @[simp]
 theorem map₂_coe_right (f : α → β → γ) (a : Option α) (b : β) : map₂ f a b = a.map fun a => f a b :=
   rfl
 #align option.map₂_coe_right Option.map₂_coe_right
+-/
 
+#print Option.mem_map₂_iff /-
 @[simp]
 theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c := by
   simp [map₂]
 #align option.mem_map₂_iff Option.mem_map₂_iff
+-/
 
+#print Option.map₂_eq_none_iff /-
 @[simp]
 theorem map₂_eq_none_iff : map₂ f a b = none ↔ a = none ∨ b = none := by
   cases a <;> cases b <;> simp
 #align option.map₂_eq_none_iff Option.map₂_eq_none_iff
+-/
 
+#print Option.map₂_swap /-
 theorem map₂_swap (f : α → β → γ) (a : Option α) (b : Option β) :
     map₂ f a b = map₂ (fun a b => f b a) b a := by cases a <;> cases b <;> rfl
 #align option.map₂_swap Option.map₂_swap
+-/
 
+#print Option.map_map₂ /-
 theorem map_map₂ (f : α → β → γ) (g : γ → δ) :
     (map₂ f a b).map g = map₂ (fun a b => g (f a b)) a b := by cases a <;> cases b <;> rfl
 #align option.map_map₂ Option.map_map₂
+-/
 
+#print Option.map₂_map_left /-
 theorem map₂_map_left (f : γ → β → δ) (g : α → γ) :
     map₂ f (a.map g) b = map₂ (fun a b => f (g a) b) a b := by cases a <;> rfl
 #align option.map₂_map_left Option.map₂_map_left
+-/
 
+#print Option.map₂_map_right /-
 theorem map₂_map_right (f : α → γ → δ) (g : β → γ) :
     map₂ f a (b.map g) = map₂ (fun a b => f a (g b)) a b := by cases b <;> rfl
 #align option.map₂_map_right Option.map₂_map_right
+-/
 
+#print Option.map₂_curry /-
 @[simp]
 theorem map₂_curry (f : α × β → γ) (a : Option α) (b : Option β) :
     map₂ (curry f) a b = Option.map f (map₂ Prod.mk a b) :=
   (map_map₂ _ _).symm
 #align option.map₂_curry Option.map₂_curry
+-/
 
+#print Option.map_uncurry /-
 @[simp]
 theorem map_uncurry (f : α → β → γ) (x : Option (α × β)) :
     x.map (uncurry f) = map₂ f (x.map Prod.fst) (x.map Prod.snd) := by cases x <;> rfl
 #align option.map_uncurry Option.map_uncurry
+-/
 
 /-!
 ### Algebraic replacement rules
@@ -129,33 +159,43 @@ The proof pattern is `map₂_lemma operation_lemma`. For example, `map₂_comm m
 -/
 
 
+#print Option.map₂_assoc /-
 theorem map₂_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     map₂ f (map₂ g a b) c = map₂ f' a (map₂ g' b c) := by
   cases a <;> cases b <;> cases c <;> simp [h_assoc]
 #align option.map₂_assoc Option.map₂_assoc
+-/
 
+#print Option.map₂_comm /-
 theorem map₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : map₂ f a b = map₂ g b a := by
   cases a <;> cases b <;> simp [h_comm]
 #align option.map₂_comm Option.map₂_comm
+-/
 
+#print Option.map₂_left_comm /-
 theorem map₂_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
     (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
     map₂ f a (map₂ g b c) = map₂ g' b (map₂ f' a c) := by
   cases a <;> cases b <;> cases c <;> simp [h_left_comm]
 #align option.map₂_left_comm Option.map₂_left_comm
+-/
 
+#print Option.map₂_right_comm /-
 theorem map₂_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
     (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
     map₂ f (map₂ g a b) c = map₂ g' (map₂ f' a c) b := by
   cases a <;> cases b <;> cases c <;> simp [h_right_comm]
 #align option.map₂_right_comm Option.map₂_right_comm
+-/
 
+#print Option.map_map₂_distrib /-
 theorem map_map₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
     (map₂ f a b).map g = map₂ f' (a.map g₁) (b.map g₂) := by
   cases a <;> cases b <;> simp [h_distrib]
 #align option.map_map₂_distrib Option.map_map₂_distrib
+-/
 
 /-!
 The following symmetric restatement are needed because unification has a hard time figuring all the
@@ -163,59 +203,77 @@ functions if you symmetrize on the spot. This is also how the other n-ary APIs d
 -/
 
 
+#print Option.map_map₂_distrib_left /-
 /-- Symmetric statement to `option.map₂_map_left_comm`. -/
 theorem map_map₂_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
     (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) : (map₂ f a b).map g = map₂ f' (a.map g') b := by
   cases a <;> cases b <;> simp [h_distrib]
 #align option.map_map₂_distrib_left Option.map_map₂_distrib_left
+-/
 
+#print Option.map_map₂_distrib_right /-
 /-- Symmetric statement to `option.map_map₂_right_comm`. -/
 theorem map_map₂_distrib_right {g : γ → δ} {f' : α → β' → δ} {g' : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' a (g' b)) : (map₂ f a b).map g = map₂ f' a (b.map g') := by
   cases a <;> cases b <;> simp [h_distrib]
 #align option.map_map₂_distrib_right Option.map_map₂_distrib_right
+-/
 
+#print Option.map₂_map_left_comm /-
 /-- Symmetric statement to `option.map_map₂_distrib_left`. -/
 theorem map₂_map_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
     (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) : map₂ f (a.map g) b = (map₂ f' a b).map g' := by
   cases a <;> cases b <;> simp [h_left_comm]
 #align option.map₂_map_left_comm Option.map₂_map_left_comm
+-/
 
+#print Option.map_map₂_right_comm /-
 /-- Symmetric statement to `option.map_map₂_distrib_right`. -/
 theorem map_map₂_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
     (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) : map₂ f a (b.map g) = (map₂ f' a b).map g' :=
   by cases a <;> cases b <;> simp [h_right_comm]
 #align option.map_map₂_right_comm Option.map_map₂_right_comm
+-/
 
+#print Option.map_map₂_antidistrib /-
 theorem map_map₂_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
     (map₂ f a b).map g = map₂ f' (b.map g₁) (a.map g₂) := by
   cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib Option.map_map₂_antidistrib
+-/
 
+#print Option.map_map₂_antidistrib_left /-
 /-- Symmetric statement to `option.map₂_map_left_anticomm`. -/
 theorem map_map₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) : (map₂ f a b).map g = map₂ f' (b.map g') a :=
   by cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib_left Option.map_map₂_antidistrib_left
+-/
 
+#print Option.map_map₂_antidistrib_right /-
 /-- Symmetric statement to `option.map_map₂_right_anticomm`. -/
 theorem map_map₂_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) : (map₂ f a b).map g = map₂ f' b (a.map g') :=
   by cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib_right Option.map_map₂_antidistrib_right
+-/
 
+#print Option.map₂_map_left_anticomm /-
 /-- Symmetric statement to `option.map_map₂_antidistrib_left`. -/
 theorem map₂_map_left_anticomm {f : α' → β → γ} {g : α → α'} {f' : β → α → δ} {g' : δ → γ}
     (h_left_anticomm : ∀ a b, f (g a) b = g' (f' b a)) :
     map₂ f (a.map g) b = (map₂ f' b a).map g' := by cases a <;> cases b <;> simp [h_left_anticomm]
 #align option.map₂_map_left_anticomm Option.map₂_map_left_anticomm
+-/
 
+#print Option.map_map₂_right_anticomm /-
 /-- Symmetric statement to `option.map_map₂_antidistrib_right`. -/
 theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
     (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
     map₂ f a (b.map g) = (map₂ f' b a).map g' := by cases a <;> cases b <;> simp [h_right_anticomm]
 #align option.map_map₂_right_anticomm Option.map_map₂_right_anticomm
+-/
 
 #print Option.map₂_left_identity /-
 /-- If `a` is a left identity for a binary operation `f`, then `some a` is a left identity for
@@ -225,11 +283,13 @@ theorem map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b =
 #align option.map₂_left_identity Option.map₂_left_identity
 -/
 
+#print Option.map₂_right_identity /-
 /-- If `b` is a right identity for a binary operation `f`, then `some b` is a right identity for
 `option.map₂ f`. -/
 theorem map₂_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (o : Option α) :
     map₂ f o (some b) = o := by simp [h, map₂]
 #align option.map₂_right_identity Option.map₂_right_identity
+-/
 
 end Option
 
Diff
@@ -221,7 +221,7 @@ theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' :
 /-- If `a` is a left identity for a binary operation `f`, then `some a` is a left identity for
 `option.map₂ f`. -/
 theorem map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (o : Option β) :
-    map₂ f (some a) o = o := by cases o; exacts[rfl, congr_arg some (h _)]
+    map₂ f (some a) o = o := by cases o; exacts [rfl, congr_arg some (h _)]
 #align option.map₂_left_identity Option.map₂_left_identity
 -/
 
Diff
@@ -48,162 +48,72 @@ def map₂ (f : α → β → γ) (a : Option α) (b : Option β) : Option γ :=
 #align option.map₂ Option.map₂
 -/
 
-/- warning: option.map₂_def -> Option.map₂_def is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} (f : α -> β -> γ) (a : Option.{u1} α) (b : Option.{u1} β), Eq.{succ u1} (Option.{u1} γ) (Option.map₂.{u1, u1, u1} α β γ f a b) (Seq.seq.{u1, u1} Option.{u1} (Applicative.toHasSeq.{u1, u1} Option.{u1} (Monad.toApplicative.{u1, u1} Option.{u1} Option.monad.{u1})) β γ (Functor.map.{u1, u1} Option.{u1} (Traversable.toFunctor.{u1} Option.{u1} Option.traversable.{u1}) α (β -> γ) f a) b)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u1}} {γ : Type.{u1}} (f : α -> β -> γ) (a : Option.{u1} α) (b : Option.{u1} β), Eq.{succ u1} (Option.{u1} γ) (Option.map₂.{u1, u1, u1} α β γ f a b) (Seq.seq.{u1, u1} Option.{u1} (Applicative.toSeq.{u1, u1} Option.{u1} (Alternative.toApplicative.{u1, u1} Option.{u1} instAlternativeOption.{u1})) β γ (Functor.map.{u1, u1} Option.{u1} instFunctorOption.{u1} α (β -> γ) f a) (fun (x._@.Mathlib.Data.Option.NAry._hyg.142 : Unit) => b))
-Case conversion may be inaccurate. Consider using '#align option.map₂_def Option.map₂_defₓ'. -/
 /-- `option.map₂` in terms of monadic operations. Note that this can't be taken as the definition
 because of the lack of universe polymorphism. -/
 theorem map₂_def {α β γ : Type _} (f : α → β → γ) (a : Option α) (b : Option β) :
     map₂ f a b = f <$> a <*> b := by cases a <;> rfl
 #align option.map₂_def Option.map₂_def
 
-/- warning: option.map₂_some_some -> Option.map₂_some_some is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f (Option.some.{u1} α a) (Option.some.{u2} β b)) (Option.some.{u3} γ (f a b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u2, u1, u3} α β γ f (Option.some.{u2} α a) (Option.some.{u1} β b)) (Option.some.{u3} γ (f a b))
-Case conversion may be inaccurate. Consider using '#align option.map₂_some_some Option.map₂_some_someₓ'. -/
 @[simp]
 theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = some (f a b) :=
   rfl
 #align option.map₂_some_some Option.map₂_some_some
 
-/- warning: option.map₂_coe_coe -> Option.map₂_coe_coe is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) α (Option.{u1} α) (HasLiftT.mk.{succ u1, succ u1} α (Option.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} α (Option.{u1} α) (coeOption.{u1} α))) a) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) β (Option.{u2} β) (HasLiftT.mk.{succ u2, succ u2} β (Option.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} β (Option.{u2} β) (coeOption.{u2} β))) b)) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) γ (Option.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} γ (Option.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} γ (Option.{u3} γ) (coeOption.{u3} γ))) (f a b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u2, u1, u3} α β γ f (Option.some.{u2} α a) (Option.some.{u1} β b)) (Option.some.{u3} γ (f a b))
-Case conversion may be inaccurate. Consider using '#align option.map₂_coe_coe Option.map₂_coe_coeₓ'. -/
 theorem map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b :=
   rfl
 #align option.map₂_coe_coe Option.map₂_coe_coe
 
-/- warning: option.map₂_none_left -> Option.map₂_none_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (b : Option.{u2} β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f (Option.none.{u1} α) b) (Option.none.{u3} γ)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} (f : α -> β -> γ) (b : Option.{u3} β), Eq.{succ u2} (Option.{u2} γ) (Option.map₂.{u1, u3, u2} α β γ f (Option.none.{u1} α) b) (Option.none.{u2} γ)
-Case conversion may be inaccurate. Consider using '#align option.map₂_none_left Option.map₂_none_leftₓ'. -/
 @[simp]
 theorem map₂_none_left (f : α → β → γ) (b : Option β) : map₂ f none b = none :=
   rfl
 #align option.map₂_none_left Option.map₂_none_left
 
-/- warning: option.map₂_none_right -> Option.map₂_none_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : Option.{u1} α), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f a (Option.none.{u2} β)) (Option.none.{u3} γ)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (a : Option.{u3} α), Eq.{succ u2} (Option.{u2} γ) (Option.map₂.{u3, u1, u2} α β γ f a (Option.none.{u1} β)) (Option.none.{u2} γ)
-Case conversion may be inaccurate. Consider using '#align option.map₂_none_right Option.map₂_none_rightₓ'. -/
 @[simp]
 theorem map₂_none_right (f : α → β → γ) (a : Option α) : map₂ f a none = none := by cases a <;> rfl
 #align option.map₂_none_right Option.map₂_none_right
 
-/- warning: option.map₂_coe_left -> Option.map₂_coe_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : α) (b : Option.{u2} β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) α (Option.{u1} α) (HasLiftT.mk.{succ u1, succ u1} α (Option.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} α (Option.{u1} α) (coeOption.{u1} α))) a) b) (Option.map.{u2, u3} β γ (fun (b : β) => f a b) b)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} (f : α -> β -> γ) (a : α) (b : Option.{u3} β), Eq.{succ u2} (Option.{u2} γ) (Option.map₂.{u1, u3, u2} α β γ f (Option.some.{u1} α a) b) (Option.map.{u3, u2} β γ (fun (b : β) => f a b) b)
-Case conversion may be inaccurate. Consider using '#align option.map₂_coe_left Option.map₂_coe_leftₓ'. -/
 @[simp]
 theorem map₂_coe_left (f : α → β → γ) (a : α) (b : Option β) : map₂ f a b = b.map fun b => f a b :=
   rfl
 #align option.map₂_coe_left Option.map₂_coe_left
 
-/- warning: option.map₂_coe_right -> Option.map₂_coe_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : Option.{u1} α) (b : β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f a ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) β (Option.{u2} β) (HasLiftT.mk.{succ u2, succ u2} β (Option.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} β (Option.{u2} β) (coeOption.{u2} β))) b)) (Option.map.{u1, u3} α γ (fun (a : α) => f a b) a)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} (f : α -> β -> γ) (a : Option.{u3} α) (b : β), Eq.{succ u2} (Option.{u2} γ) (Option.map₂.{u3, u1, u2} α β γ f a (Option.some.{u1} β b)) (Option.map.{u3, u2} α γ (fun (a : α) => f a b) a)
-Case conversion may be inaccurate. Consider using '#align option.map₂_coe_right Option.map₂_coe_rightₓ'. -/
 @[simp]
 theorem map₂_coe_right (f : α → β → γ) (a : Option α) (b : β) : map₂ f a b = a.map fun a => f a b :=
   rfl
 #align option.map₂_coe_right Option.map₂_coe_right
 
-/- warning: option.mem_map₂_iff -> Option.mem_map₂_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u2} β} {c : γ}, Iff (Membership.Mem.{u3, u3} γ (Option.{u3} γ) (Option.hasMem.{u3} γ) c (Option.map₂.{u1, u2, u3} α β γ f a b)) (Exists.{succ u1} α (fun (a' : α) => Exists.{succ u2} β (fun (b' : β) => And (Membership.Mem.{u1, u1} α (Option.{u1} α) (Option.hasMem.{u1} α) a' a) (And (Membership.Mem.{u2, u2} β (Option.{u2} β) (Option.hasMem.{u2} β) b' b) (Eq.{succ u3} γ (f a' b') c)))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u2} α} {b : Option.{u1} β} {c : γ}, Iff (Membership.mem.{u3, u3} γ (Option.{u3} γ) (Option.instMembershipOption.{u3} γ) c (Option.map₂.{u2, u1, u3} α β γ f a b)) (Exists.{succ u2} α (fun (a' : α) => Exists.{succ u1} β (fun (b' : β) => And (Membership.mem.{u2, u2} α (Option.{u2} α) (Option.instMembershipOption.{u2} α) a' a) (And (Membership.mem.{u1, u1} β (Option.{u1} β) (Option.instMembershipOption.{u1} β) b' b) (Eq.{succ u3} γ (f a' b') c)))))
-Case conversion may be inaccurate. Consider using '#align option.mem_map₂_iff Option.mem_map₂_iffₓ'. -/
 @[simp]
 theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c := by
   simp [map₂]
 #align option.mem_map₂_iff Option.mem_map₂_iff
 
-/- warning: option.map₂_eq_none_iff -> Option.map₂_eq_none_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u2} β}, Iff (Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f a b) (Option.none.{u3} γ)) (Or (Eq.{succ u1} (Option.{u1} α) a (Option.none.{u1} α)) (Eq.{succ u2} (Option.{u2} β) b (Option.none.{u2} β)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u2} α} {b : Option.{u1} β}, Iff (Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u2, u1, u3} α β γ f a b) (Option.none.{u3} γ)) (Or (Eq.{succ u2} (Option.{u2} α) a (Option.none.{u2} α)) (Eq.{succ u1} (Option.{u1} β) b (Option.none.{u1} β)))
-Case conversion may be inaccurate. Consider using '#align option.map₂_eq_none_iff Option.map₂_eq_none_iffₓ'. -/
 @[simp]
 theorem map₂_eq_none_iff : map₂ f a b = none ↔ a = none ∨ b = none := by
   cases a <;> cases b <;> simp
 #align option.map₂_eq_none_iff Option.map₂_eq_none_iff
 
-/- warning: option.map₂_swap -> Option.map₂_swap is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (a : Option.{u1} α) (b : Option.{u2} β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f a b) (Option.map₂.{u2, u1, u3} β α γ (fun (a : β) (b : α) => f b a) b a)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (a : Option.{u3} α) (b : Option.{u2} β), Eq.{succ u1} (Option.{u1} γ) (Option.map₂.{u3, u2, u1} α β γ f a b) (Option.map₂.{u2, u3, u1} β α γ (fun (a : β) (b : α) => f b a) b a)
-Case conversion may be inaccurate. Consider using '#align option.map₂_swap Option.map₂_swapₓ'. -/
 theorem map₂_swap (f : α → β → γ) (a : Option α) (b : Option β) :
     map₂ f a b = map₂ (fun a b => f b a) b a := by cases a <;> cases b <;> rfl
 #align option.map₂_swap Option.map₂_swap
 
-/- warning: option.map_map₂ -> Option.map_map₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {a : Option.{u1} α} {b : Option.{u2} β} (f : α -> β -> γ) (g : γ -> δ), Eq.{succ u4} (Option.{u4} δ) (Option.map.{u3, u4} γ δ g (Option.map₂.{u1, u2, u3} α β γ f a b)) (Option.map₂.{u1, u2, u4} α β δ (fun (a : α) (b : β) => g (f a b)) a b)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Option.{u2} α} {a : Option.{u1} β} {b : Type.{u4}} (f : α -> β -> γ) (g : γ -> b), Eq.{succ u4} (Option.{u4} b) (Option.map.{u3, u4} γ b g (Option.map₂.{u2, u1, u3} α β γ f δ a)) (Option.map₂.{u2, u1, u4} α β b (fun (a : α) (b : β) => g (f a b)) δ a)
-Case conversion may be inaccurate. Consider using '#align option.map_map₂ Option.map_map₂ₓ'. -/
 theorem map_map₂ (f : α → β → γ) (g : γ → δ) :
     (map₂ f a b).map g = map₂ (fun a b => g (f a b)) a b := by cases a <;> cases b <;> rfl
 #align option.map_map₂ Option.map_map₂
 
-/- warning: option.map₂_map_left -> Option.map₂_map_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {a : Option.{u1} α} {b : Option.{u2} β} (f : γ -> β -> δ) (g : α -> γ), Eq.{succ u4} (Option.{u4} δ) (Option.map₂.{u3, u2, u4} γ β δ f (Option.map.{u1, u3} α γ g a) b) (Option.map₂.{u1, u2, u4} α β δ (fun (a : α) (b : β) => f (g a) b) a b)
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Option.{u1} α} {a : Option.{u2} β} {b : Type.{u4}} (f : γ -> β -> b) (g : α -> γ), Eq.{succ u4} (Option.{u4} b) (Option.map₂.{u3, u2, u4} γ β b f (Option.map.{u1, u3} α γ g δ) a) (Option.map₂.{u1, u2, u4} α β b (fun (a : α) (b : β) => f (g a) b) δ a)
-Case conversion may be inaccurate. Consider using '#align option.map₂_map_left Option.map₂_map_leftₓ'. -/
 theorem map₂_map_left (f : γ → β → δ) (g : α → γ) :
     map₂ f (a.map g) b = map₂ (fun a b => f (g a) b) a b := by cases a <;> rfl
 #align option.map₂_map_left Option.map₂_map_left
 
-/- warning: option.map₂_map_right -> Option.map₂_map_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {a : Option.{u1} α} {b : Option.{u2} β} (f : α -> γ -> δ) (g : β -> γ), Eq.{succ u4} (Option.{u4} δ) (Option.map₂.{u1, u3, u4} α γ δ f a (Option.map.{u2, u3} β γ g b)) (Option.map₂.{u1, u2, u4} α β δ (fun (a : α) (b : β) => f a (g b)) a b)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Option.{u3} α} {a : Option.{u1} β} {b : Type.{u4}} (f : α -> γ -> b) (g : β -> γ), Eq.{succ u4} (Option.{u4} b) (Option.map₂.{u3, u2, u4} α γ b f δ (Option.map.{u1, u2} β γ g a)) (Option.map₂.{u3, u1, u4} α β b (fun (a : α) (b : β) => f a (g b)) δ a)
-Case conversion may be inaccurate. Consider using '#align option.map₂_map_right Option.map₂_map_rightₓ'. -/
 theorem map₂_map_right (f : α → γ → δ) (g : β → γ) :
     map₂ f a (b.map g) = map₂ (fun a b => f a (g b)) a b := by cases b <;> rfl
 #align option.map₂_map_right Option.map₂_map_right
 
-/- warning: option.map₂_curry -> Option.map₂_curry is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : (Prod.{u1, u2} α β) -> γ) (a : Option.{u1} α) (b : Option.{u2} β), Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ (Function.curry.{u1, u2, u3} α β γ f) a b) (Option.map.{max u1 u2, u3} (Prod.{u1, u2} α β) γ f (Option.map₂.{u1, u2, max u1 u2} α β (Prod.{u1, u2} α β) (Prod.mk.{u1, u2} α β) a b))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : (Prod.{u3, u2} α β) -> γ) (a : Option.{u3} α) (b : Option.{u2} β), Eq.{succ u1} (Option.{u1} γ) (Option.map₂.{u3, u2, u1} α β γ (Function.curry.{u3, u2, u1} α β γ f) a b) (Option.map.{max u3 u2, u1} (Prod.{u3, u2} α β) γ f (Option.map₂.{u3, u2, max u3 u2} α β (Prod.{u3, u2} α β) (Prod.mk.{u3, u2} α β) a b))
-Case conversion may be inaccurate. Consider using '#align option.map₂_curry Option.map₂_curryₓ'. -/
 @[simp]
 theorem map₂_curry (f : α × β → γ) (a : Option α) (b : Option β) :
     map₂ (curry f) a b = Option.map f (map₂ Prod.mk a b) :=
   (map_map₂ _ _).symm
 #align option.map₂_curry Option.map₂_curry
 
-/- warning: option.map_uncurry -> Option.map_uncurry is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (x : Option.{max u1 u2} (Prod.{u1, u2} α β)), Eq.{succ u3} (Option.{u3} γ) (Option.map.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (Function.uncurry.{u1, u2, u3} α β γ f) x) (Option.map₂.{u1, u2, u3} α β γ f (Option.map.{max u1 u2, u1} (Prod.{u1, u2} α β) α (Prod.fst.{u1, u2} α β) x) (Option.map.{max u1 u2, u2} (Prod.{u1, u2} α β) β (Prod.snd.{u1, u2} α β) x))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u3}} {γ : Type.{u1}} (f : α -> β -> γ) (x : Option.{max u3 u2} (Prod.{u2, u3} α β)), Eq.{succ u1} (Option.{u1} γ) (Option.map.{max u3 u2, u1} (Prod.{u2, u3} α β) γ (Function.uncurry.{u2, u3, u1} α β γ f) x) (Option.map₂.{u2, u3, u1} α β γ f (Option.map.{max u3 u2, u2} (Prod.{u2, u3} α β) α (Prod.fst.{u2, u3} α β) x) (Option.map.{max u3 u2, u3} (Prod.{u2, u3} α β) β (Prod.snd.{u2, u3} α β) x))
-Case conversion may be inaccurate. Consider using '#align option.map_uncurry Option.map_uncurryₓ'. -/
 @[simp]
 theorem map_uncurry (f : α → β → γ) (x : Option (α × β)) :
     x.map (uncurry f) = map₂ f (x.map Prod.fst) (x.map Prod.snd) := by cases x <;> rfl
@@ -219,58 +129,28 @@ The proof pattern is `map₂_lemma operation_lemma`. For example, `map₂_comm m
 -/
 
 
-/- warning: option.map₂_assoc -> Option.map₂_assoc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {ε' : Type.{u6}} {a : Option.{u1} α} {b : Option.{u2} β} {c : Option.{u3} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> ε' -> ε} {g' : β -> γ -> ε'}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f (g a b) c) (f' a (g' b c))) -> (Eq.{succ u5} (Option.{u5} ε) (Option.map₂.{u4, u3, u5} δ γ ε f (Option.map₂.{u1, u2, u4} α β δ g a b) c) (Option.map₂.{u1, u6, u5} α ε' ε f' a (Option.map₂.{u2, u3, u6} β γ ε' g' b c)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Option.{u2} α} {ε : Option.{u1} β} {ε' : Option.{u3} γ} {a : Type.{u6}} {b : Type.{u5}} {c : Type.{u4}} {f : a -> γ -> b} {g : α -> β -> a} {f' : α -> c -> b} {g' : β -> γ -> c}, (forall (a : α) (b_1 : β) (c : γ), Eq.{succ u5} b (f (g a b_1) c) (f' a (g' b_1 c))) -> (Eq.{succ u5} (Option.{u5} b) (Option.map₂.{u6, u3, u5} a γ b f (Option.map₂.{u2, u1, u6} α β a g δ ε) ε') (Option.map₂.{u2, u4, u5} α c b f' δ (Option.map₂.{u1, u3, u4} β γ c g' ε ε')))
-Case conversion may be inaccurate. Consider using '#align option.map₂_assoc Option.map₂_assocₓ'. -/
 theorem map₂_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     map₂ f (map₂ g a b) c = map₂ f' a (map₂ g' b c) := by
   cases a <;> cases b <;> cases c <;> simp [h_assoc]
 #align option.map₂_assoc Option.map₂_assoc
 
-/- warning: option.map₂_comm -> Option.map₂_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u2} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u1, u2, u3} α β γ f a b) (Option.map₂.{u2, u1, u3} β α γ g b a))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {a : Option.{u2} α} {b : Option.{u1} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Option.{u3} γ) (Option.map₂.{u2, u1, u3} α β γ f a b) (Option.map₂.{u1, u2, u3} β α γ g b a))
-Case conversion may be inaccurate. Consider using '#align option.map₂_comm Option.map₂_commₓ'. -/
 theorem map₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : map₂ f a b = map₂ g b a := by
   cases a <;> cases b <;> simp [h_comm]
 #align option.map₂_comm Option.map₂_comm
 
-/- warning: option.map₂_left_comm -> Option.map₂_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {δ' : Type.{u5}} {ε : Type.{u6}} {a : Option.{u1} α} {b : Option.{u2} β} {c : Option.{u3} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f' : α -> γ -> δ'} {g' : β -> δ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f a (g b c)) (g' b (f' a c))) -> (Eq.{succ u6} (Option.{u6} ε) (Option.map₂.{u1, u4, u6} α δ ε f a (Option.map₂.{u2, u3, u4} β γ δ g b c)) (Option.map₂.{u2, u5, u6} β δ' ε g' b (Option.map₂.{u1, u3, u5} α γ δ' f' a c)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Option.{u3} α} {δ' : Option.{u2} β} {ε : Option.{u1} γ} {a : Type.{u6}} {b : Type.{u5}} {c : Type.{u4}} {f : α -> a -> b} {g : β -> γ -> a} {f' : α -> γ -> c} {g' : β -> c -> b}, (forall (a : α) (b_1 : β) (c : γ), Eq.{succ u5} b (f a (g b_1 c)) (g' b_1 (f' a c))) -> (Eq.{succ u5} (Option.{u5} b) (Option.map₂.{u3, u6, u5} α a b f δ (Option.map₂.{u2, u1, u6} β γ a g δ' ε)) (Option.map₂.{u2, u4, u5} β c b g' δ' (Option.map₂.{u3, u1, u4} α γ c f' δ ε)))
-Case conversion may be inaccurate. Consider using '#align option.map₂_left_comm Option.map₂_left_commₓ'. -/
 theorem map₂_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
     (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
     map₂ f a (map₂ g b c) = map₂ g' b (map₂ f' a c) := by
   cases a <;> cases b <;> cases c <;> simp [h_left_comm]
 #align option.map₂_left_comm Option.map₂_left_comm
 
-/- warning: option.map₂_right_comm -> Option.map₂_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {δ' : Type.{u5}} {ε : Type.{u6}} {a : Option.{u1} α} {b : Option.{u2} β} {c : Option.{u3} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> γ -> δ'} {g' : δ' -> β -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (g' (f' a c) b)) -> (Eq.{succ u6} (Option.{u6} ε) (Option.map₂.{u4, u3, u6} δ γ ε f (Option.map₂.{u1, u2, u4} α β δ g a b) c) (Option.map₂.{u5, u2, u6} δ' β ε g' (Option.map₂.{u1, u3, u5} α γ δ' f' a c) b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Option.{u2} α} {δ' : Option.{u1} β} {ε : Option.{u3} γ} {a : Type.{u6}} {b : Type.{u5}} {c : Type.{u4}} {f : a -> γ -> b} {g : α -> β -> a} {f' : α -> γ -> c} {g' : c -> β -> b}, (forall (a : α) (b_1 : β) (c : γ), Eq.{succ u5} b (f (g a b_1) c) (g' (f' a c) b_1)) -> (Eq.{succ u5} (Option.{u5} b) (Option.map₂.{u6, u3, u5} a γ b f (Option.map₂.{u2, u1, u6} α β a g δ δ') ε) (Option.map₂.{u4, u1, u5} c β b g' (Option.map₂.{u2, u3, u4} α γ c f' δ ε) δ'))
-Case conversion may be inaccurate. Consider using '#align option.map₂_right_comm Option.map₂_right_commₓ'. -/
 theorem map₂_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
     (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
     map₂ f (map₂ g a b) c = map₂ g' (map₂ f' a c) b := by
   cases a <;> cases b <;> cases c <;> simp [h_right_comm]
 #align option.map₂_right_comm Option.map₂_right_comm
 
-/- warning: option.map_map₂_distrib -> Option.map_map₂_distrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Option.{u6} δ) (Option.map.{u5, u6} γ δ g (Option.map₂.{u1, u3, u5} α β γ f a b)) (Option.map₂.{u2, u4, u6} α' β' δ f' (Option.map.{u1, u2} α α' g₁ a) (Option.map.{u3, u4} β β' g₂ b)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u1}} {β : Type.{u3}} {β' : α -> α' -> β} {γ : Option.{u2} α} {δ : Option.{u1} α'} {f : Type.{u6}} {a : Type.{u5}} {b : Type.{u4}} {g : β -> f} {f' : a -> b -> f} {g₁ : α -> a} {g₂ : α' -> b}, (forall (a : α) (b : α'), Eq.{succ u6} f (g (β' a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Option.{u6} f) (Option.map.{u3, u6} β f g (Option.map₂.{u2, u1, u3} α α' β β' γ δ)) (Option.map₂.{u5, u4, u6} a b f f' (Option.map.{u2, u5} α a g₁ γ) (Option.map.{u1, u4} α' b g₂ δ)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_distrib Option.map_map₂_distribₓ'. -/
 theorem map_map₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
     (map₂ f a b).map g = map₂ f' (a.map g₁) (b.map g₂) := by
@@ -283,108 +163,54 @@ functions if you symmetrize on the spot. This is also how the other n-ary APIs d
 -/
 
 
-/- warning: option.map_map₂_distrib_left -> Option.map_map₂_distrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u3} β} {g : γ -> δ} {f' : α' -> β -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' a) b)) -> (Eq.{succ u5} (Option.{u5} δ) (Option.map.{u4, u5} γ δ g (Option.map₂.{u1, u3, u4} α β γ f a b)) (Option.map₂.{u2, u3, u5} α' β δ f' (Option.map.{u1, u2} α α' g' a) b))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u1}} {β : Type.{u3}} {γ : α -> α' -> β} {δ : Option.{u2} α} {f : Option.{u1} α'} {a : Type.{u5}} {b : Type.{u4}} {g : β -> a} {f' : b -> α' -> a} {g' : α -> b}, (forall (a_1 : α) (b : α'), Eq.{succ u5} a (g (γ a_1 b)) (f' (g' a_1) b)) -> (Eq.{succ u5} (Option.{u5} a) (Option.map.{u3, u5} β a g (Option.map₂.{u2, u1, u3} α α' β γ δ f)) (Option.map₂.{u4, u1, u5} b α' a f' (Option.map.{u2, u4} α b g' δ) f))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_distrib_left Option.map_map₂_distrib_leftₓ'. -/
 /-- Symmetric statement to `option.map₂_map_left_comm`. -/
 theorem map_map₂_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
     (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) : (map₂ f a b).map g = map₂ f' (a.map g') b := by
   cases a <;> cases b <;> simp [h_distrib]
 #align option.map_map₂_distrib_left Option.map_map₂_distrib_left
 
-/- warning: option.map_map₂_distrib_right -> Option.map_map₂_distrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u2} β} {g : γ -> δ} {f' : α -> β' -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' a (g' b))) -> (Eq.{succ u5} (Option.{u5} δ) (Option.map.{u4, u5} γ δ g (Option.map₂.{u1, u2, u4} α β γ f a b)) (Option.map₂.{u1, u3, u5} α β' δ f' a (Option.map.{u2, u3} β β' g' b)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {β' : Type.{u3}} {γ : α -> β -> β'} {δ : Option.{u2} α} {f : Option.{u1} β} {a : Type.{u5}} {b : Type.{u4}} {g : β' -> a} {f' : α -> b -> a} {g' : β -> b}, (forall (a_1 : α) (b : β), Eq.{succ u5} a (g (γ a_1 b)) (f' a_1 (g' b))) -> (Eq.{succ u5} (Option.{u5} a) (Option.map.{u3, u5} β' a g (Option.map₂.{u2, u1, u3} α β β' γ δ f)) (Option.map₂.{u2, u4, u5} α b a f' δ (Option.map.{u1, u4} β b g' f)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_distrib_right Option.map_map₂_distrib_rightₓ'. -/
 /-- Symmetric statement to `option.map_map₂_right_comm`. -/
 theorem map_map₂_distrib_right {g : γ → δ} {f' : α → β' → δ} {g' : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' a (g' b)) : (map₂ f a b).map g = map₂ f' a (b.map g') := by
   cases a <;> cases b <;> simp [h_distrib]
 #align option.map_map₂_distrib_right Option.map_map₂_distrib_right
 
-/- warning: option.map₂_map_left_comm -> Option.map₂_map_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {a : Option.{u1} α} {b : Option.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' a b))) -> (Eq.{succ u4} (Option.{u4} γ) (Option.map₂.{u2, u3, u4} α' β γ f (Option.map.{u1, u2} α α' g a) b) (Option.map.{u5, u4} δ γ g' (Option.map₂.{u1, u3, u5} α β δ f' a b)))
-but is expected to have type
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Option.{u1} α} {δ : Option.{u2} α'} {a : Type.{u5}} {b : Type.{u4}} {f : a -> α' -> β} {g : α -> a} {f' : α -> α' -> b} {g' : b -> β}, (forall (a : α) (b : α'), Eq.{succ u3} β (f (g a) b) (g' (f' a b))) -> (Eq.{succ u3} (Option.{u3} β) (Option.map₂.{u5, u2, u3} a α' β f (Option.map.{u1, u5} α a g γ) δ) (Option.map.{u4, u3} b β g' (Option.map₂.{u1, u2, u4} α α' b f' γ δ)))
-Case conversion may be inaccurate. Consider using '#align option.map₂_map_left_comm Option.map₂_map_left_commₓ'. -/
 /-- Symmetric statement to `option.map_map₂_distrib_left`. -/
 theorem map₂_map_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
     (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) : map₂ f (a.map g) b = (map₂ f' a b).map g' := by
   cases a <;> cases b <;> simp [h_left_comm]
 #align option.map₂_map_left_comm Option.map₂_map_left_comm
 
-/- warning: option.map_map₂_right_comm -> Option.map_map₂_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {a : Option.{u1} α} {b : Option.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' a b))) -> (Eq.{succ u4} (Option.{u4} γ) (Option.map₂.{u1, u3, u4} α β' γ f a (Option.map.{u2, u3} β β' g b)) (Option.map.{u5, u4} δ γ g' (Option.map₂.{u1, u2, u5} α β δ f' a b)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {β' : Type.{u3}} {γ : Option.{u2} α} {δ : Option.{u1} β} {a : Type.{u5}} {b : Type.{u4}} {f : α -> a -> β'} {g : β -> a} {f' : α -> β -> b} {g' : b -> β'}, (forall (a : α) (b : β), Eq.{succ u3} β' (f a (g b)) (g' (f' a b))) -> (Eq.{succ u3} (Option.{u3} β') (Option.map₂.{u2, u5, u3} α a β' f γ (Option.map.{u1, u5} β a g δ)) (Option.map.{u4, u3} b β' g' (Option.map₂.{u2, u1, u4} α β b f' γ δ)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_right_comm Option.map_map₂_right_commₓ'. -/
 /-- Symmetric statement to `option.map_map₂_distrib_right`. -/
 theorem map_map₂_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
     (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) : map₂ f a (b.map g) = (map₂ f' a b).map g' :=
   by cases a <;> cases b <;> simp [h_right_comm]
 #align option.map_map₂_right_comm Option.map_map₂_right_comm
 
-/- warning: option.map_map₂_antidistrib -> Option.map_map₂_antidistrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u3} β} {g : γ -> δ} {f' : β' -> α' -> δ} {g₁ : β -> β'} {g₂ : α -> α'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Option.{u6} δ) (Option.map.{u5, u6} γ δ g (Option.map₂.{u1, u3, u5} α β γ f a b)) (Option.map₂.{u4, u2, u6} β' α' δ f' (Option.map.{u3, u4} β β' g₁ b) (Option.map.{u1, u2} α α' g₂ a)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u1}} {β : Type.{u3}} {β' : α -> α' -> β} {γ : Option.{u2} α} {δ : Option.{u1} α'} {f : Type.{u6}} {a : Type.{u5}} {b : Type.{u4}} {g : β -> f} {f' : a -> b -> f} {g₁ : α' -> a} {g₂ : α -> b}, (forall (a : α) (b : α'), Eq.{succ u6} f (g (β' a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Option.{u6} f) (Option.map.{u3, u6} β f g (Option.map₂.{u2, u1, u3} α α' β β' γ δ)) (Option.map₂.{u5, u4, u6} a b f f' (Option.map.{u1, u5} α' a g₁ δ) (Option.map.{u2, u4} α b g₂ γ)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_antidistrib Option.map_map₂_antidistribₓ'. -/
 theorem map_map₂_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
     (map₂ f a b).map g = map₂ f' (b.map g₁) (a.map g₂) := by
   cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib Option.map_map₂_antidistrib
 
-/- warning: option.map_map₂_antidistrib_left -> Option.map_map₂_antidistrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u2} β} {g : γ -> δ} {f' : β' -> α -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' b) a)) -> (Eq.{succ u5} (Option.{u5} δ) (Option.map.{u4, u5} γ δ g (Option.map₂.{u1, u2, u4} α β γ f a b)) (Option.map₂.{u3, u1, u5} β' α δ f' (Option.map.{u2, u3} β β' g' b) a))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {β' : Type.{u3}} {γ : α -> β -> β'} {δ : Option.{u2} α} {f : Option.{u1} β} {a : Type.{u5}} {b : Type.{u4}} {g : β' -> a} {f' : b -> α -> a} {g' : β -> b}, (forall (a_1 : α) (b : β), Eq.{succ u5} a (g (γ a_1 b)) (f' (g' b) a_1)) -> (Eq.{succ u5} (Option.{u5} a) (Option.map.{u3, u5} β' a g (Option.map₂.{u2, u1, u3} α β β' γ δ f)) (Option.map₂.{u4, u2, u5} b α a f' (Option.map.{u1, u4} β b g' f) δ))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_antidistrib_left Option.map_map₂_antidistrib_leftₓ'. -/
 /-- Symmetric statement to `option.map₂_map_left_anticomm`. -/
 theorem map_map₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) : (map₂ f a b).map g = map₂ f' (b.map g') a :=
   by cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib_left Option.map_map₂_antidistrib_left
 
-/- warning: option.map_map₂_antidistrib_right -> Option.map_map₂_antidistrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {a : Option.{u1} α} {b : Option.{u3} β} {g : γ -> δ} {f' : β -> α' -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' b (g' a))) -> (Eq.{succ u5} (Option.{u5} δ) (Option.map.{u4, u5} γ δ g (Option.map₂.{u1, u3, u4} α β γ f a b)) (Option.map₂.{u3, u2, u5} β α' δ f' b (Option.map.{u1, u2} α α' g' a)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u1}} {β : Type.{u3}} {γ : α -> α' -> β} {δ : Option.{u2} α} {f : Option.{u1} α'} {a : Type.{u5}} {b : Type.{u4}} {g : β -> a} {f' : α' -> b -> a} {g' : α -> b}, (forall (a_1 : α) (b : α'), Eq.{succ u5} a (g (γ a_1 b)) (f' b (g' a_1))) -> (Eq.{succ u5} (Option.{u5} a) (Option.map.{u3, u5} β a g (Option.map₂.{u2, u1, u3} α α' β γ δ f)) (Option.map₂.{u1, u4, u5} α' b a f' f (Option.map.{u2, u4} α b g' δ)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_antidistrib_right Option.map_map₂_antidistrib_rightₓ'. -/
 /-- Symmetric statement to `option.map_map₂_right_anticomm`. -/
 theorem map_map₂_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) : (map₂ f a b).map g = map₂ f' b (a.map g') :=
   by cases a <;> cases b <;> simp [h_antidistrib]
 #align option.map_map₂_antidistrib_right Option.map_map₂_antidistrib_right
 
-/- warning: option.map₂_map_left_anticomm -> Option.map₂_map_left_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {a : Option.{u1} α} {b : Option.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' b a))) -> (Eq.{succ u4} (Option.{u4} γ) (Option.map₂.{u2, u3, u4} α' β γ f (Option.map.{u1, u2} α α' g a) b) (Option.map.{u5, u4} δ γ g' (Option.map₂.{u3, u1, u5} β α δ f' b a)))
-but is expected to have type
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Option.{u1} α} {δ : Option.{u2} α'} {a : Type.{u5}} {b : Type.{u4}} {f : a -> α' -> β} {g : α -> a} {f' : α' -> α -> b} {g' : b -> β}, (forall (a : α) (b : α'), Eq.{succ u3} β (f (g a) b) (g' (f' b a))) -> (Eq.{succ u3} (Option.{u3} β) (Option.map₂.{u5, u2, u3} a α' β f (Option.map.{u1, u5} α a g γ) δ) (Option.map.{u4, u3} b β g' (Option.map₂.{u2, u1, u4} α' α b f' δ γ)))
-Case conversion may be inaccurate. Consider using '#align option.map₂_map_left_anticomm Option.map₂_map_left_anticommₓ'. -/
 /-- Symmetric statement to `option.map_map₂_antidistrib_left`. -/
 theorem map₂_map_left_anticomm {f : α' → β → γ} {g : α → α'} {f' : β → α → δ} {g' : δ → γ}
     (h_left_anticomm : ∀ a b, f (g a) b = g' (f' b a)) :
     map₂ f (a.map g) b = (map₂ f' b a).map g' := by cases a <;> cases b <;> simp [h_left_anticomm]
 #align option.map₂_map_left_anticomm Option.map₂_map_left_anticomm
 
-/- warning: option.map_map₂_right_anticomm -> Option.map_map₂_right_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {a : Option.{u1} α} {b : Option.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' b a))) -> (Eq.{succ u4} (Option.{u4} γ) (Option.map₂.{u1, u3, u4} α β' γ f a (Option.map.{u2, u3} β β' g b)) (Option.map.{u5, u4} δ γ g' (Option.map₂.{u2, u1, u5} β α δ f' b a)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {β' : Type.{u3}} {γ : Option.{u2} α} {δ : Option.{u1} β} {a : Type.{u5}} {b : Type.{u4}} {f : α -> a -> β'} {g : β -> a} {f' : β -> α -> b} {g' : b -> β'}, (forall (a : α) (b : β), Eq.{succ u3} β' (f a (g b)) (g' (f' b a))) -> (Eq.{succ u3} (Option.{u3} β') (Option.map₂.{u2, u5, u3} α a β' f γ (Option.map.{u1, u5} β a g δ)) (Option.map.{u4, u3} b β' g' (Option.map₂.{u1, u2, u4} β α b f' δ γ)))
-Case conversion may be inaccurate. Consider using '#align option.map_map₂_right_anticomm Option.map_map₂_right_anticommₓ'. -/
 /-- Symmetric statement to `option.map_map₂_antidistrib_right`. -/
 theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
     (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
@@ -399,12 +225,6 @@ theorem map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b =
 #align option.map₂_left_identity Option.map₂_left_identity
 -/
 
-/- warning: option.map₂_right_identity -> Option.map₂_right_identity is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> β -> α} {b : β}, (forall (a : α), Eq.{succ u1} α (f a b) a) -> (forall (o : Option.{u1} α), Eq.{succ u1} (Option.{u1} α) (Option.map₂.{u1, u2, u1} α β α f o (Option.some.{u2} β b)) o)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> β -> α} {b : β}, (forall (a : α), Eq.{succ u2} α (f a b) a) -> (forall (o : Option.{u2} α), Eq.{succ u2} (Option.{u2} α) (Option.map₂.{u2, u1, u2} α β α f o (Option.some.{u1} β b)) o)
-Case conversion may be inaccurate. Consider using '#align option.map₂_right_identity Option.map₂_right_identityₓ'. -/
 /-- If `b` is a right identity for a binary operation `f`, then `some b` is a right identity for
 `option.map₂ f`. -/
 theorem map₂_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (o : Option α) :
Diff
@@ -395,9 +395,7 @@ theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' :
 /-- If `a` is a left identity for a binary operation `f`, then `some a` is a left identity for
 `option.map₂ f`. -/
 theorem map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (o : Option β) :
-    map₂ f (some a) o = o := by
-  cases o
-  exacts[rfl, congr_arg some (h _)]
+    map₂ f (some a) o = o := by cases o; exacts[rfl, congr_arg some (h _)]
 #align option.map₂_left_identity Option.map₂_left_identity
 -/
 

Changes in mathlib4

mathlib3
mathlib4
chore: remove autoImplicit from more files (#11798)

and reduce its scope in a few other instances. Mostly in CategoryTheory and Data this time; some Combinatorics also.

Co-authored-by: Richard Osborn <richardosborn@mac.com>

Diff
@@ -27,15 +27,13 @@ We do not define `Option.map₃` as its only purpose so far would be to prove pr
 `Option.map₂` and casing already fulfills this task.
 -/
 
-set_option autoImplicit true
-
 universe u
 
 open Function
 
 namespace Option
 
-variable {f : α → β → γ} {a : Option α} {b : Option β} {c : Option γ}
+variable {α β γ δ : Type*} {f : α → β → γ} {a : Option α} {b : Option β} {c : Option γ}
 
 /-- The image of a binary function `f : α → β → γ` as a function `Option α → Option β → Option γ`.
 Mathematically this should be thought of as the image of the corresponding function `α × β → γ`. -/
@@ -121,6 +119,8 @@ The proof pattern is `map₂_lemma operation_lemma`. For example, `map₂_comm m
 `map₂ (*) a b = map₂ (*) g f` in a `CommSemigroup`.
 -/
 
+variable {α' β' δ' ε ε' : Type*}
+
 theorem map₂_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     map₂ f (map₂ g a b) c = map₂ f' a (map₂ g' b c) :=
chore: classify "simp can prove" porting notes (#11550)

Classifies by adding issue number #10618 to porting notes claiming "simp can prove it".

Diff
@@ -50,7 +50,7 @@ theorem map₂_def {α β γ : Type u} (f : α → β → γ) (a : Option α) (b
   by cases a <;> rfl
 #align option.map₂_def Option.map₂_def
 
--- Porting note: In Lean3, was `@[simp]` but now `simp` can prove it
+-- Porting note (#10618): In Lean3, was `@[simp]` but now `simp` can prove it
 theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b := rfl
 #align option.map₂_some_some Option.map₂_some_some
 
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
@@ -50,7 +50,7 @@ theorem map₂_def {α β γ : Type u} (f : α → β → γ) (a : Option α) (b
   by cases a <;> rfl
 #align option.map₂_def Option.map₂_def
 
--- porting note: In Lean3, was `@[simp]` but now `simp` can prove it
+-- Porting note: In Lean3, was `@[simp]` but now `simp` can prove it
 theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b := rfl
 #align option.map₂_some_some Option.map₂_some_some
 
@@ -70,13 +70,13 @@ theorem map₂_coe_left (f : α → β → γ) (a : α) (b : Option β) : map₂
   rfl
 #align option.map₂_coe_left Option.map₂_coe_left
 
--- porting note: This proof was `rfl` in Lean3, but now is not.
+-- Porting note: This proof was `rfl` in Lean3, but now is not.
 @[simp]
 theorem map₂_coe_right (f : α → β → γ) (a : Option α) (b : β) : map₂ f a b = a.map fun a => f a b :=
   by cases a <;> rfl
 #align option.map₂_coe_right Option.map₂_coe_right
 
--- porting note: Removed the `@[simp]` tag as membership of an `Option` is no-longer simp-normal.
+-- Porting note: Removed the `@[simp]` tag as membership of an `Option` is no-longer simp-normal.
 theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c :=
   by simp [map₂]
 #align option.mem_map₂_iff Option.mem_map₂_iff
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
@@ -3,7 +3,7 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathlib.Data.Option.Basic
+import Mathlib.Init.Function
 
 #align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
 
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
@@ -29,6 +29,7 @@ We do not define `Option.map₃` as its only purpose so far would be to prove pr
 
 set_option autoImplicit true
 
+universe u
 
 open Function
 
@@ -44,7 +45,7 @@ def map₂ (f : α → β → γ) (a : Option α) (b : Option β) : Option γ :=
 
 /-- `Option.map₂` in terms of monadic operations. Note that this can't be taken as the definition
 because of the lack of universe polymorphism. -/
-theorem map₂_def {α β γ : Type _} (f : α → β → γ) (a : Option α) (b : Option β) :
+theorem map₂_def {α β γ : Type u} (f : α → β → γ) (a : Option α) (b : Option β) :
     map₂ f a b = f <$> a <*> b :=
   by cases a <;> rfl
 #align option.map₂_def Option.map₂_def
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
@@ -27,6 +27,8 @@ We do not define `Option.map₃` as its only purpose so far would be to prove pr
 `Option.map₂` and casing already fulfills this task.
 -/
 
+set_option autoImplicit true
+
 
 open Function
 
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,14 +2,11 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.option.n_ary
-! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Option.Basic
 
+#align_import data.option.n_ary from "leanprover-community/mathlib"@"995b47e555f1b6297c7cf16855f1023e355219fb"
+
 /-!
 # Binary map of options
 
chore: update SHA of already forward-ported files (#2181)

Update some SHAs of files that changed in mathlib3.

These 17 files need mainly only updated SHA as they've been only touched by backports or already have been forward-ported.

The relevant changes are:

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.option.n_ary
-! leanprover-community/mathlib commit 2258b40dacd2942571c8ce136215350c702dc78f
+! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
Refactor: use Option.map₂ (#1439)

This is a forward-port of leanprover-community/mathlib#18081

Diff
@@ -209,4 +209,18 @@ theorem map_map₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' :
     map₂ f a (b.map g) = (map₂ f' b a).map g' := by cases a <;> cases b <;> simp [h_right_anticomm]
 #align option.map_map₂_right_anticomm Option.map_map₂_right_anticomm
 
+/-- If `a` is a left identity for a binary operation `f`, then `some a` is a left identity for
+`Option.map₂ f`. -/
+lemma map₂_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (o : Option β) :
+    map₂ f (some a) o = o := by
+  cases o; exacts [rfl, congr_arg some (h _)]
+#align option.map₂_left_identity Option.map₂_left_identity
+
+/-- If `b` is a right identity for a binary operation `f`, then `some b` is a right identity for
+`Option.map₂ f`. -/
+lemma map₂_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (o : Option α) :
+    map₂ f o (some b) = o := by
+  simp [h, map₂]
+#align option.map₂_right_identity Option.map₂_right_identity
+
 end Option
chore: update SHA in porting header (#1306)

These files correspond to files flagged "The following files have been modified since the commit at which they were verified." by port_status.py but are in sync with mathlib3, so we can update the hash.

I only updated the easy ones, the others need a closer inspection.

Co-authored-by: Reid Barton <rwbarton@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.option.n_ary
-! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! leanprover-community/mathlib commit 2258b40dacd2942571c8ce136215350c702dc78f
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
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
@@ -116,9 +116,9 @@ theorem map_uncurry (f : α → β → γ) (x : Option (α × β)) :
 ### Algebraic replacement rules
 
 A collection of lemmas to transfer associativity, commutativity, distributivity, ... of operations
-to the associativity, commutativity, distributivity, ... of `option.map₂` of those operations.
+to the associativity, commutativity, distributivity, ... of `Option.map₂` of those operations.
 The proof pattern is `map₂_lemma operation_lemma`. For example, `map₂_comm mul_comm` proves that
-`map₂ (*) a b = map₂ (*) g f` in a `comm_semigroup`.
+`map₂ (*) a b = map₂ (*) g f` in a `CommSemigroup`.
 -/
 
 theorem map₂_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
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) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
+
+! This file was ported from Lean 3 source module data.option.n_ary
+! 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.Data.Option.Basic
 

Dependencies 6

7 files ported (100.0%)
3676 lines ported (100.0%)

All dependencies are ported!