[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ HEq ((π.map f).map (Quotient.mk (Path.Homotopic.setoid x₀ x₁) p))
    ((π.map g).map (Quotient.mk (Path.Homotopic.setoid x₂ x₃) q))
[PROOFSTEP]
simp only [map_eq, ← Path.Homotopic.map_lift]
[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ HEq (Quotient.mk (Path.Homotopic.setoid (↑f x₀) (↑f x₁)) (Path.map p (_ : Continuous ↑f)))
    (Quotient.mk (Path.Homotopic.setoid (↑g x₂) (↑g x₃)) (Path.map q (_ : Continuous ↑g)))
[PROOFSTEP]
apply Path.Homotopic.hpath_hext
[GOAL]
case hp
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ ∀ (t : ↑I), ↑(Path.map p (_ : Continuous ↑f)) t = ↑(Path.map q (_ : Continuous ↑g)) t
[PROOFSTEP]
exact hfg
[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ ↑f x₀ = ↑g x₂
[PROOFSTEP]
convert hfg 0
[GOAL]
case h.e'_2.h.e'_6
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ x₀ = ↑p 0
[PROOFSTEP]
simp only [Path.source]
[GOAL]
case h.e'_3.h.e'_6
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ x₂ = ↑q 0
[PROOFSTEP]
simp only [Path.source]
[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ ↑f x₁ = ↑g x₃
[PROOFSTEP]
convert hfg 1
[GOAL]
case h.e'_2.h.e'_6
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ x₁ = ↑p 1
[PROOFSTEP]
simp only [Path.target]
[GOAL]
case h.e'_3.h.e'_6
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ x₃ = ↑q 1
[PROOFSTEP]
simp only [Path.target]
[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ (π.map f).map (Quotient.mk (Path.Homotopic.setoid x₀ x₁) p) =
    hcast (_ : ↑f x₀ = ↑g x₂) ≫ (π.map g).map (Quotient.mk (Path.Homotopic.setoid x₂ x₃) q) ≫ hcast (_ : ↑g x₃ = ↑f x₁)
[PROOFSTEP]
rw [Functor.conj_eqToHom_iff_heq ((πₘ f).map ⟦p⟧) ((πₘ g).map ⟦q⟧) (start_path hfg) (end_path hfg)]
[GOAL]
X₁ X₂ Y : TopCat
f : C(↑X₁, ↑Y)
g : C(↑X₂, ↑Y)
x₀ x₁ : ↑X₁
x₂ x₃ : ↑X₂
p : Path x₀ x₁
q : Path x₂ x₃
hfg : ∀ (t : ↑I), ↑f (↑p t) = ↑g (↑q t)
⊢ HEq ((π.map f).map (Quotient.mk (Path.Homotopic.setoid x₀ x₁) p))
    ((π.map g).map (Quotient.mk (Path.Homotopic.setoid x₂ x₃) q))
[PROOFSTEP]
exact heq_path_of_eq_image hfg
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ (π.map f).map (Quotient.mk (Path.Homotopic.setoid (fromTop x₀) (fromTop x₁)) p') =
    hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
      (π.map (uliftMap H)).map
          (prodToProdTopI (𝟙 (fromTop { down := 0 }))
            (Quotient.mk (Path.Homotopic.setoid (fromTop x₀) (fromTop x₁)) p')) ≫
        hcast (_ : ↑H (0, x₁) = ↑f x₁)
[PROOFSTEP]
apply @eq_path_of_eq_image _ _ _ _ H.uliftMap _ _ _ _ _ ((Path.refl (ULift.up _)).prod p')
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑f (↑p' t) = ↑(uliftMap H) (↑(Path.prod (Path.refl { down := 0 }) p') t)
[PROOFSTEP]
rw [Path.prod_coe]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑f (↑p' t) = ↑(uliftMap H) ((fun t => (↑(Path.refl { down := 0 }) t, ↑p' t)) t)
[PROOFSTEP]
simp_rw [ulift_apply]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑f (↑p' t) = ↑H ((↑(Path.refl { down := 0 }) t).down, ↑p' t)
[PROOFSTEP]
simp
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ (π.map g).map (Quotient.mk (Path.Homotopic.setoid (fromTop x₀) (fromTop x₁)) p') =
    hcast (_ : ↑g x₀ = ↑H (1, x₀)) ≫
      (π.map (uliftMap H)).map
          (prodToProdTopI (𝟙 (fromTop { down := 1 }))
            (Quotient.mk (Path.Homotopic.setoid (fromTop x₀) (fromTop x₁)) p')) ≫
        hcast (_ : ↑H (1, x₁) = ↑g x₁)
[PROOFSTEP]
apply @eq_path_of_eq_image _ _ _ _ H.uliftMap _ _ _ _ _ ((Path.refl (ULift.up _)).prod p')
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑g (↑p' t) = ↑(uliftMap H) (↑(Path.prod (Path.refl { down := 1 }) p') t)
[PROOFSTEP]
rw [Path.prod_coe]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑g (↑p' t) = ↑(uliftMap H) ((fun t => (↑(Path.refl { down := 1 }) t, ↑p' t)) t)
[PROOFSTEP]
simp_rw [ulift_apply]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
p' : Path (fromTop x₀) (fromTop x₁)
⊢ ∀ (t : ↑I), ↑g (↑p' t) = ↑H ((↑(Path.refl { down := 1 }) t).down, ↑p' t)
[PROOFSTEP]
simp
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
⊢ Quotient.mk (Path.Homotopic.setoid (fromTop (↑f x)) (fromTop (↑g x))) (evalAt H x) =
    hcast (_ : ↑f x = ↑H (0, x)) ≫
      (π.map (uliftMap H)).map (prodToProdTopI uhpath01 (𝟙 x)) ≫ hcast (_ : ↑H (1, x) = ↑g x)
[PROOFSTEP]
dsimp only [prodToProdTopI, uhpath01, hcast]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
⊢ Quotient.mk (Path.Homotopic.setoid (fromTop (↑f x)) (fromTop (↑g x))) (evalAt H x) =
    eqToHom (_ : ↑f x = ↑H (0, x)) ≫
      (π.map (uliftMap H)).map
          ((prodToProdTop (TopCat.of (ULift ↑I)) X).map
            (Quotient.mk (Path.Homotopic.setoid (fromTop { down := 0 }) (fromTop { down := 1 })) unitInterval.upath01,
              𝟙 x)) ≫
        eqToHom (_ : ↑H (1, x) = ↑g x)
[PROOFSTEP]
refine' (@Functor.conj_eqToHom_iff_heq (πₓ Y) _ _ _ _ _ _ _ _ (H.apply_one x).symm).mpr _
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
⊢ HEq (Quotient.mk (Path.Homotopic.setoid (fromTop (↑f x)) (fromTop (↑g x))) (evalAt H x))
    ((π.map (uliftMap H)).map
      ((prodToProdTop (TopCat.of (ULift ↑I)) X).map
        (Quotient.mk (Path.Homotopic.setoid (fromTop { down := 0 }) (fromTop { down := 1 })) unitInterval.upath01,
          𝟙 x)))
[PROOFSTEP]
simp only [id_eq_path_refl, prodToProdTop_map, Path.Homotopic.prod_lift, map_eq, ← Path.Homotopic.map_lift]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
⊢ HEq (Quotient.mk (Path.Homotopic.setoid (fromTop (↑f x)) (fromTop (↑g x))) (evalAt H x))
    (Path.Homotopic.Quotient.mapFn
      ((prodToProdTop (TopCat.of (ULift ↑I)) X).map
        (Quotient.mk (Path.Homotopic.setoid (fromTop { down := 0 }) (fromTop { down := 1 })) unitInterval.upath01,
          Quotient.mk (Path.Homotopic.setoid x x) (Path.refl x)))
      (uliftMap H))
[PROOFSTEP]
apply Path.Homotopic.hpath_hext
[GOAL]
case hp
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
⊢ ∀ (t : ↑I),
    ↑(evalAt H x) t =
      ↑((fun q => Path.map q (_ : Continuous ↑(uliftMap H))) (Path.prod unitInterval.upath01 (Path.refl x))) t
[PROOFSTEP]
intro
[GOAL]
case hp
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
x : ↑X
t✝ : ↑I
⊢ ↑(evalAt H x) t✝ =
    ↑((fun q => Path.map q (_ : Continuous ↑(uliftMap H))) (Path.prod unitInterval.upath01 (Path.refl x))) t✝
[PROOFSTEP]
rfl
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (π.map f).map p ≫ Quotient.mk (Path.Homotopic.setoid ((π.map f).obj (fromTop x₁)) (↑g x₁)) (evalAt H x₁) =
      diagonalPath' H p ∧
    Quotient.mk (Path.Homotopic.setoid (fromTop (↑f x₀)) (↑g x₀)) (evalAt H x₀) ≫ (π.map g).map p = diagonalPath' H p
[PROOFSTEP]
rw [H.apply_zero_path, H.apply_one_path, H.evalAt_eq]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI (𝟙 (fromTop { down := 0 })) p) ≫ hcast (_ : ↑H (0, x₁) = ↑f x₁)) ≫
        Quotient.mk (Path.Homotopic.setoid ((π.map f).obj (fromTop x₁)) (↑g x₁)) (evalAt H x₁) =
      diagonalPath' H p ∧
    (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI uhpath01 (𝟙 x₀)) ≫ hcast (_ : ↑H (1, x₀) = ↑g x₀)) ≫
        hcast (_ : ↑g x₀ = ↑H (1, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI (𝟙 (fromTop { down := 1 })) p) ≫ hcast (_ : ↑H (1, x₁) = ↑g x₁) =
      diagonalPath' H p
[PROOFSTEP]
erw [H.evalAt_eq]
  -- Porting note: `rw` didn't work, so using `erw`
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI (𝟙 (fromTop { down := 0 })) p) ≫ hcast (_ : ↑H (0, x₁) = ↑f x₁)) ≫
        hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI uhpath01 (𝟙 (fromTop x₁))) ≫
            hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁)) =
      diagonalPath' H p ∧
    (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI uhpath01 (𝟙 x₀)) ≫ hcast (_ : ↑H (1, x₀) = ↑g x₀)) ≫
        hcast (_ : ↑g x₀ = ↑H (1, x₀)) ≫
          (π.map (uliftMap H)).map (prodToProdTopI (𝟙 (fromTop { down := 1 })) p) ≫ hcast (_ : ↑H (1, x₁) = ↑g x₁) =
      diagonalPath' H p
