l3lab/ntp-mathlib huggingface dataset:
/-- A two-argument function applied to two `dite`s is a `dite` of that two-argument function
applied to each of the branches. -/
theorem apply_dite₂ (f : α → β → γ) (P : Prop) [Decidable P] (a : P → α) (b : ¬P → α)
    (c : P → β) (d : ¬P → β) :
    f (dite P a b) (dite P c d) = dite P (fun h ↦ f (a h) (c h)) fun h ↦ f (b h) (d h) := by
  by_cases h : P <;> 

Proof state:
case neg
α : Sort u_3
β : Sort u_4
σ : α → Sort u_1
f✝ : α → β
P✝ Q : Prop
inst✝² : Decidable P✝
inst✝¹ : Decidable Q
a✝ b✝ c✝ : α
A : P✝ → α
B : ¬P✝ → α
γ : Sort u_2
f : α → β → γ
P : Prop
inst✝ : Decidable P
a : P → α
b : ¬P → α
c : P → β
d : ¬P → β
h : ¬P
⊢ f (dite P a b) (dite P c d) = if h : P then f (a h) (c h) else f (b h) (d h)

Next tactic:
simp [h]
/-- A 'dite' producing a `Pi` type `Π a, σ a`, applied to a value `a : α` is a `dite` that applies
either branch to `a`. -/
theorem dite_apply (f : P → ∀ a, σ a) (g : ¬P → ∀ a, σ a) (a : α) :
    (dite P f g) a = dite P (fun h ↦ f h a) fun h ↦ g h a := by 

Proof state:
α : Sort u_2
β : Sort ?u.36181
σ : α → Sort u_1
f✝ : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a✝ b c : α
A : P → α
B : ¬P → α
f : P → (a : α) → σ a
g : ¬P → (a : α) → σ a
a : α
⊢ dite P f g a = if h : P then f h a else g h a

Next tactic:
by_cases h:P
/-- A 'dite' producing a `Pi` type `Π a, σ a`, applied to a value `a : α` is a `dite` that applies
either branch to `a`. -/
theorem dite_apply (f : P → ∀ a, σ a) (g : ¬P → ∀ a, σ a) (a : α) :
    (dite P f g) a = dite P (fun h ↦ f h a) fun h ↦ g h a := by by_cases h:P <;> 

Proof state:
case pos
α : Sort u_2
β : Sort ?u.36181
σ : α → Sort u_1
f✝ : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a✝ b c : α
A : P → α
B : ¬P → α
f : P → (a : α) → σ a
g : ¬P → (a : α) → σ a
a : α
h : P
⊢ dite P f g a = if h : P then f h a else g h a

Next tactic:
simp [h]
/-- A 'dite' producing a `Pi` type `Π a, σ a`, applied to a value `a : α` is a `dite` that applies
either branch to `a`. -/
theorem dite_apply (f : P → ∀ a, σ a) (g : ¬P → ∀ a, σ a) (a : α) :
    (dite P f g) a = dite P (fun h ↦ f h a) fun h ↦ g h a := by by_cases h:P <;> 

Proof state:
case neg
α : Sort u_2
β : Sort ?u.36181
σ : α → Sort u_1
f✝ : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a✝ b c : α
A : P → α
B : ¬P → α
f : P → (a : α) → σ a
g : ¬P → (a : α) → σ a
a : α
h : ¬P
⊢ dite P f g a = if h : P then f h a else g h a

Next tactic:
simp [h]
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  

Proof state:
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
by_cases hp : P
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> 

Proof state:
case pos
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : P
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
by_cases hq : Q
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> 

Proof state:
case neg
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : ¬P
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
by_cases hq : Q
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> by_cases hq : Q <;> 

Proof state:
case pos
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : P
hq : Q
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
simp [hp, hq]
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> by_cases hq : Q <;> 

Proof state:
case neg
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : P
hq : ¬Q
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
simp [hp, hq]
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> by_cases hq : Q <;> 

