l3lab/ntp-mathlib huggingface dataset:
theorem digits_one (b n) (n0 : 0 < n) (nb : n < b) : Nat.digits b n = [n] ∧ 1 < b ∧ 0 < n := by
  have b2 : 1 < b :=
    lt_iff_add_one_le.mpr (le_trans (add_le_add_right (lt_iff_add_one_le.mp n0) 1) nb)
  refine' ⟨_, b2, n0⟩
  

Proof state:
n✝ b n : ℕ
n0 : 0 < n
nb : n < b
b2 : 1 < b
⊢ digits b n = [n]

Next tactic:
rw [Nat.digits_def' b2 n0, Nat.mod_eq_of_lt nb,
    (Nat.div_eq_zero_iff ((zero_le n).trans_lt nb)).2 nb, Nat.digits_zero]
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  

Proof state:
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
⊢ #L ≤ #R

Next tactic:
classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
    obtain ⟨x, y, h⟩ := IsLocalization.mk'_surjective S a
    use (x, y)
    dsimp
    rwa [dif_pos <| show ↑y ∈ S from y.2, SetLike.eta]
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    

Proof state:
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
⊢ #L ≤ #R

Next tactic:
cases fintypeOrInfinite R
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · 

Proof state:
case inl
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Fintype R
⊢ #L ≤ #R

Next tactic:
exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    

Proof state:
case inr
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
⊢ #L ≤ #R

Next tactic:
erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    

Proof state:
case inr
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
⊢ #L ≤ #R * #R

Next tactic:
set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    

Proof state:
case inr
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
f : R × R → L := fun aa => mk' L aa.1 (if h : aa.2 ∈ S then { val := aa.2, property := h } else 1)
⊢ #L ≤ #R * #R

Next tactic:
refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
    

Proof state:
case inr
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
f : R × R → L := fun aa => mk' L aa.1 (if h : aa.2 ∈ S then { val := aa.2, property := h } else 1)
a : L
⊢ ∃ a_1, f a_1 = a

Next tactic:
obtain ⟨x, y, h⟩ := IsLocalization.mk'_surjective S a
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
    obtain ⟨x, y, h⟩ := IsLocalization.mk'_surjective S a
    

Proof state:
case inr.intro.intro
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
f : R × R → L := fun aa => mk' L aa.1 (if h : aa.2 ∈ S then { val := aa.2, property := h } else 1)
a : L
x : R
y : ↥S
h : mk' L x y = a
⊢ ∃ a_1, f a_1 = a

Next tactic:
use (x, y)
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
    obtain ⟨x, y, h⟩ := IsLocalization.mk'_surjective S a
    use (x, y)
    

Proof state:
case h
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
f : R × R → L := fun aa => mk' L aa.1 (if h : aa.2 ∈ S then { val := aa.2, property := h } else 1)
a : L
x : R
y : ↥S
h : mk' L x y = a
⊢ f (x, ↑y) = a

Next tactic:
dsimp
/-- A localization always has cardinality less than or equal to the base ring. -/
theorem card_le : #L ≤ #R := by
  classical
    cases fintypeOrInfinite R
    · exact Cardinal.mk_le_of_surjective (IsArtinianRing.localization_surjective S _)
    erw [← Cardinal.mul_eq_self <| Cardinal.aleph0_le_mk R]
    set f : R × R → L := fun aa => IsLocalization.mk' _ aa.1 (if h : aa.2 ∈ S then ⟨aa.2, h⟩ else 1)
    refine' @Cardinal.mk_le_of_surjective _ _ f fun a => _
    obtain ⟨x, y, h⟩ := IsLocalization.mk'_surjective S a
    use (x, y)
    dsimp
    

Proof state:
case h
R : Type u
inst✝³ : CommRing R
S : Submonoid R
L : Type u
inst✝² : CommRing L
inst✝¹ : Algebra R L
inst✝ : IsLocalization S L
val✝ : Infinite R
f : R × R → L := fun aa => mk' L aa.1 (if h : aa.2 ∈ S then { val := aa.2, property := h } else 1)
a : L
x : R
y : ↥S
h : mk' L x y = a
⊢ mk' L x (if h : ↑y ∈ S then { val := ↑y, property := h } else 1) = a