[PROOFSTEP]
dsimp only [prodToProdTopI]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
            hcast (_ : ↑H (0, x₁) = ↑f x₁)) ≫
        hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁)) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁))) ≫
            hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁)) =
      diagonalPath' H p ∧
    (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
            hcast (_ : ↑H (1, x₀) = ↑g x₀)) ≫
        hcast (_ : ↑g x₀ = ↑H (1, x₀)) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p)) ≫
            hcast (_ : ↑H (1, x₁) = ↑g x₁) =
      diagonalPath' H p
[PROOFSTEP]
constructor
[GOAL]
case left
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
        (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
          hcast (_ : ↑H (0, x₁) = ↑f x₁)) ≫
      hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁)) ≫
        (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁))) ≫
          hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁)) =
    diagonalPath' H p
[PROOFSTEP]
slice_lhs 2 4 =>
  rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    hcast (_ : ↑H (0, x₁) = ↑f x₁) ≫ hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    hcast (_ : ↑H (0, x₁) = ↑f x₁) ≫ hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    hcast (_ : ↑H (0, x₁) = ↑f x₁) ≫ hcast (_ : ↑f (fromTop x₁) = ↑H (0, fromTop x₁))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
  -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case left
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
      (((π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
            𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 0 }, x₁)))) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))) ≫
        hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁)) =
    diagonalPath' H p
[PROOFSTEP]
slice_lhs 2 4 => simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 0 }, x₁))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 0 }, x₁))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 0 }), p)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 0 }, x₁))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 (fromTop x₁)))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, fromTop x₁) = ↑g (fromTop x₁))
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case right
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ (hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
        (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
          hcast (_ : ↑H (1, x₀) = ↑g x₀)) ≫
      hcast (_ : ↑g x₀ = ↑H (1, x₀)) ≫
        (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p)) ≫
          hcast (_ : ↑H (1, x₁) = ↑g x₁) =
    diagonalPath' H p
[PROOFSTEP]
slice_lhs 2 4 =>
  rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    hcast (_ : ↑H (1, x₀) = ↑g x₀) ≫ hcast (_ : ↑g x₀ = ↑H (1, x₀))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    hcast (_ : ↑H (1, x₀) = ↑g x₀) ≫ hcast (_ : ↑g x₀ = ↑H (1, x₀))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
    -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    hcast (_ : ↑H (1, x₀) = ↑g x₀) ≫ hcast (_ : ↑g x₀ = ↑H (1, x₀))
case a.a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
rw [eqToHom_trans, eqToHom_refl]
  -- Porting note: this ↓ `simp` didn't do this
[GOAL]
case right
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
⊢ hcast (_ : ↑f x₀ = ↑H (0, x₀)) ≫
      (((π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
            𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 1 }, x₀)))) ≫
          (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))) ≫
        hcast (_ : ↑H (1, x₁) = ↑g x₁) =
    diagonalPath' H p
[PROOFSTEP]
slice_lhs 2 4 => simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 1 }, x₀))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 1 }, x₀))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (uhpath01, 𝟙 x₀)) ≫
    𝟙 ((π.map (uliftMap H)).obj ((prodToProdTop (TopCat.of (ULift ↑I)) X).obj ({ down := 1 }, x₀))) ≫
      (π.map (uliftMap H)).map ((prodToProdTop (TopCat.of (ULift ↑I)) X).map (𝟙 (fromTop { down := 1 }), p))
case a.a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑H (1, x₁) = ↑g x₁)
case a
X Y : TopCat
f g : C(↑X, ↑Y)
H : Homotopy f g
x₀ x₁ : ↑X
p : fromTop x₀ ⟶ fromTop x₁
| hcast (_ : ↑f x₀ = ↑H (0, x₀))
[PROOFSTEP]
simp [← CategoryTheory.Functor.map_comp]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
x y : ↑(π.obj X)
p : x ⟶ y
⊢ (π.map f).map p ≫
      (fun x =>
          Quotient.mk (Path.Homotopic.setoid ((π.map f).obj x) ((π.map g).obj x)) (ContinuousMap.Homotopy.evalAt H x))
        y =
    (fun x =>
          Quotient.mk (Path.Homotopic.setoid ((π.map f).obj x) ((π.map g).obj x)) (ContinuousMap.Homotopy.evalAt H x))
        x ≫
      (π.map g).map p