Proof state:
case pos
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : ¬P
hq : Q
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
simp [hp, hq]
theorem ite_and : ite (P ∧ Q) a b = ite P (ite Q a b) b := by
  by_cases hp : P <;> by_cases hq : Q <;> 

Proof state:
case neg
α : Sort u_2
β : Sort ?u.36720
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
hp : ¬P
hq : ¬Q
⊢ (if P ∧ Q then a else b) = if P then if Q then a else b else b

Next tactic:
simp [hp, hq]
theorem dite_dite_comm {B : Q → α} {C : ¬P → ¬Q → α} (h : P → ¬Q) :
    (if p : P then A p else if q : Q then B q else C p q) =
     if q : Q then B q else if p : P then A p else C p q :=
  dite_eq_iff'.2 ⟨
    fun p ↦ by 

Proof state:
α : Sort u_2
β : Sort ?u.37412
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B✝ : ¬P → α
B : Q → α
C : ¬P → ¬Q → α
h : P → ¬Q
p : P
⊢ A p = if q : Q then B q else if p : P then A p else C p q

Next tactic:
rw [dif_neg (h p), dif_pos p]
theorem dite_dite_comm {B : Q → α} {C : ¬P → ¬Q → α} (h : P → ¬Q) :
    (if p : P then A p else if q : Q then B q else C p q) =
     if q : Q then B q else if p : P then A p else C p q :=
  dite_eq_iff'.2 ⟨
    fun p ↦ by rw [dif_neg (h p), dif_pos p],
    fun np ↦ by 

Proof state:
α : Sort u_2
β : Sort ?u.37412
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B✝ : ¬P → α
B : Q → α
C : ¬P → ¬Q → α
h : P → ¬Q
np : ¬P
⊢ (if q : Q then B q else C np q) = if q : Q then B q else if p : P then A p else C p q

Next tactic:
congr
theorem dite_dite_comm {B : Q → α} {C : ¬P → ¬Q → α} (h : P → ¬Q) :
    (if p : P then A p else if q : Q then B q else C p q) =
     if q : Q then B q else if p : P then A p else C p q :=
  dite_eq_iff'.2 ⟨
    fun p ↦ by rw [dif_neg (h p), dif_pos p],
    fun np ↦ by congr; 

Proof state:
case e_e
α : Sort u_2
β : Sort ?u.37412
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B✝ : ¬P → α
B : Q → α
C : ¬P → ¬Q → α
h : P → ¬Q
np : ¬P
⊢ (fun q => C np q) = fun q => if p : P then A p else C p q

Next tactic:
funext _
theorem dite_dite_comm {B : Q → α} {C : ¬P → ¬Q → α} (h : P → ¬Q) :
    (if p : P then A p else if q : Q then B q else C p q) =
     if q : Q then B q else if p : P then A p else C p q :=
  dite_eq_iff'.2 ⟨
    fun p ↦ by rw [dif_neg (h p), dif_pos p],
    fun np ↦ by congr; funext _; 

Proof state:
case e_e.h
α : Sort u_2
β : Sort ?u.37412
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B✝ : ¬P → α
B : Q → α
C : ¬P → ¬Q → α
h : P → ¬Q
np : ¬P
x✝ : ¬Q
⊢ C np x✝ = if p : P then A p else C p x✝

Next tactic:
rw [dif_neg np]
theorem ite_prop_iff_or : (if P then Q else R) ↔ (P ∧ Q ∨ ¬ P ∧ R) := by
  

Proof state:
α : Sort ?u.38100
β : Sort ?u.38106
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
⊢ (if P then Q else R) ↔ P ∧ Q ∨ ¬P ∧ R

Next tactic:
by_cases p : P
theorem ite_prop_iff_or : (if P then Q else R) ↔ (P ∧ Q ∨ ¬ P ∧ R) := by
  by_cases p : P <;> 

