l3lab/ntp-mathlib huggingface dataset:
theorem of_injective {R M} [Zero R] {r : R} [NeZero r] [Zero M] [ZeroHomClass F R M] {f : F}
    (hf : Function.Injective f) : NeZero (f r) :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
R : Type u_9
M : Type u_10
inst✝³ : Zero R
r : R
inst✝² : NeZero r
inst✝¹ : Zero M
inst✝ : ZeroHomClass F R M
f : F
hf : Function.Injective ⇑f
⊢ f r ≠ 0

Next tactic:
rw [← ZeroHomClass.map_zero f]
theorem of_injective {R M} [Zero R] {r : R} [NeZero r] [Zero M] [ZeroHomClass F R M] {f : F}
    (hf : Function.Injective f) : NeZero (f r) :=
  ⟨by
    rw [← ZeroHomClass.map_zero f]
    

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
R : Type u_9
M : Type u_10
inst✝³ : Zero R
r : R
inst✝² : NeZero r
inst✝¹ : Zero M
inst✝ : ZeroHomClass F R M
f : F
hf : Function.Injective ⇑f
⊢ f r ≠ f 0

Next tactic:
exact hf.ne NeZero.out
/-- Given two mul morphisms `f`, `g` to a commutative semigroup, `f * g` is the mul morphism
sending `x` to `f x * g x`. -/
@[to_additive "Given two additive morphisms `f`, `g` to an additive commutative semigroup,
`f + g` is the additive morphism sending `x` to `f x + g x`."]
instance [Mul M] [CommSemigroup N] : Mul (M →ₙ* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_mul' := fun x y => by
        

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝¹ : Mul M
inst✝ : CommSemigroup N
f g : M →ₙ* N
x y : M
⊢ (fun m => f m * g m) (x * y) = (fun m => f m * g m) x * (fun m => f m * g m) y

Next tactic:
intros
/-- Given two mul morphisms `f`, `g` to a commutative semigroup, `f * g` is the mul morphism
sending `x` to `f x * g x`. -/
@[to_additive "Given two additive morphisms `f`, `g` to an additive commutative semigroup,
`f + g` is the additive morphism sending `x` to `f x + g x`."]
instance [Mul M] [CommSemigroup N] : Mul (M →ₙ* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_mul' := fun x y => by
        intros
        

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝¹ : Mul M
inst✝ : CommSemigroup N
f g : M →ₙ* N
x y : M
⊢ (fun m => f m * g m) (x * y) = (fun m => f m * g m) x * (fun m => f m * g m) y

Next tactic:
show f (x * y) * g (x * y) = f x * g x * (f y * g y)
/-- Given two mul morphisms `f`, `g` to a commutative semigroup, `f * g` is the mul morphism
sending `x` to `f x * g x`. -/
@[to_additive "Given two additive morphisms `f`, `g` to an additive commutative semigroup,
`f + g` is the additive morphism sending `x` to `f x + g x`."]
instance [Mul M] [CommSemigroup N] : Mul (M →ₙ* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_mul' := fun x y => by
        intros
        show f (x * y) * g (x * y) = f x * g x * (f y * g y)
        

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝¹ : Mul M
inst✝ : CommSemigroup N
f g : M →ₙ* N
x y : M
⊢ f (x * y) * g (x * y) = f x * g x * (f y * g y)

Next tactic:
rw [f.map_mul, g.map_mul, ← mul_assoc, ← mul_assoc, mul_right_comm (f x)]
@[to_additive]
theorem comp_mul [Mul M] [CommSemigroup N] [CommSemigroup P] (g : N →ₙ* P) (f₁ f₂ : M →ₙ* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝² : Mul M
inst✝¹ : CommSemigroup N
inst✝ : CommSemigroup P
g : N →ₙ* P
f₁ f₂ : M →ₙ* N
⊢ comp g (f₁ * f₂) = comp g f₁ * comp g f₂

Next tactic:
ext
@[to_additive]
theorem comp_mul [Mul M] [CommSemigroup N] [CommSemigroup P] (g : N →ₙ* P) (f₁ f₂ : M →ₙ* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂ := by
  ext
  

Proof state:
case h
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝² : Mul M
inst✝¹ : CommSemigroup N
inst✝ : CommSemigroup P
g : N →ₙ* P
f₁ f₂ : M →ₙ* N
x✝ : M
⊢ (comp g (f₁ * f₂)) x✝ = (comp g f₁ * comp g f₂) x✝

Next tactic:
simp only [mul_apply, Function.comp_apply, map_mul, coe_comp]
/-- Given two monoid morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid morphism
sending `x` to `f x * g x`. -/
@[to_additive]
instance mul {M N} [MulOneClass M] [CommMonoid N] : Mul (M →* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_one' := show f 1 * g 1 = 1 by 

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H
M : Type ?u.11972
N : Type ?u.11975
inst✝¹ : MulOneClass M
inst✝ : CommMonoid N
f g : M →* N
⊢ f 1 * g 1 = 1

Next tactic:
simp
/-- Given two monoid morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid morphism
sending `x` to `f x * g x`. -/
@[to_additive]
instance mul {M N} [MulOneClass M] [CommMonoid N] : Mul (M →* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_one' := show f 1 * g 1 = 1 by simp,
      map_mul' := fun x y => by
        

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H
M : Type ?u.11972
N : Type ?u.11975
inst✝¹ : MulOneClass M
inst✝ : CommMonoid N
f g : M →* N
x y : M
⊢ OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } (x * y) =
    OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } x *
      OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } y

Next tactic:
intros
/-- Given two monoid morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid morphism
sending `x` to `f x * g x`. -/
@[to_additive]
instance mul {M N} [MulOneClass M] [CommMonoid N] : Mul (M →* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_one' := show f 1 * g 1 = 1 by simp,
      map_mul' := fun x y => by
        intros
        

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H
M : Type ?u.11972
N : Type ?u.11975
inst✝¹ : MulOneClass M
inst✝ : CommMonoid N
f g : M →* N
x y : M
⊢ OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } (x * y) =
    OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } x *
      OneHom.toFun { toFun := fun m => f m * g m, map_one' := (_ : f 1 * g 1 = 1) } y

Next tactic:
show f (x * y) * g (x * y) = f x * g x * (f y * g y)
/-- Given two monoid morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid morphism
sending `x` to `f x * g x`. -/
@[to_additive]
instance mul {M N} [MulOneClass M] [CommMonoid N] : Mul (M →* N) :=
  ⟨fun f g =>
    { toFun := fun m => f m * g m,
      map_one' := show f 1 * g 1 = 1 by simp,
      map_mul' := fun x y => by
        intros
        show f (x * y) * g (x * y) = f x * g x * (f y * g y)
        

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H
M : Type ?u.11972
N : Type ?u.11975
inst✝¹ : MulOneClass M
inst✝ : CommMonoid N
f g : M →* N
x y : M
⊢ f (x * y) * g (x * y) = f x * g x * (f y * g y)

Next tactic:
rw [f.map_mul, g.map_mul, ← mul_assoc, ← mul_assoc, mul_right_comm (f x)]
@[to_additive]
theorem comp_mul [MulOneClass M] [CommMonoid N] [CommMonoid P] (g : N →* P) (f₁ f₂ : M →* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂ := by
  

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁴ : Group G
inst✝³ : CommGroup H
inst✝² : MulOneClass M
inst✝¹ : CommMonoid N
inst✝ : CommMonoid P
g : N →* P
f₁ f₂ : M →* N
⊢ comp g (f₁ * f₂) = comp g f₁ * comp g f₂

Next tactic:
ext
@[to_additive]
theorem comp_mul [MulOneClass M] [CommMonoid N] [CommMonoid P] (g : N →* P) (f₁ f₂ : M →* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂ := by
  ext
  

Proof state:
case h
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁴ : Group G
inst✝³ : CommGroup H
inst✝² : MulOneClass M
inst✝¹ : CommMonoid N
inst✝ : CommMonoid P
g : N →* P
f₁ f₂ : M →* N
x✝ : M
⊢ (comp g (f₁ * f₂)) x✝ = (comp g f₁ * comp g f₂) x✝

Next tactic:
simp only [mul_apply, Function.comp_apply, map_mul, coe_comp]
/-- A homomorphism from a group to a monoid is injective iff its kernel is trivial.
For the iff statement on the triviality of the kernel, see `injective_iff_map_eq_one'`.  -/
@[to_additive
  "A homomorphism from an additive group to an additive monoid is injective iff
  its kernel is trivial. For the iff statement on the triviality of the kernel,
  see `injective_iff_map_eq_zero'`."]
theorem _root_.injective_iff_map_eq_one {G H} [Group G] [MulOneClass H] [MonoidHomClass F G H]
    (f : F) : Function.Injective f ↔ ∀ a, f a = 1 → a = 1 :=
  ⟨fun h x => (map_eq_one_iff f h).mp, fun h x y hxy =>
    mul_inv_eq_one.1 <| h _ <| by 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G✝ : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝⁴ : Group G✝
inst✝³ : CommGroup H✝
G : Type u_9
H : Type u_10
inst✝² : Group G
inst✝¹ : MulOneClass H
inst✝ : MonoidHomClass F G H
f : F
h : ∀ (a : G), f a = 1 → a = 1
x y : G
hxy : f x = f y
⊢ f (x * y⁻¹) = 1

Next tactic:
rw [map_mul, hxy, ← map_mul, mul_inv_self, map_one]
/-- Makes a group homomorphism from a proof that the map preserves right division
`fun x y => x * y⁻¹`. See also `MonoidHom.of_map_div` for a version using `fun x y => x / y`.
-/
@[to_additive
  "Makes an additive group homomorphism from a proof that the map preserves
  the operation `fun a b => a + -b`. See also `AddMonoidHom.ofMapSub` for a version using
  `fun a b => a - b`."]
def ofMapMulInv {H : Type*} [Group H] (f : G → H)
    (map_div : ∀ a b : G, f (a * b⁻¹) = f a * (f b)⁻¹) : G →* H :=
  (mk' f) fun x y =>
    calc
      f (x * y) = f x * (f <| 1 * 1⁻¹ * y⁻¹)⁻¹ := by
        

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
map_div : ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹
x y : G
⊢ f (x * y) = f x * (f (1 * 1⁻¹ * y⁻¹))⁻¹

Next tactic:
{ simp only [one_mul, inv_one, ← map_div, inv_inv] }
/-- Makes a group homomorphism from a proof that the map preserves right division
`fun x y => x * y⁻¹`. See also `MonoidHom.of_map_div` for a version using `fun x y => x / y`.
-/
@[to_additive
  "Makes an additive group homomorphism from a proof that the map preserves
  the operation `fun a b => a + -b`. See also `AddMonoidHom.ofMapSub` for a version using
  `fun a b => a - b`."]
def ofMapMulInv {H : Type*} [Group H] (f : G → H)
    (map_div : ∀ a b : G, f (a * b⁻¹) = f a * (f b)⁻¹) : G →* H :=
  (mk' f) fun x y =>
    calc
      f (x * y) = f x * (f <| 1 * 1⁻¹ * y⁻¹)⁻¹ := by
        { 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
map_div : ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹
x y : G
⊢ f (x * y) = f x * (f (1 * 1⁻¹ * y⁻¹))⁻¹

Next tactic:
simp only [one_mul, inv_one, ← map_div, inv_inv]
/-- Makes a group homomorphism from a proof that the map preserves right division
`fun x y => x * y⁻¹`. See also `MonoidHom.of_map_div` for a version using `fun x y => x / y`.
-/
@[to_additive
  "Makes an additive group homomorphism from a proof that the map preserves
  the operation `fun a b => a + -b`. See also `AddMonoidHom.ofMapSub` for a version using
  `fun a b => a - b`."]
def ofMapMulInv {H : Type*} [Group H] (f : G → H)
    (map_div : ∀ a b : G, f (a * b⁻¹) = f a * (f b)⁻¹) : G →* H :=
  (mk' f) fun x y =>
    calc
      f (x * y) = f x * (f <| 1 * 1⁻¹ * y⁻¹)⁻¹ := by
        { simp only [one_mul, inv_one, ← map_div, inv_inv] }
      _ = f x * f y := by
        

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
map_div : ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹
x y : G
⊢ f x * (f (1 * 1⁻¹ * y⁻¹))⁻¹ = f x * f y

Next tactic:
{ simp only [map_div]
          simp only [mul_right_inv, one_mul, inv_inv] }
/-- Makes a group homomorphism from a proof that the map preserves right division
`fun x y => x * y⁻¹`. See also `MonoidHom.of_map_div` for a version using `fun x y => x / y`.
-/
@[to_additive
  "Makes an additive group homomorphism from a proof that the map preserves
  the operation `fun a b => a + -b`. See also `AddMonoidHom.ofMapSub` for a version using
  `fun a b => a - b`."]
def ofMapMulInv {H : Type*} [Group H] (f : G → H)
    (map_div : ∀ a b : G, f (a * b⁻¹) = f a * (f b)⁻¹) : G →* H :=
  (mk' f) fun x y =>
    calc
      f (x * y) = f x * (f <| 1 * 1⁻¹ * y⁻¹)⁻¹ := by
        { simp only [one_mul, inv_one, ← map_div, inv_inv] }
      _ = f x * f y := by
        { 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
map_div : ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹
x y : G
⊢ f x * (f (1 * 1⁻¹ * y⁻¹))⁻¹ = f x * f y

Next tactic:
simp only [map_div]
/-- Makes a group homomorphism from a proof that the map preserves right division
`fun x y => x * y⁻¹`. See also `MonoidHom.of_map_div` for a version using `fun x y => x / y`.
-/
@[to_additive
  "Makes an additive group homomorphism from a proof that the map preserves
  the operation `fun a b => a + -b`. See also `AddMonoidHom.ofMapSub` for a version using
  `fun a b => a - b`."]
def ofMapMulInv {H : Type*} [Group H] (f : G → H)
    (map_div : ∀ a b : G, f (a * b⁻¹) = f a * (f b)⁻¹) : G →* H :=
  (mk' f) fun x y =>
    calc
      f (x * y) = f x * (f <| 1 * 1⁻¹ * y⁻¹)⁻¹ := by
        { simp only [one_mul, inv_one, ← map_div, inv_inv] }
      _ = f x * f y := by
        { simp only [map_div]
          

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
map_div : ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹
x y : G
⊢ f x * (f 1 * (f 1)⁻¹ * (f y)⁻¹)⁻¹ = f x * f y

Next tactic:
simp only [mul_right_inv, one_mul, inv_inv]
/-- Define a morphism of additive groups given a map which respects ratios. -/
@[to_additive "Define a morphism of additive groups given a map which respects difference."]
def ofMapDiv {H : Type*} [Group H] (f : G → H) (hf : ∀ x y, f (x / y) = f x / f y) : G →* H :=
  ofMapMulInv f (by 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H✝ : Type u_7
F : Type u_8
inst✝³ : Group G
inst✝² : CommGroup H✝
inst✝¹ : MulOneClass M
H : Type u_9
inst✝ : Group H
f : G → H
hf : ∀ (x y : G), f (x / y) = f x / f y
⊢ ∀ (a b : G), f (a * b⁻¹) = f a * (f b)⁻¹

Next tactic:
simpa only [div_eq_mul_inv] using hf
/-- If `f` is a monoid homomorphism to a commutative group, then `f⁻¹` is the homomorphism sending
`x` to `(f x)⁻¹`. -/
@[to_additive "If `f` is an additive monoid homomorphism to an additive commutative group,
then `-f` is the homomorphism sending `x` to `-(f x)`."]
instance {M G} [MulOneClass M] [CommGroup G] : Inv (M →* G) :=
  ⟨fun f => (mk' fun g => (f g)⁻¹) fun a b => by 

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G✝ : Type u_6
H : Type u_7
F : Type u_8
inst✝⁴ : Group G✝
inst✝³ : CommGroup H
inst✝² : MulOneClass M✝
M : Type ?u.27336
G : Type ?u.27339
inst✝¹ : MulOneClass M
inst✝ : CommGroup G
f : M →* G
a b : M
⊢ (f (a * b))⁻¹ = (f a)⁻¹ * (f b)⁻¹

Next tactic:
rw [← mul_inv, f.map_mul]
@[to_additive (attr := simp)]
theorem inv_comp {M N A} [MulOneClass M] [MulOneClass N] [CommGroup A]
    (φ : N →* A) (ψ : M →* N) : φ⁻¹.comp ψ = (φ.comp ψ)⁻¹ := by
  

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁵ : Group G
inst✝⁴ : CommGroup H
inst✝³ : MulOneClass M✝
M : Type u_9
N : Type u_10
A : Type u_11
inst✝² : MulOneClass M
inst✝¹ : MulOneClass N
inst✝ : CommGroup A
φ : N →* A
ψ : M →* N
⊢ comp φ⁻¹ ψ = (comp φ ψ)⁻¹

Next tactic:
ext
@[to_additive (attr := simp)]
theorem inv_comp {M N A} [MulOneClass M] [MulOneClass N] [CommGroup A]
    (φ : N →* A) (ψ : M →* N) : φ⁻¹.comp ψ = (φ.comp ψ)⁻¹ := by
  ext
  

Proof state:
case h
α : Type u_1
β : Type u_2
M✝ : Type u_3
N✝ : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁵ : Group G
inst✝⁴ : CommGroup H
inst✝³ : MulOneClass M✝
M : Type u_9
N : Type u_10
A : Type u_11
inst✝² : MulOneClass M
inst✝¹ : MulOneClass N
inst✝ : CommGroup A
φ : N →* A
ψ : M →* N
x✝ : M
⊢ (comp φ⁻¹ ψ) x✝ = (comp φ ψ)⁻¹ x✝

Next tactic:
simp only [Function.comp_apply, inv_apply, coe_comp]
@[to_additive (attr := simp)]
theorem comp_inv {M A B} [MulOneClass M] [CommGroup A] [CommGroup B]
    (φ : A →* B) (ψ : M →* A) : φ.comp ψ⁻¹ = (φ.comp ψ)⁻¹ := by
  

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁵ : Group G
inst✝⁴ : CommGroup H
inst✝³ : MulOneClass M✝
M : Type u_9
A : Type u_10
B : Type u_11
inst✝² : MulOneClass M
inst✝¹ : CommGroup A
inst✝ : CommGroup B
φ : A →* B
ψ : M →* A
⊢ comp φ ψ⁻¹ = (comp φ ψ)⁻¹

Next tactic:
ext
@[to_additive (attr := simp)]
theorem comp_inv {M A B} [MulOneClass M] [CommGroup A] [CommGroup B]
    (φ : A →* B) (ψ : M →* A) : φ.comp ψ⁻¹ = (φ.comp ψ)⁻¹ := by
  ext
  

Proof state:
case h
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝⁵ : Group G
inst✝⁴ : CommGroup H
inst✝³ : MulOneClass M✝
M : Type u_9
A : Type u_10
B : Type u_11
inst✝² : MulOneClass M
inst✝¹ : CommGroup A
inst✝ : CommGroup B
φ : A →* B
ψ : M →* A
x✝ : M
⊢ (comp φ ψ⁻¹) x✝ = (comp φ ψ)⁻¹ x✝

Next tactic:
simp only [Function.comp_apply, inv_apply, map_inv, coe_comp]
/-- If `f` and `g` are monoid homomorphisms to a commutative group, then `f / g` is the homomorphism
sending `x` to `(f x) / (g x)`. -/
@[to_additive "If `f` and `g` are monoid homomorphisms to an additive commutative group,
then `f - g` is the homomorphism sending `x` to `(f x) - (g x)`."]
instance {M G} [MulOneClass M] [CommGroup G] : Div (M →* G) :=
  ⟨fun f g => (mk' fun x => f x / g x) fun a b => by
    

Proof state:
α : Type u_1
β : Type u_2
M✝ : Type u_3
N : Type u_4
P : Type u_5
G✝ : Type u_6
H : Type u_7
F : Type u_8
inst✝⁴ : Group G✝
inst✝³ : CommGroup H
inst✝² : MulOneClass M✝
M : Type ?u.31410
G : Type ?u.31413
inst✝¹ : MulOneClass M
inst✝ : CommGroup G
f g : M →* G
a b : M
⊢ f (a * b) / g (a * b) = f a / g a * (f b / g b)

Next tactic:
simp [div_eq_mul_inv, mul_assoc, mul_left_comm, mul_comm]
/-- Given two monoid with zero morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid
with zero morphism sending `x` to `f x * g x`. -/
instance [MulZeroOneClass M] [CommMonoidWithZero N] : Mul (M →*₀ N) :=
  ⟨fun f g => { (f * g : M →* N) with
    toFun := fun a => f a * g a,
    map_zero' := by 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝¹ : MulZeroOneClass M
inst✝ : CommMonoidWithZero N
f g : M →*₀ N
src✝ : M →* N := ↑f * ↑g
⊢ (fun a => f a * g a) 0 = 0

Next tactic:
dsimp only []
/-- Given two monoid with zero morphisms `f`, `g` to a commutative monoid, `f * g` is the monoid
with zero morphism sending `x` to `f x * g x`. -/
instance [MulZeroOneClass M] [CommMonoidWithZero N] : Mul (M →*₀ N) :=
  ⟨fun f g => { (f * g : M →* N) with
    toFun := fun a => f a * g a,
    map_zero' := by dsimp only []; 

Proof state:
α : Type u_1
β : Type u_2
M : Type u_3
N : Type u_4
P : Type u_5
G : Type u_6
H : Type u_7
F : Type u_8
inst✝¹ : MulZeroOneClass M
inst✝ : CommMonoidWithZero N
f g : M →*₀ N
src✝ : M →* N := ↑f * ↑g
⊢ f 0 * g 0 = 0

Next tactic:
rw [map_zero, zero_mul]
@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_naturality (f : a' ⟶ G.obj a) {g h : a ⟶ b} (β : g ⟶ h) :
    f ◁ G.map₂ β ▷ θ.app b ≫ f ◁ θ.naturality h =
      f ◁ θ.naturality g ≫ f ◁ θ.app a ◁ H.map₂ β :=
  by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H : OplaxFunctor B C
η : OplaxNatTrans F G
θ : OplaxNatTrans G H
a b c : B
a' : C
f : a' ⟶ (↑G.toPrelaxFunctor).obj a
g h : a ⟶ b
β : g ⟶ h
⊢ f ◁ PrelaxFunctor.map₂ G.toPrelaxFunctor β ▷ θ.app b ≫ f ◁ naturality θ h =
    f ◁ naturality θ g ≫ f ◁ θ.app a ◁ PrelaxFunctor.map₂ H.toPrelaxFunctor β

Next tactic:
simp_rw [← whiskerLeft_comp, naturality_naturality]
@[reassoc (attr := simp)]
theorem whiskerRight_naturality_naturality {f g : a ⟶ b} (β : f ⟶ g) (h : G.obj b ⟶ a') :
    F.map₂ β ▷ η.app b ▷ h ≫ η.naturality g ▷ h =
      η.naturality f ▷ h ≫ (α_ _ _ _).hom ≫ η.app a ◁ G.map₂ β ▷ h ≫ (α_ _ _ _).inv :=
  by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H : OplaxFunctor B C
η : OplaxNatTrans F G
θ : OplaxNatTrans G H
a b c : B
a' : C
f g : a ⟶ b
β : f ⟶ g
h : (↑G.toPrelaxFunctor).obj b ⟶ a'
⊢ PrelaxFunctor.map₂ F.toPrelaxFunctor β ▷ η.app b ▷ h ≫ naturality η g ▷ h =
    naturality η f ▷ h ≫
      (α_ (η.app a) ((↑G.toPrelaxFunctor).map f) h).hom ≫
        η.app a ◁ PrelaxFunctor.map₂ G.toPrelaxFunctor β ▷ h ≫ (α_ (η.app a) ((↑G.toPrelaxFunctor).map g) h).inv

Next tactic:
rw [← comp_whiskerRight, naturality_naturality, comp_whiskerRight, whisker_assoc]
@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_comp (f : a' ⟶ G.obj a) (g : a ⟶ b) (h : b ⟶ c) :
    f ◁ θ.naturality (g ≫ h) ≫ f ◁ θ.app a ◁ H.mapComp g h =
      f ◁ G.mapComp g h ▷ θ.app c ≫
        f ◁ (α_ _ _ _).hom ≫
          f ◁ G.map g ◁ θ.naturality h ≫
            f ◁ (α_ _ _ _).inv ≫ f ◁ θ.naturality g ▷ H.map h ≫ f ◁ (α_ _ _ _).hom :=
  by 

Proof state:
B : Type u₁
inst✝¹ : Bicategory B
C : Type u₂
inst✝ : Bicategory C
F G H : OplaxFunctor B C
η : OplaxNatTrans F G
θ : OplaxNatTrans G H
a b c : B
a' : C
f : a' ⟶ (↑G.toPrelaxFunctor).obj a
g : a ⟶ b
h : b ⟶ c
⊢ f ◁ naturality θ (g ≫ h) ≫ f ◁ θ.app a ◁ OplaxFunctor.mapComp H g h =
    f ◁ OplaxFunctor.mapComp G g h ▷ θ.app c ≫
      f ◁ (α_ ((↑G.toPrelaxFunctor).map g) ((↑G.toPrelaxFunctor).map h) (θ.app c)).hom ≫
        f ◁ (↑G.toPrelaxFunctor).map g ◁ naturality θ h ≫
          f ◁ (α_ ((↑G.toPrelaxFunctor).map g) (θ.app b) ((↑H.toPrelaxFunctor).map h)).inv ≫
            f ◁ naturality θ g ▷ (↑H.toPrelaxFunctor).map h ≫
              f ◁ (α_ (θ.app a) ((↑H.toPrelaxFunctor).map g) ((↑H.toPrelaxFunctor).map h)).hom

Next tactic:
simp_rw [← whiskerLeft_comp, naturality_comp]