[PROOFSTEP]
erw [(H.eq_diag_path p).1, (H.eq_diag_path p).2]
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
⊢ IsIso (homotopicMapsNatIso H)
[PROOFSTEP]
apply NatIso.isIso_of_isIso_app
[GOAL]
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ ↑(π.obj X) ≌ ↑(π.obj Y)
[PROOFSTEP]
apply CategoryTheory.Equivalence.mk (πₘ hequiv.toFun : πₓ X ⥤ πₓ Y) (πₘ hequiv.invFun : πₓ Y ⥤ πₓ X)
[GOAL]
case η
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ 𝟭 ↑(π.obj X) ≅ π.map hequiv.toFun ⋙ π.map hequiv.invFun
[PROOFSTEP]
simp only [Grpd.hom_to_functor, Grpd.id_to_functor]
[GOAL]
case ε
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ π.map hequiv.invFun ⋙ π.map hequiv.toFun ≅ 𝟭 ↑(π.obj Y)
[PROOFSTEP]
simp only [Grpd.hom_to_functor, Grpd.id_to_functor]
[GOAL]
case η
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ 𝟙 (π.obj X) ≅ π.map hequiv.toFun ⋙ π.map hequiv.invFun
[PROOFSTEP]
convert (asIso (homotopicMapsNatIso hequiv.left_inv.some)).symm
[GOAL]
case h.e'_3
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ 𝟙 (π.obj X) = π.map (ContinuousMap.id ↑X)
case h.e'_4
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ π.map hequiv.toFun ⋙ π.map hequiv.invFun = π.map (ContinuousMap.comp hequiv.invFun hequiv.toFun)
[PROOFSTEP]
exacts [((π).map_id X).symm, ((π).map_comp _ _).symm]
[GOAL]
case ε
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ π.map hequiv.invFun ⋙ π.map hequiv.toFun ≅ 𝟙 (π.obj Y)
[PROOFSTEP]
convert asIso (homotopicMapsNatIso hequiv.right_inv.some)
[GOAL]
case h.e'_3
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ π.map hequiv.invFun ⋙ π.map hequiv.toFun = π.map (ContinuousMap.comp hequiv.toFun hequiv.invFun)
case h.e'_4
X Y : TopCat
f g : C(↑X, ↑Y)
H : ContinuousMap.Homotopy f g
hequiv : ↑X ≃ₕ ↑Y
⊢ 𝟙 (π.obj Y) = π.map (ContinuousMap.id ↑Y)
[PROOFSTEP]
exacts [((π).map_comp _ _).symm, ((π).map_id Y).symm]


[GOAL]
n k : ℕ
x : Fin k → ℕ
⊢ x ∈ antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n
[PROOFSTEP]
induction x using Fin.consInduction generalizing n with
| h0 =>
  cases n
  · simp
  · simp [eq_comm]
| h x₀ x ih =>
  simp_rw [Fin.sum_cons]
  rw [antidiagonalTuple]
    -- porting note: simp_rw doesn't use the equation lemma properly
  simp_rw [List.mem_bind, List.mem_map, List.Nat.mem_antidiagonal, Fin.cons_eq_cons, exists_eq_right_right, ih,
    @eq_comm _ _ (Prod.snd _), and_comm (a := Prod.snd _ = _), ← Prod.mk.inj_iff (a₁ := Prod.fst _), Prod.mk.eta,
    exists_eq_right]
[GOAL]
n k : ℕ
x : Fin k → ℕ
⊢ x ∈ antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n
[PROOFSTEP]
induction x using Fin.consInduction generalizing n with
| h0 =>
  cases n
  · simp
  · simp [eq_comm]
| h x₀ x ih =>
  simp_rw [Fin.sum_cons]
  rw [antidiagonalTuple]
    -- porting note: simp_rw doesn't use the equation lemma properly
  simp_rw [List.mem_bind, List.mem_map, List.Nat.mem_antidiagonal, Fin.cons_eq_cons, exists_eq_right_right, ih,
    @eq_comm _ _ (Prod.snd _), and_comm (a := Prod.snd _ = _), ← Prod.mk.inj_iff (a₁ := Prod.fst _), Prod.mk.eta,
    exists_eq_right]
[GOAL]
case h0
k n : ℕ
⊢ Fin.elim0 ∈ antidiagonalTuple 0 n ↔ ∑ i : Fin 0, Fin.elim0 i = n
[PROOFSTEP]

| h0 =>
  cases n
  · simp
  · simp [eq_comm]
[GOAL]
case h0
k n : ℕ
⊢ Fin.elim0 ∈ antidiagonalTuple 0 n ↔ ∑ i : Fin 0, Fin.elim0 i = n
[PROOFSTEP]
cases n
[GOAL]
case h0.zero
k : ℕ
⊢ Fin.elim0 ∈ antidiagonalTuple 0 Nat.zero ↔ ∑ i : Fin 0, Fin.elim0 i = Nat.zero
[PROOFSTEP]
simp
[GOAL]
case h0.succ
k n✝ : ℕ
⊢ Fin.elim0 ∈ antidiagonalTuple 0 (Nat.succ n✝) ↔ ∑ i : Fin 0, Fin.elim0 i = Nat.succ n✝
[PROOFSTEP]
simp [eq_comm]
[GOAL]
case h
k n✝ x₀ : ℕ
x : Fin n✝ → ℕ
ih : ∀ {n : ℕ}, x ∈ antidiagonalTuple n✝ n ↔ ∑ i : Fin n✝, x i = n
n : ℕ
⊢ Fin.cons x₀ x ∈ antidiagonalTuple (n✝ + 1) n ↔ ∑ i : Fin (n✝ + 1), Fin.cons x₀ x i = n
[PROOFSTEP]

| h x₀ x ih =>
  simp_rw [Fin.sum_cons]
  rw [antidiagonalTuple]
    -- porting note: simp_rw doesn't use the equation lemma properly
  simp_rw [List.mem_bind, List.mem_map, List.Nat.mem_antidiagonal, Fin.cons_eq_cons, exists_eq_right_right, ih,
    @eq_comm _ _ (Prod.snd _), and_comm (a := Prod.snd _ = _), ← Prod.mk.inj_iff (a₁ := Prod.fst _), Prod.mk.eta,
    exists_eq_right]
[GOAL]
case h
k n✝ x₀ : ℕ
x : Fin n✝ → ℕ
ih : ∀ {n : ℕ}, x ∈ antidiagonalTuple n✝ n ↔ ∑ i : Fin n✝, x i = n
n : ℕ
⊢ Fin.cons x₀ x ∈ antidiagonalTuple (n✝ + 1) n ↔ ∑ i : Fin (n✝ + 1), Fin.cons x₀ x i = n
[PROOFSTEP]
simp_rw [Fin.sum_cons]
[GOAL]
case h
k n✝ x₀ : ℕ
x : Fin n✝ → ℕ
ih : ∀ {n : ℕ}, x ∈ antidiagonalTuple n✝ n ↔ ∑ i : Fin n✝, x i = n
n : ℕ
⊢ Fin.cons x₀ x ∈ antidiagonalTuple (n✝ + 1) n ↔ x₀ + ∑ i : Fin n✝, x i = n
[PROOFSTEP]
rw [antidiagonalTuple]
  -- porting note: simp_rw doesn't use the equation lemma properly