Proof state:
case pos
α : Sort ?u.38100
β : Sort ?u.38106
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
p : P
⊢ (if P then Q else R) ↔ P ∧ Q ∨ ¬P ∧ R

Next tactic:
simp [p]
theorem ite_prop_iff_or : (if P then Q else R) ↔ (P ∧ Q ∨ ¬ P ∧ R) := by
  by_cases p : P <;> 

Proof state:
case neg
α : Sort ?u.38100
β : Sort ?u.38106
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
p : ¬P
⊢ (if P then Q else R) ↔ P ∧ Q ∨ ¬P ∧ R

Next tactic:
simp [p]
theorem dite_prop_iff_or {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∃ p, Q p) ∨ (∃ p, R p) := by
  

Proof state:
α : Sort ?u.38311
β : Sort ?u.38317
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
⊢ dite P Q R ↔ (∃ p, Q p) ∨ ∃ p, R p

Next tactic:
by_cases h : P
theorem dite_prop_iff_or {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∃ p, Q p) ∨ (∃ p, R p) := by
  by_cases h : P <;> 

Proof state:
case pos
α : Sort ?u.38311
β : Sort ?u.38317
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
h : P
⊢ dite P Q R ↔ (∃ p, Q p) ∨ ∃ p, R p

Next tactic:
simp [h, exists_prop_of_false, exists_prop_of_true]
theorem dite_prop_iff_or {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∃ p, Q p) ∨ (∃ p, R p) := by
  by_cases h : P <;> 

Proof state:
case neg
α : Sort ?u.38311
β : Sort ?u.38317
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
h : ¬P
⊢ dite P Q R ↔ (∃ p, Q p) ∨ ∃ p, R p

Next tactic:
simp [h, exists_prop_of_false, exists_prop_of_true]
theorem ite_prop_iff_and : (if P then Q else R) ↔ ((P → Q) ∧ (¬ P → R)) := by
  

Proof state:
α : Sort ?u.38739
β : Sort ?u.38745
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
⊢ (if P then Q else R) ↔ (P → Q) ∧ (¬P → R)

Next tactic:
by_cases p : P
theorem ite_prop_iff_and : (if P then Q else R) ↔ ((P → Q) ∧ (¬ P → R)) := by
  by_cases p : P <;> 

Proof state:
case pos
α : Sort ?u.38739
β : Sort ?u.38745
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
p : P
⊢ (if P then Q else R) ↔ (P → Q) ∧ (¬P → R)

Next tactic:
simp [p]
theorem ite_prop_iff_and : (if P then Q else R) ↔ ((P → Q) ∧ (¬ P → R)) := by
  by_cases p : P <;> 

Proof state:
case neg
α : Sort ?u.38739
β : Sort ?u.38745
σ : α → Sort u_1
f : α → β
P Q : Prop
inst✝¹ : Decidable P
inst✝ : Decidable Q
a b c : α
A : P → α
B : ¬P → α
R : Prop
p : ¬P
⊢ (if P then Q else R) ↔ (P → Q) ∧ (¬P → R)

Next tactic:
simp [p]
theorem dite_prop_iff_and {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∀ h, Q h) ∧ (∀ h, R h) := by
  

Proof state:
α : Sort ?u.39313
β : Sort ?u.39319
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
⊢ dite P Q R ↔ (∀ (h : P), Q h) ∧ ∀ (h : ¬P), R h

Next tactic:
by_cases h : P
theorem dite_prop_iff_and {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∀ h, Q h) ∧ (∀ h, R h) := by
  by_cases h : P <;> 

Proof state:
case pos
α : Sort ?u.39313
β : Sort ?u.39319
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
h : P
⊢ dite P Q R ↔ (∀ (h : P), Q h) ∧ ∀ (h : ¬P), R h

Next tactic:
simp [h, forall_prop_of_false, forall_prop_of_true]
theorem dite_prop_iff_and {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∀ h, Q h) ∧ (∀ h, R h) := by
  by_cases h : P <;> 