Next tactic:
rwa [dif_pos <| show ↑y ∈ S from y.2, SetLike.eta]
theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by
  

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.10300, u_3} B
inst✝ : Category.{u_5, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ (equivalence₁ hF).counitIso = equivalence₁CounitIso hF

Next tactic:
ext Y
theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by
  ext Y
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.10300, u_3} B
inst✝ : Category.{u_5, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y : B'
⊢ (equivalence₁ hF).counitIso.hom.app Y = (equivalence₁CounitIso hF).hom.app Y

Next tactic:
dsimp [equivalence₁]
theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by
  ext Y
  dsimp [equivalence₁]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.10300, u_3} B
inst✝ : Category.{u_5, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y : B'
⊢ (Functor.asEquivalence F).counitIso.hom.app Y = (equivalence₁CounitIso hF).hom.app Y

Next tactic:
unfold Functor.asEquivalence
theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by
  ext Y
  dsimp [equivalence₁]
  unfold Functor.asEquivalence
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.10300, u_3} B
inst✝ : Category.{u_5, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y : B'
⊢ (Equivalence.mk' F (IsEquivalence.inverse F) IsEquivalence.unitIso IsEquivalence.counitIso).counitIso.hom.app Y =
    (equivalence₁CounitIso hF).hom.app Y

Next tactic:
dsimp [equivalence₀, IsEquivalence.inverse, IsEquivalence.ofEquivalence]
theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF := by
  ext Y
  dsimp [equivalence₁]
  unfold Functor.asEquivalence
  dsimp [equivalence₀, IsEquivalence.inverse, IsEquivalence.ofEquivalence]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.10300, u_3} B
inst✝ : Category.{u_5, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y : B'
⊢ IsEquivalence.counitIso.hom.app Y = (equivalence₁CounitIso hF).hom.app Y

Next tactic:
simp
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
  

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.20784, u_3} B
inst✝ : Category.{u_6, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ (equivalence₁ hF).unitIso = equivalence₁UnitIso hF

Next tactic:
ext X
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
  ext X
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.20784, u_3} B
inst✝ : Category.{u_6, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ (equivalence₁ hF).unitIso.hom.app X = (equivalence₁UnitIso hF).hom.app X

Next tactic:
dsimp [equivalence₁]
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
  ext X
  dsimp [equivalence₁]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.20784, u_3} B
inst✝ : Category.{u_6, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ (Functor.asEquivalence F).unitIso.hom.app X = (equivalence₁UnitIso hF).hom.app X

Next tactic:
unfold Functor.asEquivalence
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
  ext X
  dsimp [equivalence₁]
  unfold Functor.asEquivalence
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.20784, u_3} B
inst✝ : Category.{u_6, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ (Equivalence.mk' F (IsEquivalence.inverse F) IsEquivalence.unitIso IsEquivalence.counitIso).unitIso.hom.app X =
    (equivalence₁UnitIso hF).hom.app X

Next tactic:
dsimp [NatIso.hcomp, IsEquivalence.ofEquivalence]
theorem equivalence₁UnitIso_eq : (equivalence₁ hF).unitIso = equivalence₁UnitIso hF := by
  ext X
  dsimp [equivalence₁]
  unfold Functor.asEquivalence
  dsimp [NatIso.hcomp, IsEquivalence.ofEquivalence]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{?u.20784, u_3} B
inst✝ : Category.{u_6, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ IsEquivalence.unitIso.hom.app X = (equivalence₁UnitIso hF).hom.app X

Next tactic:
simp
theorem equivalence₂CounitIso_eq :
    (equivalence₂ eB hF).counitIso = equivalence₂CounitIso eB hF := by
  

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ (equivalence₂ eB hF).counitIso = equivalence₂CounitIso eB hF

Next tactic:
ext Y'
theorem equivalence₂CounitIso_eq :
    (equivalence₂ eB hF).counitIso = equivalence₂CounitIso eB hF := by
  ext Y'
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y' : B
⊢ (equivalence₂ eB hF).counitIso.hom.app Y' = (equivalence₂CounitIso eB hF).hom.app Y'

Next tactic:
dsimp [equivalence₂, Iso.refl]
theorem equivalence₂CounitIso_eq :
    (equivalence₂ eB hF).counitIso = equivalence₂CounitIso eB hF := by
  ext Y'
  dsimp [equivalence₂, Iso.refl]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
Y' : B
⊢ eB.inverse.map ((equivalence₁ hF).counitIso.hom.app (eB.functor.obj Y')) ≫ eB.unitIso.inv.app Y' =
    (equivalence₂CounitIso eB hF).hom.app Y'

Next tactic:
simp only [equivalence₁CounitIso_eq, equivalence₂CounitIso_hom_app,
    equivalence₁CounitIso_hom_app, Functor.map_comp, assoc]
theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF := by
  

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_6, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF

Next tactic:
ext X
theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF := by
  ext X
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_6, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ (equivalence₂ eB hF).unitIso.hom.app X = (equivalence₂UnitIso eB hF).hom.app X

Next tactic:
dsimp [equivalence₂]
theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF := by
  ext X
  dsimp [equivalence₂]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_6, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ (equivalence₁ hF).unitIso.hom.app X ≫ (equivalence₁ hF).inverse.map (eB.counitIso.inv.app (F.obj X)) =
    (equivalence₂UnitIso eB hF).hom.app X

Next tactic:
simp only [equivalence₂UnitIso_hom_app, equivalence₁UnitIso_eq, equivalence₁UnitIso_hom_app,
      assoc, NatIso.cancel_natIso_hom_left]
theorem equivalence₂UnitIso_eq : (equivalence₂ eB hF).unitIso = equivalence₂UnitIso eB hF := by
  ext X
  dsimp [equivalence₂]
  simp only [equivalence₂UnitIso_hom_app, equivalence₁UnitIso_eq, equivalence₁UnitIso_hom_app,
      assoc, NatIso.cancel_natIso_hom_left]
  

Proof state:
case w.w.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_5, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_6, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
X : A
⊢ eA.unitIso.hom.app X ≫
      eA.inverse.map (e'.unitIso.hom.app (eA.functor.obj X)) ≫
        eA.inverse.map (e'.inverse.map (hF.hom.app X)) ≫
          (equivalence₁ hF).inverse.map (eB.counitIso.inv.app (F.obj X)) =
    eA.unitIso.hom.app X ≫
      eA.inverse.map (e'.unitIso.hom.app (eA.functor.obj X)) ≫
        eA.inverse.map (e'.inverse.map (hF.hom.app X)) ≫
          eA.inverse.map (e'.inverse.map (eB.counitIso.inv.app (F.obj X)))

Next tactic:
rfl
/-- The equivalence `A ≅ B` whose functor is `F ⋙ eB.inverse` and
whose inverse is `G : B ≅ A`. -/
@[simps! inverse]
def equivalence : A ≌ B :=
  letI : IsEquivalence G := by
    

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{?u.45591, u_1} A
inst✝² : Category.{?u.45595, u_2} A'
inst✝¹ : Category.{?u.45599, u_3} B
inst✝ : Category.{?u.45603, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ IsEquivalence G

Next tactic:
refine' IsEquivalence.ofIso _ (IsEquivalence.ofEquivalence (equivalence₂ eB hF).symm)
/-- The equivalence `A ≅ B` whose functor is `F ⋙ eB.inverse` and
whose inverse is `G : B ≅ A`. -/
@[simps! inverse]
def equivalence : A ≌ B :=
  letI : IsEquivalence G := by
    refine' IsEquivalence.ofIso _ (IsEquivalence.ofEquivalence (equivalence₂ eB hF).symm)
    

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{?u.45591, u_1} A
inst✝² : Category.{?u.45595, u_2} A'
inst✝¹ : Category.{?u.45599, u_3} B
inst✝ : Category.{?u.45603, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
⊢ (equivalence₂ eB hF).symm.functor ≅ G

Next tactic:
calc
      eB.functor ⋙ e'.inverse ⋙ eA.inverse ≅ (eB.functor ⋙ e'.inverse) ⋙ eA.inverse := Iso.refl _
      _ ≅ (G ⋙ eA.functor) ⋙ eA.inverse := isoWhiskerRight hG _
      _ ≅ G ⋙ 𝟭 A := isoWhiskerLeft _ eA.unitIso.symm
      _ ≅ G := Functor.rightUnitor G
/-- The isomorphism `eB.functor ⋙ e'.inverse ⋙ e'.functor ≅ eB.functor` deduced
from the isomorphisms `hF : eA.functor ⋙ e'.functor ≅ F`,
`hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor` and the datum of
an isomorphism `η : G ⋙ F ≅ eB.functor`. -/
@[simps! hom_app]
def τ₁ (η : G ⋙ F ≅ eB.functor) : eB.functor ⋙ e'.inverse ⋙ e'.functor ≅ eB.functor :=
  calc
    eB.functor ⋙ e'.inverse ⋙ e'.functor ≅ (eB.functor ⋙ e'.inverse) ⋙ e'.functor :=
        Iso.refl _
    _ ≅ (G ⋙ eA.functor) ⋙ e'.functor := isoWhiskerRight hG _
    _ ≅ G ⋙ eA.functor ⋙ e'.functor := by 

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{?u.51089, u_1} A
inst✝² : Category.{?u.51093, u_2} A'
inst✝¹ : Category.{?u.51097, u_3} B
inst✝ : Category.{?u.51101, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
⊢ (G ⋙ eA.functor) ⋙ e'.functor ≅ G ⋙ eA.functor ⋙ e'.functor

Next tactic:
rfl
theorem equivalenceCounitIso_eq : (equivalence hF hG).counitIso = equivalenceCounitIso η := by
  

Proof state:
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
hη : τ₀ = τ₁ hF hG η
⊢ (equivalence hF hG).counitIso = equivalenceCounitIso η

Next tactic:
ext1
theorem equivalenceCounitIso_eq : (equivalence hF hG).counitIso = equivalenceCounitIso η := by
  ext1; 

Proof state:
case w
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
hη : τ₀ = τ₁ hF hG η
⊢ (equivalence hF hG).counitIso.hom = (equivalenceCounitIso η).hom

Next tactic:
apply NatTrans.ext
theorem equivalenceCounitIso_eq : (equivalence hF hG).counitIso = equivalenceCounitIso η := by
  ext1; apply NatTrans.ext; 

Proof state:
case w.app
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
hη : τ₀ = τ₁ hF hG η
⊢ (equivalence hF hG).counitIso.hom.app = (equivalenceCounitIso η).hom.app

Next tactic:
ext Y
theorem equivalenceCounitIso_eq : (equivalence hF hG).counitIso = equivalenceCounitIso η := by
  ext1; apply NatTrans.ext; ext Y
  

Proof state:
case w.app.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
hη : τ₀ = τ₁ hF hG η
Y : B
⊢ (equivalence hF hG).counitIso.hom.app Y = (equivalenceCounitIso η).hom.app Y

Next tactic:
dsimp [equivalence, Functor.asEquivalence, IsEquivalence.ofEquivalence]
theorem equivalenceCounitIso_eq : (equivalence hF hG).counitIso = equivalenceCounitIso η := by
  ext1; apply NatTrans.ext; ext Y
  dsimp [equivalence, Functor.asEquivalence, IsEquivalence.ofEquivalence]
  

Proof state:
case w.app.h
A : Type u_1
A' : Type u_2
B : Type u_3
B' : Type u_4
inst✝³ : Category.{u_6, u_1} A
inst✝² : Category.{u_7, u_2} A'
inst✝¹ : Category.{u_5, u_3} B
inst✝ : Category.{u_8, u_4} B'
eA : A ≌ A'
eB : B ≌ B'
e' : A' ≌ B'
F : A ⥤ B'
hF : eA.functor ⋙ e'.functor ≅ F
G : B ⥤ A
hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor
η : G ⋙ F ≅ eB.functor
hη : τ₀ = τ₁ hF hG η
Y : B
⊢ IsEquivalence.unitIso.inv.app Y = (equivalenceCounitIso η).hom.app Y

Next tactic:
rw [equivalenceCounitIso_hom_app, IsEquivalence.ofIso_unitIso_inv_app]