[GOAL]
case h
k n✝ x₀ : ℕ
x : Fin n✝ → ℕ
ih : ∀ {n : ℕ}, x ∈ antidiagonalTuple n✝ n ↔ ∑ i : Fin n✝, x i = n
n : ℕ
⊢ (Fin.cons x₀ x ∈
      List.bind (antidiagonal n) fun ni => map (fun x => Fin.cons ni.fst x) (antidiagonalTuple n✝ ni.snd)) ↔
    x₀ + ∑ i : Fin n✝, x i = n
[PROOFSTEP]
simp_rw [List.mem_bind, List.mem_map, List.Nat.mem_antidiagonal, Fin.cons_eq_cons, exists_eq_right_right, ih,
  @eq_comm _ _ (Prod.snd _), and_comm (a := Prod.snd _ = _), ← Prod.mk.inj_iff (a₁ := Prod.fst _), Prod.mk.eta,
  exists_eq_right]
[GOAL]
k n : ℕ
⊢ Nodup (antidiagonalTuple k n)
[PROOFSTEP]
induction' k with k ih generalizing n
[GOAL]
case zero
n✝ n : ℕ
⊢ Nodup (antidiagonalTuple Nat.zero n)
[PROOFSTEP]
cases n
[GOAL]
case zero.zero
n : ℕ
⊢ Nodup (antidiagonalTuple Nat.zero Nat.zero)
[PROOFSTEP]
simp
[GOAL]
case zero.succ
n n✝ : ℕ
⊢ Nodup (antidiagonalTuple Nat.zero (Nat.succ n✝))
[PROOFSTEP]
simp [eq_comm]
[GOAL]
case succ
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
⊢ Nodup (antidiagonalTuple (Nat.succ k) n)
[PROOFSTEP]
simp_rw [antidiagonalTuple, List.nodup_bind]
[GOAL]
case succ
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
⊢ (∀ (x : ℕ × ℕ), x ∈ antidiagonal n → Nodup (map (fun x_1 => Fin.cons x.fst x_1) (antidiagonalTuple k x.snd))) ∧
    Pairwise
      (fun a b =>
        Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
          (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
      (antidiagonal n)
[PROOFSTEP]
constructor
[GOAL]
case succ.left
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
⊢ ∀ (x : ℕ × ℕ), x ∈ antidiagonal n → Nodup (map (fun x_1 => Fin.cons x.fst x_1) (antidiagonalTuple k x.snd))
[PROOFSTEP]
intro i _
[GOAL]
case succ.left
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
i : ℕ × ℕ
a✝ : i ∈ antidiagonal n
⊢ Nodup (map (fun x => Fin.cons i.fst x) (antidiagonalTuple k i.snd))
[PROOFSTEP]
exact (ih i.snd).map (Fin.cons_right_injective (α := fun _ => ℕ) i.fst)
[GOAL]
case succ.right
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
⊢ Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
[PROOFSTEP]
induction' n with n n_ih
[GOAL]
case succ.right.zero
n k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
⊢ Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal Nat.zero)
[PROOFSTEP]
exact List.pairwise_singleton _ _
[GOAL]
case succ.right.succ
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
⊢ Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal (Nat.succ n))
[PROOFSTEP]
rw [List.Nat.antidiagonal_succ]
[GOAL]
case succ.right.succ
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
⊢ Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    ((0, n + 1) :: map (Prod.map Nat.succ id) (antidiagonal n))
[PROOFSTEP]
refine' List.Pairwise.cons (fun a ha x hx₁ hx₂ => _) (n_ih.map _ fun a b h x hx₁ hx₂ => _)
[GOAL]
case succ.right.succ.refine'_1
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a : ℕ × ℕ
ha : a ∈ map (Prod.map Nat.succ id) (antidiagonal n)
x : Fin (Nat.succ k) → ℕ
hx₁ : x ∈ map (fun x => Fin.cons (0, n + 1).fst x) (antidiagonalTuple k (0, n + 1).snd)
hx₂ : x ∈ map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd)
⊢ False
[PROOFSTEP]
rw [List.mem_map] at hx₁ hx₂ ha
[GOAL]
case succ.right.succ.refine'_1
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a : ℕ × ℕ
ha : ∃ a_1, a_1 ∈ antidiagonal n ∧ Prod.map Nat.succ id a_1 = a
x : Fin (Nat.succ k) → ℕ
hx₁ : ∃ a, a ∈ antidiagonalTuple k (0, n + 1).snd ∧ Fin.cons (0, n + 1).fst a = x
hx₂ : ∃ a_1, a_1 ∈ antidiagonalTuple k a.snd ∧ Fin.cons a.fst a_1 = x
⊢ False
[PROOFSTEP]
obtain ⟨⟨a, -, rfl⟩, ⟨x₁, -, rfl⟩, ⟨x₂, -, h⟩⟩ := ha, hx₁, hx₂
[GOAL]
case succ.right.succ.refine'_1.intro.intro.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a : ℕ × ℕ
x₁ x₂ : Fin k → ℕ
h : Fin.cons (Prod.map Nat.succ id a).fst x₂ = Fin.cons (0, n + 1).fst x₁
⊢ False
[PROOFSTEP]
rw [Fin.cons_eq_cons] at h
[GOAL]
case succ.right.succ.refine'_1.intro.intro.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a : ℕ × ℕ
x₁ x₂ : Fin k → ℕ
h : (Prod.map Nat.succ id a).fst = (0, n + 1).fst ∧ x₂ = x₁
⊢ False
[PROOFSTEP]
injection h.1
[GOAL]
case succ.right.succ.refine'_2
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x : Fin (Nat.succ k) → ℕ
hx₁ : x ∈ map (fun x => Fin.cons (Prod.map Nat.succ id a).fst x) (antidiagonalTuple k (Prod.map Nat.succ id a).snd)
hx₂ : x ∈ map (fun x => Fin.cons (Prod.map Nat.succ id b).fst x) (antidiagonalTuple k (Prod.map Nat.succ id b).snd)
⊢ False
[PROOFSTEP]
rw [List.mem_map] at hx₁ hx₂
[GOAL]
case succ.right.succ.refine'_2
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x : Fin (Nat.succ k) → ℕ
hx₁ : ∃ a_1, a_1 ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd ∧ Fin.cons (Prod.map Nat.succ id a).fst a_1 = x
hx₂ : ∃ a, a ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd ∧ Fin.cons (Prod.map Nat.succ id b).fst a = x
⊢ False
[PROOFSTEP]
obtain ⟨⟨x₁, hx₁, rfl⟩, ⟨x₂, hx₂, h₁₂⟩⟩ := hx₁, hx₂
[GOAL]
case succ.right.succ.refine'_2.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x₁ : Fin k → ℕ
hx₁ : x₁ ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd
x₂ : Fin k → ℕ
hx₂ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd
h₁₂ : Fin.cons (Prod.map Nat.succ id b).fst x₂ = Fin.cons (Prod.map Nat.succ id a).fst x₁
⊢ False
[PROOFSTEP]
dsimp at h₁₂
[GOAL]
case succ.right.succ.refine'_2.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x₁ : Fin k → ℕ
hx₁ : x₁ ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd
x₂ : Fin k → ℕ
hx₂ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd
h₁₂ : Fin.cons (Nat.succ b.fst) x₂ = Fin.cons (Nat.succ a.fst) x₁
⊢ False
[PROOFSTEP]
rw [Fin.cons_eq_cons, Nat.succ_inj'] at h₁₂
[GOAL]
case succ.right.succ.refine'_2.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x₁ : Fin k → ℕ
hx₁ : x₁ ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd
x₂ : Fin k → ℕ
hx₂ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd
h₁₂ : b.fst = a.fst ∧ x₂ = x₁
⊢ False
[PROOFSTEP]
obtain ⟨h₁₂, rfl⟩ := h₁₂
[GOAL]
case succ.right.succ.refine'_2.intro.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd))
x₂ : Fin k → ℕ
hx₂ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd
h₁₂ : b.fst = a.fst
hx₁ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd
⊢ False
[PROOFSTEP]
rw [h₁₂] at h
[GOAL]
case succ.right.succ.refine'_2.intro.intro.intro.intro.intro
n✝ k : ℕ
ih : ∀ (n : ℕ), Nodup (antidiagonalTuple k n)
n : ℕ
n_ih :
  Pairwise
    (fun a b =>
      Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
        (map (fun x => Fin.cons b.fst x) (antidiagonalTuple k b.snd)))
    (antidiagonal n)
a b : ℕ × ℕ
h :
  Disjoint (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k a.snd))
    (map (fun x => Fin.cons a.fst x) (antidiagonalTuple k b.snd))