Proof state:
case neg
α : Sort ?u.39313
β : Sort ?u.39319
σ : α → Sort u_1
f : α → β
P Q✝ : Prop
inst✝² : Decidable P
inst✝¹ : Decidable Q✝
a b c : α
A : P → α
B : ¬P → α
R✝ : Prop
Q : P → Prop
R : ¬P → Prop
inst✝ : Decidable P
h : ¬P
⊢ dite P Q R ↔ (∀ (h : P), Q h) ∧ ∀ (h : ¬P), R h

Next tactic:
simp [h, forall_prop_of_false, forall_prop_of_true]
theorem isUnit_iff_isIso {C : Type u} [Category.{v} C] {X : C} (f : End X) :
    IsUnit (f : End X) ↔ IsIso f :=
  ⟨fun h => { out := ⟨h.unit.inv, ⟨h.unit.inv_val, h.unit.val_inv⟩⟩ }, fun h =>
    ⟨⟨f, inv f, by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
f : End X
h : IsIso f
⊢ f * inv f = 1

Next tactic:
simp
theorem isUnit_iff_isIso {C : Type u} [Category.{v} C] {X : C} (f : End X) :
    IsUnit (f : End X) ↔ IsIso f :=
  ⟨fun h => { out := ⟨h.unit.inv, ⟨h.unit.inv_val, h.unit.val_inv⟩⟩ }, fun h =>
    ⟨⟨f, inv f, by simp, by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
f : End X
h : IsIso f
⊢ inv f * f = 1

Next tactic:
simp
/-- Units in the monoid of endomorphisms of an object
are (multiplicatively) equivalent to automorphisms of that object.
-/
def unitsEndEquivAut : (End X)ˣ ≃* Aut X where
  toFun f := ⟨f.1, f.2, f.4, f.3⟩
  invFun f := ⟨f.1, f.2, f.4, f.3⟩
  left_inv := fun ⟨f₁, f₂, f₃, f₄⟩ => rfl
  right_inv := fun ⟨f₁, f₂, f₃, f₄⟩ => rfl
  map_mul' f g := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X : C
