File: Mathlib/Data/Option/NAry.lean

full_name: Option.map₂
code: /-- 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 `α × β → γ`. -/
def map₂ (f : α → β → γ) (a : Option α) (b : Option β) : Option γ 
goal: Option γ

full_name: Option.map₂_def
code: /-- `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 u} (f : α → β → γ) (a : Option α) (b : Option β) :
    map₂ f a b = f <$> a <*> b 
goal: Option.map₂ f a b = Seq.seq (f <$> a) fun x => b

full_name: Option.map₂_some_some
code: theorem map₂_some_some (f : α → β → γ) (a : α) (b : β) : map₂ f (some a) (some b) = f a b 
goal: Option.map₂ f (some a) (some b) = some (f a b)

full_name: Option.map₂_coe_coe
code: theorem map₂_coe_coe (f : α → β → γ) (a : α) (b : β) : map₂ f a b = f a b 
goal: Option.map₂ f (some a) (some b) = some (f a b)

full_name: Option.map₂_none_left
code: @[simp]
theorem map₂_none_left (f : α → β → γ) (b : Option β) : map₂ f none b = none 
goal: Option.map₂ f none b = none

full_name: Option.map₂_none_right
code: @[simp]
theorem map₂_none_right (f : α → β → γ) (a : Option α) : map₂ f a none = none 
goal: Option.map₂ f a none = none

full_name: Option.map₂_coe_left
code: @[simp]
theorem map₂_coe_left (f : α → β → γ) (a : α) (b : Option β) : map₂ f a b = b.map fun b => f a b 
goal: Option.map₂ f (some a) b = Option.map (fun b => f a b) b

full_name: Option.map₂_coe_right
code: @[simp]
theorem map₂_coe_right (f : α → β → γ) (a : Option α) (b : β) :
    map₂ f a b = a.map fun a => f a b 
goal: Option.map₂ f a (some b) = Option.map (fun a => f a b) a

full_name: Option.mem_map₂_iff
code: theorem mem_map₂_iff {c : γ} : c ∈ map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c 
goal: c ∈ Option.map₂ f a b ↔ ∃ a' b', a' ∈ a ∧ b' ∈ b ∧ f a' b' = c

full_name: Option.map₂_eq_none_iff
code: @[simp]
theorem map₂_eq_none_iff : map₂ f a b = none ↔ a = none ∨ b = none 
goal: Option.map₂ f a b = none ↔ a = none ∨ b = none

full_name: Option.map₂_swap
code: theorem map₂_swap (f : α → β → γ) (a : Option α) (b : Option β) :
    map₂ f a b = map₂ (fun a b => f b a) b a 
goal: Option.map₂ f a b = Option.map₂ (fun a b => f b a) b a

full_name: Option.map_map₂
code: theorem map_map₂ (f : α → β → γ) (g : γ → δ) :
    (map₂ f a b).map g = map₂ (fun a b => g (f a b)) a b 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ (fun a b => g (f a b)) a b

full_name: Option.map₂_map_left
code: theorem map₂_map_left (f : γ → β → δ) (g : α → γ) :
    map₂ f (a.map g) b = map₂ (fun a b => f (g a) b) a b 
goal: Option.map₂ f (Option.map g a) b = Option.map₂ (fun a b => f (g a) b) a b

full_name: Option.map₂_map_right
code: theorem map₂_map_right (f : α → γ → δ) (g : β → γ) :
    map₂ f a (b.map g) = map₂ (fun a b => f a (g b)) a b 
goal: Option.map₂ f a (Option.map g b) = Option.map₂ (fun a b => f a (g b)) a b

full_name: Option.map₂_curry
code: @[simp]
theorem map₂_curry (f : α × β → γ) (a : Option α) (b : Option β) :
    map₂ (curry f) a b = Option.map f (map₂ Prod.mk a b) 
goal: Option.map₂ (Function.curry f) a b = Option.map f (Option.map₂ Prod.mk a b)

full_name: Option.map_uncurry
code: @[simp]
theorem map_uncurry (f : α → β → γ) (x : Option (α × β)) :
    x.map (uncurry f) = map₂ f (x.map Prod.fst) (x.map Prod.snd) 
goal: Option.map (Function.uncurry f) x = Option.map₂ f (Option.map Prod.fst x) (Option.map Prod.snd x)

full_name: Option.map₂_assoc
code: 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) 
goal: Option.map₂ f (Option.map₂ g a b) c = Option.map₂ f' a (Option.map₂ g' b c)

full_name: Option.map₂_comm
code: theorem map₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : map₂ f a b = map₂ g b a 
goal: Option.map₂ f a b = Option.map₂ g b a

full_name: Option.map₂_left_comm
code: 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) 
goal: Option.map₂ f a (Option.map₂ g b c) = Option.map₂ g' b (Option.map₂ f' a c)

full_name: Option.map₂_right_comm
code: 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 
goal: Option.map₂ f (Option.map₂ g a b) c = Option.map₂ g' (Option.map₂ f' a c) b

full_name: Option.map_map₂_distrib
code: 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₂) 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g₁ a) (Option.map g₂ b)

full_name: Option.map_map₂_distrib_left
code: /-- 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 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g' a) b

full_name: Option.map_map₂_distrib_right
code: /-- 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') 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' a (Option.map g' b)

full_name: Option.map₂_map_left_comm
code: /-- 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' 
goal: Option.map₂ f (Option.map g a) b = Option.map g' (Option.map₂ f' a b)

full_name: Option.map_map₂_right_comm
code: /-- 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' 
goal: Option.map₂ f a (Option.map g b) = Option.map g' (Option.map₂ f' a b)

full_name: Option.map_map₂_antidistrib
code: 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₂) 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g₁ b) (Option.map g₂ a)

full_name: Option.map_map₂_antidistrib_left
code: /-- 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 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g' b) a

full_name: Option.map_map₂_antidistrib_right
code: /-- 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') 
goal: Option.map g (Option.map₂ f a b) = Option.map₂ f' b (Option.map g' a)

full_name: Option.map₂_map_left_anticomm
code: /-- 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' 
goal: Option.map₂ f (Option.map g a) b = Option.map g' (Option.map₂ f' b a)

full_name: Option.map_map₂_right_anticomm
code: /-- 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' 
goal: Option.map₂ f a (Option.map g b) = Option.map g' (Option.map₂ f' b a)

full_name: Option.map₂_left_identity
code: /-- 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 
goal: Option.map₂ f (some a) o = o

full_name: Option.map₂_right_identity
code: /-- 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 
goal: Option.map₂ f o (some b) = o