x₂ : Fin k → ℕ
hx₂ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id b).snd
h₁₂ : b.fst = a.fst
hx₁ : x₂ ∈ antidiagonalTuple k (Prod.map Nat.succ id a).snd
⊢ False
[PROOFSTEP]
exact h (List.mem_map_of_mem _ hx₁) (List.mem_map_of_mem _ hx₂)
[GOAL]
k : ℕ
⊢ antidiagonalTuple (k + 1) 0 = [0]
[PROOFSTEP]
rw [antidiagonalTuple, antidiagonal_zero, List.bind_singleton, antidiagonalTuple_zero_right k, List.map_singleton]
[GOAL]
k : ℕ
⊢ [Fin.cons (0, 0).fst 0] = [0]
[PROOFSTEP]
exact congr_arg (fun x => [x]) Matrix.cons_zero_zero
[GOAL]
n : ℕ
⊢ antidiagonalTuple 1 n = [![n]]
[PROOFSTEP]
simp_rw [antidiagonalTuple, antidiagonal, List.range_succ, List.map_append, List.map_singleton, tsub_self,
  List.append_bind, List.bind_singleton, List.map_bind]
[GOAL]
n : ℕ
⊢ (List.bind (range n) fun a => map (fun x => Fin.cons a x) (antidiagonalTuple 0 (n - a))) ++
      map (fun x => Fin.cons n x) (antidiagonalTuple 0 0) =
    [![n]]
[PROOFSTEP]
conv_rhs => rw [← List.nil_append [![n]]]
[GOAL]
n : ℕ
| [![n]]
[PROOFSTEP]
rw [← List.nil_append [![n]]]
[GOAL]
n : ℕ
| [![n]]
[PROOFSTEP]
rw [← List.nil_append [![n]]]
[GOAL]
n : ℕ
| [![n]]
[PROOFSTEP]
rw [← List.nil_append [![n]]]
[GOAL]
n : ℕ
⊢ (List.bind (range n) fun a => map (fun x => Fin.cons a x) (antidiagonalTuple 0 (n - a))) ++
      map (fun x => Fin.cons n x) (antidiagonalTuple 0 0) =
    [] ++ [![n]]
[PROOFSTEP]
congr 1
[GOAL]
case e_a
n : ℕ
⊢ (List.bind (range n) fun a => map (fun x => Fin.cons a x) (antidiagonalTuple 0 (n - a))) = []
[PROOFSTEP]
simp_rw [List.bind_eq_nil, List.mem_range, List.map_eq_nil]
[GOAL]
case e_a
n : ℕ
⊢ ∀ (x : ℕ), x < n → antidiagonalTuple 0 (n - x) = []
[PROOFSTEP]
intro x hx
[GOAL]
case e_a
n x : ℕ
hx : x < n
⊢ antidiagonalTuple 0 (n - x) = []
[PROOFSTEP]
obtain ⟨m, rfl⟩ := Nat.exists_eq_add_of_lt hx
[GOAL]
case e_a.intro
x m : ℕ
hx : x < x + m + 1
⊢ antidiagonalTuple 0 (x + m + 1 - x) = []
[PROOFSTEP]
rw [add_assoc, add_tsub_cancel_left, antidiagonalTuple_zero_succ]
[GOAL]
n : ℕ
⊢ antidiagonalTuple 2 n = map (fun i => ![i.fst, i.snd]) (antidiagonal n)
[PROOFSTEP]
rw [antidiagonalTuple]
[GOAL]
n : ℕ
⊢ (List.bind (antidiagonal n) fun ni => map (fun x => Fin.cons ni.fst x) (antidiagonalTuple 1 ni.snd)) =
    map (fun i => ![i.fst, i.snd]) (antidiagonal n)
[PROOFSTEP]
simp_rw [antidiagonalTuple_one, List.map_singleton]
[GOAL]
n : ℕ
⊢ (List.bind (antidiagonal n) fun ni => [Fin.cons ni.fst ![ni.snd]]) = map (fun i => ![i.fst, i.snd]) (antidiagonal n)
[PROOFSTEP]
rw [List.map_eq_bind]
[GOAL]
n : ℕ
⊢ (List.bind (antidiagonal n) fun ni => [Fin.cons ni.fst ![ni.snd]]) =
    List.bind (antidiagonal n) fun x => [![x.fst, x.snd]]
[PROOFSTEP]
rfl
[GOAL]
k n : ℕ
⊢ Pairwise (Pi.Lex (fun x x_1 => x < x_1) fun x x x_1 => x < x_1) (antidiagonalTuple (k + 1) n)
[PROOFSTEP]
simp_rw [antidiagonalTuple, List.pairwise_bind, List.pairwise_map, List.mem_map, forall_exists_index, and_imp,
  forall_apply_eq_imp_iff₂]
[GOAL]
k n : ℕ
⊢ (∀ (a : ℕ × ℕ),
      a ∈ antidiagonal n →
        Pairwise
          (fun a_2 b => Pi.Lex (fun x x_1 => x < x_1) (fun x x x_1 => x < x_1) (Fin.cons a.fst a_2) (Fin.cons a.fst b))
          (antidiagonalTuple (Nat.add k 0) a.snd)) ∧
    Pairwise
      (fun a₁ a₂ =>
        ∀ (a : Fin (Nat.add k 0) → ℕ),
          a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
            ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
              a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
                Pi.Lex (fun x x_1 => x < x_1) (fun x x x_1 => x < x_1) (Fin.cons a₁.fst a) (Fin.cons a₂.fst a_2))
      (antidiagonal n)
[PROOFSTEP]
simp only [mem_antidiagonal, Prod.forall, and_imp, forall_apply_eq_imp_iff₂]
[GOAL]
k n : ℕ
⊢ (∀ (a b : ℕ),
      a + b = n →
        Pairwise (fun a_2 b => Pi.Lex (fun x x_1 => x < x_1) (fun x x x_1 => x < x_1) (Fin.cons a a_2) (Fin.cons a b))
          (antidiagonalTuple (Nat.add k 0) b)) ∧
    Pairwise
      (fun a₁ a₂ =>
        ∀ (a : Fin (Nat.add k 0) → ℕ),
          a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
            ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
              a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
                Pi.Lex (fun x x_1 => x < x_1) (fun x x x_1 => x < x_1) (Fin.cons a₁.fst a) (Fin.cons a₂.fst a_2))
      (antidiagonal n)