f g : (End X)ˣ
⊢ Equiv.toFun
      { toFun := fun f => Iso.mk (↑f) f.inv,
        invFun := fun f =>
          { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X), inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) },
        left_inv :=
          (_ :
            ∀ (x : (End X)ˣ),
              (fun f =>
                    { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                      inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                  ((fun f => Iso.mk (↑f) f.inv) x) =
                x),
        right_inv :=
          (_ :
            ∀ (x : Aut X),
              (fun f => Iso.mk (↑f) f.inv)
                  ((fun f =>
                      { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                        inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                    x) =
                x) }
      (f * g) =
    Equiv.toFun
        { toFun := fun f => Iso.mk (↑f) f.inv,
          invFun := fun f =>
            { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X), inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) },
          left_inv :=
            (_ :
              ∀ (x : (End X)ˣ),
                (fun f =>
                      { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                        inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                    ((fun f => Iso.mk (↑f) f.inv) x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : Aut X),
                (fun f => Iso.mk (↑f) f.inv)
                    ((fun f =>
                        { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                          inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                      x) =
                  x) }
        f *
      Equiv.toFun
        { toFun := fun f => Iso.mk (↑f) f.inv,
          invFun := fun f =>
            { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X), inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) },
          left_inv :=
            (_ :
              ∀ (x : (End X)ˣ),
                (fun f =>
                      { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                        inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                    ((fun f => Iso.mk (↑f) f.inv) x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : Aut X),
                (fun f => Iso.mk (↑f) f.inv)
                    ((fun f =>
                        { val := f.hom, inv := f.inv, val_inv := (_ : f.inv ≫ f.hom = 𝟙 X),
                          inv_val := (_ : f.hom ≫ f.inv = 𝟙 X) })
                      x) =
                  x) }
        g

Next tactic:
cases f
/-- Isomorphisms induce isomorphisms of the automorphism group -/
def autMulEquivOfIso {X Y : C} (h : X ≅ Y) : Aut X ≃* Aut Y where
  toFun x := ⟨h.inv ≫ x.hom ≫ h.hom, h.inv ≫ x.inv ≫ h.hom, _, _⟩
  invFun y := ⟨h.hom ≫ y.hom ≫ h.inv, h.hom ≫ y.inv ≫ h.inv, _, _⟩
  left_inv _ := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X✝ X Y : C
h : X ≅ Y
x✝ : Aut X
⊢ (fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv))
      ((fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom)) x✝) =
    x✝

Next tactic:
aesop_cat
/-- Isomorphisms induce isomorphisms of the automorphism group -/
def autMulEquivOfIso {X Y : C} (h : X ≅ Y) : Aut X ≃* Aut Y where
  toFun x := ⟨h.inv ≫ x.hom ≫ h.hom, h.inv ≫ x.inv ≫ h.hom, _, _⟩
  invFun y := ⟨h.hom ≫ y.hom ≫ h.inv, h.hom ≫ y.inv ≫ h.inv, _, _⟩
  left_inv _ := by aesop_cat
  right_inv _ := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X✝ X Y : C
h : X ≅ Y
x✝ : Aut Y
⊢ (fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom))
      ((fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv)) x✝) =
    x✝

Next tactic:
aesop_cat
/-- Isomorphisms induce isomorphisms of the automorphism group -/
def autMulEquivOfIso {X Y : C} (h : X ≅ Y) : Aut X ≃* Aut Y where
  toFun x := ⟨h.inv ≫ x.hom ≫ h.hom, h.inv ≫ x.inv ≫ h.hom, _, _⟩
  invFun y := ⟨h.hom ≫ y.hom ≫ h.inv, h.hom ≫ y.inv ≫ h.inv, _, _⟩
  left_inv _ := by aesop_cat
  right_inv _ := by aesop_cat
  map_mul' := by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
X✝ X Y : C
h : X ≅ Y
⊢ ∀ (x y : Aut X),
    Equiv.toFun
        { toFun := fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom),
          invFun := fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv),
          left_inv :=
            (_ :
              ∀ (x : Aut X),
                (fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv))
                    ((fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom)) x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : Aut Y),
                (fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom))
                    ((fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv)) x) =
                  x) }
        (x * y) =
      Equiv.toFun
          { toFun := fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom),
            invFun := fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv),
            left_inv :=
              (_ :
                ∀ (x : Aut X),
                  (fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv))
                      ((fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom)) x) =
                    x),
            right_inv :=
              (_ :
                ∀ (x : Aut Y),
                  (fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom))
                      ((fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv)) x) =
                    x) }
          x *
        Equiv.toFun
          { toFun := fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom),
            invFun := fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv),
            left_inv :=
              (_ :
                ∀ (x : Aut X),
                  (fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv))
                      ((fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom)) x) =
                    x),
            right_inv :=
              (_ :
                ∀ (x : Aut Y),
                  (fun x => Iso.mk (h.inv ≫ x.hom ≫ h.hom) (h.inv ≫ x.inv ≫ h.hom))
                      ((fun y => Iso.mk (h.hom ≫ y.hom ≫ h.inv) (h.hom ≫ y.inv ≫ h.inv)) x) =
                    x) }
          y

Next tactic:
simp [Aut_mul_def]
theorem isCompactOperator_iff_exists_mem_nhds_isCompact_closure_image [T2Space M₂] (f : M₁ → M₂) :
    IsCompactOperator f ↔ ∃ V ∈ (𝓝 0 : Filter M₁), IsCompact (closure <| f '' V) := by
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
inst✝⁵ : Semiring R₁
inst✝⁴ : Semiring R₂
σ₁₂ : R₁ →+* R₂
M₁ : Type u_3
M₂ : Type u_4
inst✝³ : TopologicalSpace M₁
inst✝² : AddCommMonoid M₁
inst✝¹ : TopologicalSpace M₂
inst✝ : T2Space M₂
f : M₁ → M₂
⊢ IsCompactOperator f ↔ ∃ V ∈ 𝓝 0, IsCompact (closure (f '' V))

