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)
k n : ℕ
⊢ Pairwise (Pi.Lex (fun x x_1 => x < x_1) fun x x x_1 => x < x_1) (antidiagonalTuple (k + 1) n)
simp_rw [antidiagonalTuple, List.pairwise_bind, List.pairwise_map, List.mem_map,
  forall_exists_index, and_imp, forall_apply_eq_imp_iff₂]
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)
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)
simp only [mem_antidiagonal, Prod.forall, and_imp, forall_apply_eq_imp_iff₂]
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)
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)
simp only [Fin.pi_lex_lt_cons_cons, eq_self_iff_true, true_and_iff, lt_self_iff_false,
  false_or_iff]
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)
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)
refine' ⟨fun _ _ _ => antidiagonalTuple_pairwise_pi_lex k _, _⟩
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)

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))
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)
induction' n with n n_ih
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)]
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)
rw [antidiagonal_zero]
no goals
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)]
exact List.pairwise_singleton _ _
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)
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))
rw [antidiagonal_succ, List.pairwise_cons, List.pairwise_map]
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

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)
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)
refine' ⟨fun p hp x hx y hy => _, _⟩
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 + 0) → ℕ),
        a_1 ∈ antidiagonalTuple (k + 0) a.snd →
          ∀ (a_3 : Fin (k + 0) → ℕ),
            a_3 ∈ antidiagonalTuple (k + 0) 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)
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)
dsimp
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 + 0) → ℕ),
        a_1 ∈ antidiagonalTuple (k + 0) a.snd →
          ∀ (a_3 : Fin (k + 0) → ℕ),
            a_3 ∈ antidiagonalTuple (k + 0) 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)
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 + 0) → ℕ),
        a_1 ∈ antidiagonalTuple (k + 0) a.snd →
          ∀ (a_3 : Fin (k + 0) → ℕ),
            a_3 ∈ antidiagonalTuple (k + 0) 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)
simp_rw [Nat.succ_inj', Nat.succ_lt_succ_iff]
no goals
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 + 0) → ℕ),
        a_1 ∈ antidiagonalTuple (k + 0) a.snd →
          ∀ (a_3 : Fin (k + 0) → ℕ),
            a_3 ∈ antidiagonalTuple (k + 0) 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)
exact n_ih
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
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
rw [List.mem_map, Prod.exists] at hp
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
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
obtain ⟨a, b, _, rfl : (Nat.succ a, b) = p⟩ := hp
no goals
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
exact Or.inl (Nat.zero_lt_succ _)