[PROOFSTEP]
simp only [Fin.pi_lex_lt_cons_cons, eq_self_iff_true, true_and_iff, lt_self_iff_false, false_or_iff]
[GOAL]
k n : ℕ
⊢ (∀ (a b : ℕ),
      a + b = n →
        Pairwise (fun a b => Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a b)
          (antidiagonalTuple (Nat.add k 0) b)) ∧
    Pairwise
      (fun a₁ a₂ =>
        ∀ (a : Fin (Nat.add k 0) → ℕ),
          a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
            ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
              a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
                a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
      (antidiagonal n)
[PROOFSTEP]
refine' ⟨fun _ _ _ => antidiagonalTuple_pairwise_pi_lex k _, _⟩
[GOAL]
k n : ℕ
⊢ Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
[PROOFSTEP]
induction' n with n n_ih
[GOAL]
case zero
k : ℕ
⊢ Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal Nat.zero)
[PROOFSTEP]
rw [antidiagonal_zero]
[GOAL]
case zero
k : ℕ
⊢ Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    [(0, 0)]
[PROOFSTEP]
exact List.pairwise_singleton _ _
[GOAL]
case succ
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
⊢ Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal (Nat.succ n))
[PROOFSTEP]
rw [antidiagonal_succ, List.pairwise_cons, List.pairwise_map]
[GOAL]
case succ
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
⊢ (∀ (a' : ℕ × ℕ),
      a' ∈ map (Prod.map Nat.succ id) (antidiagonal n) →
        ∀ (a : Fin (Nat.add k 0) → ℕ),
          a ∈ antidiagonalTuple (Nat.add k 0) (0, n + 1).snd →
            ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
              a_2 ∈ antidiagonalTuple (Nat.add k 0) a'.snd →
                (0, n + 1).fst < a'.fst ∨
                  (0, n + 1).fst = a'.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2) ∧
    Pairwise
      (fun a b =>
        ∀ (a_1 : Fin (Nat.add k 0) → ℕ),
          a_1 ∈ antidiagonalTuple (Nat.add k 0) (Prod.map Nat.succ id a).snd →
            ∀ (a_3 : Fin (Nat.add k 0) → ℕ),
              a_3 ∈ antidiagonalTuple (Nat.add k 0) (Prod.map Nat.succ id b).snd →
                (Prod.map Nat.succ id a).fst < (Prod.map Nat.succ id b).fst ∨
                  (Prod.map Nat.succ id a).fst = (Prod.map Nat.succ id b).fst ∧
                    Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a_1 a_3)
      (antidiagonal n)
[PROOFSTEP]
refine' ⟨fun p hp x hx y hy => _, _⟩
[GOAL]
case succ.refine'_1
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
p : ℕ × ℕ
hp : p ∈ map (Prod.map Nat.succ id) (antidiagonal n)
x : Fin (Nat.add k 0) → ℕ
hx : x ∈ antidiagonalTuple (Nat.add k 0) (0, n + 1).snd
y : Fin (Nat.add k 0) → ℕ
hy : y ∈ antidiagonalTuple (Nat.add k 0) p.snd
⊢ (0, n + 1).fst < p.fst ∨ (0, n + 1).fst = p.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) x y
[PROOFSTEP]
rw [List.mem_map, Prod.exists] at hp
[GOAL]
case succ.refine'_1
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
p : ℕ × ℕ
hp : ∃ a b, (a, b) ∈ antidiagonal n ∧ Prod.map Nat.succ id (a, b) = p
x : Fin (Nat.add k 0) → ℕ
hx : x ∈ antidiagonalTuple (Nat.add k 0) (0, n + 1).snd
y : Fin (Nat.add k 0) → ℕ
hy : y ∈ antidiagonalTuple (Nat.add k 0) p.snd
⊢ (0, n + 1).fst < p.fst ∨ (0, n + 1).fst = p.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) x y
[PROOFSTEP]
obtain ⟨a, b, _, rfl : (Nat.succ a, b) = p⟩ := hp
[GOAL]
case succ.refine'_1.intro.intro.intro
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
x : Fin (Nat.add k 0) → ℕ
hx : x ∈ antidiagonalTuple (Nat.add k 0) (0, n + 1).snd
y : Fin (Nat.add k 0) → ℕ
a b : ℕ
left✝ : (a, b) ∈ antidiagonal n
hy : y ∈ antidiagonalTuple (Nat.add k 0) (Nat.succ a, b).snd
⊢ (0, n + 1).fst < (Nat.succ a, b).fst ∨
    (0, n + 1).fst = (Nat.succ a, b).fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) x y
[PROOFSTEP]
exact Or.inl (Nat.zero_lt_succ _)
[GOAL]
case succ.refine'_2
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
⊢ Pairwise
    (fun a b =>
      ∀ (a_1 : Fin (Nat.add k 0) → ℕ),
        a_1 ∈ antidiagonalTuple (Nat.add k 0) (Prod.map Nat.succ id a).snd →
          ∀ (a_3 : Fin (Nat.add k 0) → ℕ),
            a_3 ∈ antidiagonalTuple (Nat.add k 0) (Prod.map Nat.succ id b).snd →
              (Prod.map Nat.succ id a).fst < (Prod.map Nat.succ id b).fst ∨
                (Prod.map Nat.succ id a).fst = (Prod.map Nat.succ id b).fst ∧
                  Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a_1 a_3)
    (antidiagonal n)
[PROOFSTEP]
dsimp
[GOAL]
case succ.refine'_2
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
⊢ Pairwise
    (fun a b =>
      ∀ (a_1 : Fin k → ℕ),
        a_1 ∈ antidiagonalTuple k a.snd →
          ∀ (a_3 : Fin k → ℕ),
            a_3 ∈ antidiagonalTuple k b.snd →
              Nat.succ a.fst < Nat.succ b.fst ∨
                Nat.succ a.fst = Nat.succ b.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a_1 a_3)
    (antidiagonal n)