Next tactic:
rw [isCompactOperator_iff_exists_mem_nhds_image_subset_compact]
theorem isCompactOperator_iff_exists_mem_nhds_isCompact_closure_image [T2Space M₂] (f : M₁ → M₂) :
    IsCompactOperator f ↔ ∃ V ∈ (𝓝 0 : Filter M₁), IsCompact (closure <| f '' V) := by
  rw [isCompactOperator_iff_exists_mem_nhds_image_subset_compact]
  

Proof state:
R₁ : Type u_1
R₂ : Type u_2
inst✝⁵ : Semiring R₁
inst✝⁴ : Semiring R₂
σ₁₂ : R₁ →+* R₂
M₁ : Type u_3
M₂ : Type u_4
inst✝³ : TopologicalSpace M₁
inst✝² : AddCommMonoid M₁
inst✝¹ : TopologicalSpace M₂
inst✝ : T2Space M₂
f : M₁ → M₂
⊢ (∃ V ∈ 𝓝 0, ∃ K, IsCompact K ∧ f '' V ⊆ K) ↔ ∃ V ∈ 𝓝 0, IsCompact (closure (f '' V))

Next tactic:
exact
    ⟨fun ⟨V, hV, K, hK, hKV⟩ => ⟨V, hV, isCompact_closure_of_subset_compact hK hKV⟩,
      fun ⟨V, hV, hVc⟩ => ⟨V, hV, closure (f '' V), hVc, subset_closure⟩⟩
theorem IsCompactOperator.image_subset_compact_of_isVonNBounded {f : M₁ →ₛₗ[σ₁₂] M₂}
    (hf : IsCompactOperator f) {S : Set M₁} (hS : IsVonNBounded 𝕜₁ S) :
    ∃ K : Set M₂, IsCompact K ∧ f '' S ⊆ K :=
  let ⟨K, hK, hKf⟩ := hf
  let ⟨r, hr, hrS⟩ := hS hKf
  let ⟨c, hc⟩ := NormedField.exists_lt_norm 𝕜₁ r
  let this := ne_zero_of_norm_ne_zero (hr.trans hc).ne.symm
  ⟨σ₁₂ c • K, hK.image <| continuous_id.const_smul (σ₁₂ c), by
    

Proof state:
𝕜₁ : Type u_1
𝕜₂ : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜₁
inst✝⁷ : SeminormedRing 𝕜₂
σ₁₂ : 𝕜₁ →+* 𝕜₂
M₁ : Type u_3
M₂ : Type u_4
inst✝⁶ : TopologicalSpace M₁
inst✝⁵ : AddCommMonoid M₁
inst✝⁴ : TopologicalSpace M₂
inst✝³ : AddCommMonoid M₂
inst✝² : Module 𝕜₁ M₁
inst✝¹ : Module 𝕜₂ M₂
inst✝ : ContinuousConstSMul 𝕜₂ M₂
f : M₁ →ₛₗ[σ₁₂] M₂
hf : IsCompactOperator ⇑f
S : Set M₁
hS : IsVonNBounded 𝕜₁ S
K : Set M₂
hK : IsCompact K
hKf : ⇑f ⁻¹' K ∈ 𝓝 0
r : ℝ
hr : 0 < r
hrS : ∀ (a : 𝕜₁), r ≤ ‖a‖ → S ⊆ a • ⇑f ⁻¹' K
c : 𝕜₁
hc : r < ‖c‖
this : c ≠ 0 := ne_zero_of_norm_ne_zero (Ne.symm (LT.lt.ne (LT.lt.trans hr hc)))
⊢ ⇑f '' S ⊆ σ₁₂ c • K

Next tactic:
rw [image_subset_iff, preimage_smul_setₛₗ _ _ _ f this.isUnit]
theorem IsCompactOperator.image_subset_compact_of_isVonNBounded {f : M₁ →ₛₗ[σ₁₂] M₂}
    (hf : IsCompactOperator f) {S : Set M₁} (hS : IsVonNBounded 𝕜₁ S) :
    ∃ K : Set M₂, IsCompact K ∧ f '' S ⊆ K :=
  let ⟨K, hK, hKf⟩ := hf
  let ⟨r, hr, hrS⟩ := hS hKf
  let ⟨c, hc⟩ := NormedField.exists_lt_norm 𝕜₁ r
  let this := ne_zero_of_norm_ne_zero (hr.trans hc).ne.symm
  ⟨σ₁₂ c • K, hK.image <| continuous_id.const_smul (σ₁₂ c), by
    rw [image_subset_iff, preimage_smul_setₛₗ _ _ _ f this.isUnit]; 

Proof state:
𝕜₁ : Type u_1
𝕜₂ : Type u_2
inst✝⁸ : NontriviallyNormedField 𝕜₁
inst✝⁷ : SeminormedRing 𝕜₂
σ₁₂ : 𝕜₁ →+* 𝕜₂
M₁ : Type u_3
M₂ : Type u_4
inst✝⁶ : TopologicalSpace M₁
inst✝⁵ : AddCommMonoid M₁
inst✝⁴ : TopologicalSpace M₂
inst✝³ : AddCommMonoid M₂
inst✝² : Module 𝕜₁ M₁
inst✝¹ : Module 𝕜₂ M₂
inst✝ : ContinuousConstSMul 𝕜₂ M₂
f : M₁ →ₛₗ[σ₁₂] M₂
hf : IsCompactOperator ⇑f
S : Set M₁
hS : IsVonNBounded 𝕜₁ S
K : Set M₂
hK : IsCompact K
hKf : ⇑f ⁻¹' K ∈ 𝓝 0
r : ℝ
hr : 0 < r
hrS : ∀ (a : 𝕜₁), r ≤ ‖a‖ → S ⊆ a • ⇑f ⁻¹' K
c : 𝕜₁
hc : r < ‖c‖
this : c ≠ 0 := ne_zero_of_norm_ne_zero (Ne.symm (LT.lt.ne (LT.lt.trans hr hc)))
⊢ S ⊆ c • ⇑f ⁻¹' K

Next tactic:
exact hrS c hc.le
theorem IsCompactOperator.image_subset_compact_of_bounded [ContinuousConstSMul 𝕜₂ M₂]
    {f : M₁ →ₛₗ[σ₁₂] M₂} (hf : IsCompactOperator f) {S : Set M₁} (hS : Bornology.IsBounded S) :
    ∃ K : Set M₂, IsCompact K ∧ f '' S ⊆ K :=
  hf.image_subset_compact_of_isVonNBounded <| by 

Proof state:
𝕜₁ : Type u_1
𝕜₂ : Type u_2
inst✝⁷ : NontriviallyNormedField 𝕜₁
inst✝⁶ : SeminormedRing 𝕜₂
σ₁₂ : 𝕜₁ →+* 𝕜₂
M₁ : Type u_3
M₂ : Type u_4
M₃ : Type u_5
inst✝⁵ : SeminormedAddCommGroup M₁
inst✝⁴ : TopologicalSpace M₂
inst✝³ : AddCommMonoid M₂
inst✝² : NormedSpace 𝕜₁ M₁
inst✝¹ : Module 𝕜₂ M₂
inst✝ : ContinuousConstSMul 𝕜₂ M₂
f : M₁ →ₛₗ[σ₁₂] M₂
hf : IsCompactOperator ⇑f
S : Set M₁
hS : Bornology.IsBounded S
⊢ IsVonNBounded 𝕜₁ S

Next tactic:
rwa [NormedSpace.isVonNBounded_iff]