[PROOFSTEP]
simp_rw [Nat.succ_inj', Nat.succ_lt_succ_iff]
[GOAL]
case succ.refine'_2
k n : ℕ
n_ih :
  Pairwise
    (fun a₁ a₂ =>
      ∀ (a : Fin (Nat.add k 0) → ℕ),
        a ∈ antidiagonalTuple (Nat.add k 0) a₁.snd →
          ∀ (a_2 : Fin (Nat.add k 0) → ℕ),
            a_2 ∈ antidiagonalTuple (Nat.add k 0) a₂.snd →
              a₁.fst < a₂.fst ∨ a₁.fst = a₂.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a a_2)
    (antidiagonal n)
⊢ Pairwise
    (fun a b =>
      ∀ (a_1 : Fin k → ℕ),
        a_1 ∈ antidiagonalTuple k a.snd →
          ∀ (a_3 : Fin k → ℕ),
            a_3 ∈ antidiagonalTuple k b.snd →
              a.fst < b.fst ∨ a.fst = b.fst ∧ Pi.Lex (fun x x_1 => x < x_1) (fun i x x_1 => x < x_1) a_1 a_3)
    (antidiagonal n)
[PROOFSTEP]
exact n_ih


[GOAL]
R : Type u_1
inst✝⁸ : Semiring R
C : Type u_2
D : Type u_3
inst✝⁷ : Category.{?u.28793, u_2} C
inst✝⁶ : Category.{?u.28797, u_3} D
inst✝⁵ : Preadditive C
inst✝⁴ : Linear R C
inst✝³ : Preadditive D
inst✝² : Linear R D
e : C ≌ D
inst✝¹ : Functor.Additive e.functor
inst✝ : Functor.Linear R e.functor
X✝ Y✝ : D
r : X✝ ⟶ Y✝
f : R
⊢ e.inverse.map (f • r) = f • e.inverse.map r
[PROOFSTEP]
apply e.functor.map_injective
[GOAL]
case a
R : Type u_1
inst✝⁸ : Semiring R
C : Type u_2
D : Type u_3
inst✝⁷ : Category.{?u.28793, u_2} C
inst✝⁶ : Category.{?u.28797, u_3} D
inst✝⁵ : Preadditive C
inst✝⁴ : Linear R C
inst✝³ : Preadditive D
inst✝² : Linear R D
e : C ≌ D
inst✝¹ : Functor.Additive e.functor
inst✝ : Functor.Linear R e.functor
X✝ Y✝ : D
r : X✝ ⟶ Y✝
f : R
⊢ e.functor.map (e.inverse.map (f • r)) = e.functor.map (f • e.inverse.map r)
[PROOFSTEP]
simp


[GOAL]
α β : LatCat
e : ↑α ≃o ↑β
⊢ { toSupHom := { toFun := ↑e, map_sup' := (_ : ∀ (a b : ↑α), ↑e (a ⊔ b) = ↑e a ⊔ ↑e b) },
        map_inf' := (_ : ∀ (a b : ↑α), ↑e (a ⊓ b) = ↑e a ⊓ ↑e b) } ≫
      {
        toSupHom :=
          { toFun := ↑(OrderIso.symm e),
            map_sup' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊔ b) = ↑(OrderIso.symm e) a ⊔ ↑(OrderIso.symm e) b) },
        map_inf' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊓ b) = ↑(OrderIso.symm e) a ⊓ ↑(OrderIso.symm e) b) } =
    𝟙 α
[PROOFSTEP]
ext
[GOAL]
case w
α β : LatCat
e : ↑α ≃o ↑β
x✝ : (forget LatCat).obj α
⊢ ↑({ toSupHom := { toFun := ↑e, map_sup' := (_ : ∀ (a b : ↑α), ↑e (a ⊔ b) = ↑e a ⊔ ↑e b) },
            map_inf' := (_ : ∀ (a b : ↑α), ↑e (a ⊓ b) = ↑e a ⊓ ↑e b) } ≫
          {
            toSupHom :=
              { toFun := ↑(OrderIso.symm e),
                map_sup' :=
                  (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊔ b) = ↑(OrderIso.symm e) a ⊔ ↑(OrderIso.symm e) b) },
            map_inf' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊓ b) = ↑(OrderIso.symm e) a ⊓ ↑(OrderIso.symm e) b) })
      x✝ =
    ↑(𝟙 α) x✝
[PROOFSTEP]
exact e.symm_apply_apply _
[GOAL]
α β : LatCat
e : ↑α ≃o ↑β
⊢ {
        toSupHom :=
          { toFun := ↑(OrderIso.symm e),
            map_sup' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊔ b) = ↑(OrderIso.symm e) a ⊔ ↑(OrderIso.symm e) b) },
        map_inf' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊓ b) = ↑(OrderIso.symm e) a ⊓ ↑(OrderIso.symm e) b) } ≫
      { toSupHom := { toFun := ↑e, map_sup' := (_ : ∀ (a b : ↑α), ↑e (a ⊔ b) = ↑e a ⊔ ↑e b) },
        map_inf' := (_ : ∀ (a b : ↑α), ↑e (a ⊓ b) = ↑e a ⊓ ↑e b) } =
    𝟙 β
[PROOFSTEP]
ext
[GOAL]
case w
α β : LatCat
e : ↑α ≃o ↑β
x✝ : (forget LatCat).obj β
⊢ ↑({
            toSupHom :=
              { toFun := ↑(OrderIso.symm e),
                map_sup' :=
                  (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊔ b) = ↑(OrderIso.symm e) a ⊔ ↑(OrderIso.symm e) b) },
            map_inf' := (_ : ∀ (a b : ↑β), ↑(OrderIso.symm e) (a ⊓ b) = ↑(OrderIso.symm e) a ⊓ ↑(OrderIso.symm e) b) } ≫
          { toSupHom := { toFun := ↑e, map_sup' := (_ : ∀ (a b : ↑α), ↑e (a ⊔ b) = ↑e a ⊔ ↑e b) },
            map_inf' := (_ : ∀ (a b : ↑α), ↑e (a ⊓ b) = ↑e a ⊓ ↑e b) })
      x✝ =
    ↑(𝟙 β) x✝
[PROOFSTEP]
exact e.apply_symm_apply _


[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 1 ≤ a
h : m ≤ n
⊢ a ^ m ≤ a ^ n
[PROOFSTEP]
have ha₀ : 0 < a := one_pos.trans_le ha
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 1 ≤ a
h : m ≤ n
ha₀ : 0 < a
⊢ a ^ m ≤ a ^ n
[PROOFSTEP]
lift n - m to ℕ using sub_nonneg.2 h with k hk
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 1 ≤ a
h : m ≤ n
ha₀ : 0 < a
k : ℕ
hk : ↑k = n - m
⊢ a ^ m ≤ a ^ n
[PROOFSTEP]
calc
  a ^ m = a ^ m * 1 := (mul_one _).symm
  _ ≤ a ^ m * a ^ k := (mul_le_mul_of_nonneg_left (one_le_pow_of_one_le ha _) (zpow_nonneg ha₀.le _))
  _ = a ^ n := by rw [← zpow_ofNat, ← zpow_add₀ ha₀.ne', hk, add_sub_cancel'_right]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
ha : 1 ≤ a
h : m ≤ n
ha₀ : 0 < a
k : ℕ
hk : ↑k = n - m
⊢ a ^ m * a ^ k = a ^ n
[PROOFSTEP]
rw [← zpow_ofNat, ← zpow_add₀ ha₀.ne', hk, add_sub_cancel'_right]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a✝ b c d e : α
m n✝ : ℤ
a : ℕ
h : 0 < a
n : ℤ
⊢ 0 < ↑a ^ n
[PROOFSTEP]
apply zpow_pos_of_pos
[GOAL]
case ha
α : Type u_1
inst✝ : LinearOrderedSemifield α
a✝ b c d e : α
m n✝ : ℤ
a : ℕ
h : 0 < a
n : ℤ
⊢ 0 < ↑a
[PROOFSTEP]
exact_mod_cast h
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h₀ : 0 < a
h₁ : a ≠ 1
⊢ Injective ((fun x x_1 => x ^ x_1) a)
[PROOFSTEP]
rcases h₁.lt_or_lt with (H | H)
[GOAL]
case inl
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h₀ : 0 < a
h₁ : a ≠ 1
H : a < 1
⊢ Injective ((fun x x_1 => x ^ x_1) a)
[PROOFSTEP]
exact (zpow_strictAnti h₀ H).injective
[GOAL]
case inr
α : Type u_1
inst✝ : LinearOrderedSemifield α
a b c d e : α
m n : ℤ
h₀ : 0 < a
h₁ : a ≠ 1
H : 1 < a
⊢ Injective ((fun x x_1 => x ^ x_1) a)
[PROOFSTEP]
exact (zpow_strictMono H).injective
[GOAL]
α : Type u_1
inst✝ : LinearOrderedSemifield α
a✝ b✝ c✝ d e : α
m n : ℤ
x : α
hx : 1 < x
a b c : ℤ
⊢ x ^ (-c) ≤ max (x ^ (-a)) (x ^ (-b)) ↔ min a b ≤ c
[PROOFSTEP]
simp_rw [le_max_iff, min_le_iff, zpow_le_iff_le hx, neg_le_neg_iff]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d : α
n : ℤ
a : α
⊢ 0 ≤ a ^ 2
[PROOFSTEP]
convert zpow_bit0_nonneg a 1
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
h : a ≠ 0
⊢ 0 < a ^ 2
[PROOFSTEP]
convert zpow_bit0_pos h 1
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : n ≠ 0
⊢ 0 < a ^ bit0 n → a ≠ 0
[PROOFSTEP]
rintro h rfl
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
b c d : α
n : ℤ
hn : n ≠ 0
h : 0 < 0 ^ bit0 n
⊢ False
[PROOFSTEP]
refine' (zero_zpow _ _).not_gt h
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
b c d : α
n : ℤ
hn : n ≠ 0
h : 0 < 0 ^ bit0 n
⊢ bit0 n ≠ 0
[PROOFSTEP]
rwa [bit0_ne_zero]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
h : a < 0
⊢ a ^ bit1 n < 0
[PROOFSTEP]
rw [bit1, zpow_add_one₀ h.ne]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
h : a < 0
⊢ a ^ bit0 n * a < 0
[PROOFSTEP]
exact mul_neg_of_pos_of_neg (zpow_bit0_pos h.ne _) h
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
⊢ a ^ bit1 n ≤ 0 ↔ a ≤ 0
[PROOFSTEP]
rw [le_iff_lt_or_eq, le_iff_lt_or_eq, zpow_bit1_neg_iff, zpow_eq_zero_iff (Int.bit1_ne_zero n)]
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d : α
n : ℤ
hn : Even n
a : α
⊢ 0 ≤ a ^ n
[PROOFSTEP]
obtain ⟨k, rfl⟩ := hn
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d a : α
k : ℤ
⊢ 0 ≤ a ^ (k + k)
[PROOFSTEP]
exact zpow_bit0_nonneg _ _
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : Even n
h : n ≠ 0
⊢ 0 < a ^ n ↔ a ≠ 0
[PROOFSTEP]
obtain ⟨k, rfl⟩ := hn
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
k : ℤ
h : k + k ≠ 0
⊢ 0 < a ^ (k + k) ↔ a ≠ 0
[PROOFSTEP]
exact zpow_bit0_pos_iff (by rintro rfl; simp at h )
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
k : ℤ
h : k + k ≠ 0
⊢ k ≠ 0
[PROOFSTEP]
rintro rfl
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
h : 0 + 0 ≠ 0
⊢ False
[PROOFSTEP]
simp at h
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : Odd n
⊢ a ^ n < 0 ↔ a < 0
[PROOFSTEP]
cases' hn with k hk
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n k : ℤ
hk : n = 2 * k + 1
⊢ a ^ n < 0 ↔ a < 0
[PROOFSTEP]
simpa only [hk, two_mul] using zpow_bit1_neg_iff
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : Odd n
⊢ 0 ≤ a ^ n ↔ 0 ≤ a
[PROOFSTEP]
cases' hn with k hk
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n k : ℤ
hk : n = 2 * k + 1
⊢ 0 ≤ a ^ n ↔ 0 ≤ a
[PROOFSTEP]
simpa only [hk, two_mul] using zpow_bit1_nonneg_iff
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : Odd n
⊢ a ^ n ≤ 0 ↔ a ≤ 0
[PROOFSTEP]
cases' hn with k hk
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n k : ℤ
hk : n = 2 * k + 1
⊢ a ^ n ≤ 0 ↔ a ≤ 0
[PROOFSTEP]
simpa only [hk, two_mul] using zpow_bit1_nonpos_iff
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n : ℤ
hn : Odd n
⊢ 0 < a ^ n ↔ 0 < a
[PROOFSTEP]
cases' hn with k hk
[GOAL]
case intro
α : Type u_1
inst✝ : LinearOrderedField α
a b c d : α
n k : ℤ
hk : n = 2 * k + 1
⊢ 0 < a ^ n ↔ 0 < a
[PROOFSTEP]
simpa only [hk, two_mul] using zpow_bit1_pos_iff
[GOAL]
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d : α
n p : ℤ
hp : Even p
a : α
⊢ |a| ^ p = a ^ p
[PROOFSTEP]
cases' abs_choice a with h h
[GOAL]
case inl
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d : α
n p : ℤ
hp : Even p
a : α
h : |a| = a
⊢ |a| ^ p = a ^ p
[PROOFSTEP]
simp only [h, hp.neg_zpow _]
[GOAL]
case inr
α : Type u_1
inst✝ : LinearOrderedField α
a✝ b c d : α
n p : ℤ
hp : Even p
a : α
h : |a| = -a
⊢ |a| ^ p = a ^ p
[PROOFSTEP]
simp only [h, hp.neg_zpow _]


[GOAL]
α β : Type u
f : Type u → Type v
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
h : α ≃ β
x : f α
⊢ ↑h.symm <$> ↑h <$> x = x
[PROOFSTEP]
simp [map_map]
[GOAL]
α β : Type u
f : Type u → Type v
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
h : α ≃ β
x : f β
⊢ ↑h <$> ↑h.symm <$> x = x
[PROOFSTEP]
simp [map_map]
[GOAL]
α β : Type u
f : Type u → Type v
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
⊢ mapEquiv f (Equiv.refl α) = Equiv.refl (f α)
[PROOFSTEP]
ext x
[GOAL]
case H
α β : Type u
f : Type u → Type v
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
x : f α
⊢ ↑(mapEquiv f (Equiv.refl α)) x = ↑(Equiv.refl (f α)) x
[PROOFSTEP]
simp only [mapEquiv_apply, refl_apply]
[GOAL]
case H
α β : Type u
f : Type u → Type v
inst✝¹ : Functor f
inst✝ : LawfulFunctor f
x : f α
⊢ ↑(Equiv.refl α) <$> x = x
[PROOFSTEP]
exact LawfulFunctor.id_map x
[GOAL]
α β : Type u
α' β' : Type v
F : Type u → Type v → Type w
inst✝¹ : Bifunctor F
inst✝ : LawfulBifunctor F
h : α ≃ β
h' : α' ≃ β'
x : F α α'
⊢ bimap (↑h.symm) (↑h'.symm) (bimap (↑h) (↑h') x) = x
[PROOFSTEP]
simp [bimap_bimap, id_bimap]
[GOAL]
α β : Type u
α' β' : Type v
F : Type u → Type v → Type w
inst✝¹ : Bifunctor F
inst✝ : LawfulBifunctor F
h : α ≃ β
h' : α' ≃ β'
x : F β β'
⊢ bimap (↑h) (↑h') (bimap (↑h.symm) (↑h'.symm) x) = x
[PROOFSTEP]
simp [bimap_bimap, id_bimap]
[GOAL]
α β : Type u
α' β' : Type v
F : Type u → Type v → Type w
inst✝¹ : Bifunctor F
inst✝ : LawfulBifunctor F
⊢ mapEquiv F (Equiv.refl α) (Equiv.refl α') = Equiv.refl (F α α')
[PROOFSTEP]
ext x
[GOAL]
case H
α β : Type u
α' β' : Type v
F : Type u → Type v → Type w
inst✝¹ : Bifunctor F
inst✝ : LawfulBifunctor F
x : F α α'
⊢ ↑(mapEquiv F (Equiv.refl α) (Equiv.refl α')) x = ↑(Equiv.refl (F α α')) x
[PROOFSTEP]
simp [id_bimap]