case nil
α : Type u_1
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
h : Nodup []
hn : n < length []
⊢ prev [] (nthLe [] n hn) (_ : nthLe [] n hn ∈ []) =
    nthLe [] ((n + (length [] - 1)) % length []) (_ : (n + (length [] - 1)) % length [] < length [])

case cons
α : Type u_1
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
x : α
l : List α
h : Nodup (x :: l)
hn : n < length (x :: l)
⊢ prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
    nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
      (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
α : Type u_1
inst✝ : DecidableEq α
l✝ : List α
x : α
l : List α
h : Nodup l
n : ℕ
hn : n < length l
⊢ prev l (nthLe l n hn) (_ : nthLe l n hn ∈ l) =
    nthLe l ((n + (length l - 1)) % length l) (_ : (n + (length l - 1)) % length l < length l)
cases' l with x l
case cons.nil
α : Type u_1
inst✝ : DecidableEq α
l✝ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l : List α
h✝ : Nodup (x✝ :: l)
hn✝ : n✝ < length (x✝ :: l)
n : ℕ
x : α
h : Nodup [x]
hn : n < length [x]
⊢ prev [x] (nthLe [x] n hn) (_ : nthLe [x] n hn ∈ [x]) =
    nthLe [x] ((n + (length [x] - 1)) % length [x]) (_ : (n + (length [x] - 1)) % length [x] < length [x])

case cons.cons
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
n : ℕ
x : α
h : Nodup (x :: y :: l)
hn : n < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) n hn) (_ : nthLe (x :: y :: l) n hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((n + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (n + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
case cons
α : Type u_1
inst✝ : DecidableEq α
l✝ : List α
x✝ : α
n : ℕ
x : α
l : List α
h : Nodup (x :: l)
hn : n < length (x :: l)
⊢ prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
    nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
      (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
induction' l with y l hl generalizing n x
no goals
case nil
α : Type u_1
inst✝ : DecidableEq α
l : List α
x : α
n : ℕ
h : Nodup []
hn : n < length []
⊢ prev [] (nthLe [] n hn) (_ : nthLe [] n hn ∈ []) =
    nthLe [] ((n + (length [] - 1)) % length []) (_ : (n + (length [] - 1)) % length [] < length [])
simp at hn
no goals
case cons.nil
α : Type u_1
inst✝ : DecidableEq α
l✝ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l : List α
h✝ : Nodup (x✝ :: l)
hn✝ : n✝ < length (x✝ :: l)
n : ℕ
x : α
h : Nodup [x]
hn : n < length [x]
⊢ prev [x] (nthLe [x] n hn) (_ : nthLe [x] n hn ∈ [x]) =
    nthLe [x] ((n + (length [x] - 1)) % length [x]) (_ : (n + (length [x] - 1)) % length [x] < length [x])
simp
case cons.cons.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
hn : Nat.zero < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) Nat.zero hn) (_ : nthLe (x :: y :: l) Nat.zero hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))

case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
hn : Nat.succ Nat.zero < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))

case cons.cons.succ.succ
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
case cons.cons
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
n : ℕ
x : α
h : Nodup (x :: y :: l)
hn : n < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) n hn) (_ : nthLe (x :: y :: l) n hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((n + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (n + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
rcases n with (_ | _ | n)
no goals
case cons.cons.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
hn : Nat.zero < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) Nat.zero hn) (_ : nthLe (x :: y :: l) Nat.zero hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
simp [Nat.add_succ_sub_one, add_zero, List.prev_cons_cons_eq, Nat.zero_eq, List.length,
  List.nthLe, Nat.succ_add_sub_one, zero_add, getLast_eq_get,
  Nat.mod_eq_of_lt (Nat.succ_lt_succ l.length.lt_succ_self)]
case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
hn : Nat.succ Nat.zero < length (x :: y :: l)
h : ¬(x = y ∨ x ∈ l) ∧ ¬y ∈ l ∧ Nodup l
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
hn : Nat.succ Nat.zero < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
simp only [mem_cons, nodup_cons] at h
case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
hn : Nat.succ Nat.zero < length (x :: y :: l)
h : (x ≠ y ∧ ¬x ∈ l) ∧ ¬y ∈ l ∧ Nodup l
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
hn : Nat.succ Nat.zero < length (x :: y :: l)
h : ¬(x = y ∨ x ∈ l) ∧ ¬y ∈ l ∧ Nodup l
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
push_neg  at h
no goals
case cons.cons.succ.zero
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
hn : Nat.succ Nat.zero < length (x :: y :: l)
h : (x ≠ y ∧ ¬x ∈ l) ∧ ¬y ∈ l ∧ Nodup l
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ Nat.zero) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ Nat.zero) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ Nat.zero + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
simp only [List.prev_cons_cons_of_ne _ _ _ _ h.left.left.symm, Nat.zero_eq, List.length,
  List.nthLe, add_comm, eq_self_iff_true, Nat.succ_add_sub_one, Nat.mod_self, zero_add,
  List.get]
case cons.cons.succ.succ
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ prev (y :: l) (nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ∈ y :: l) =
    nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))

case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ≠ x

case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ≠ y
case cons.cons.succ.succ
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ prev (x :: y :: l) (nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ∈ x :: y :: l) =
    nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
rw [prev_ne_cons_cons]
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l))
      (_ : (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) < length (y :: l))
case cons.cons.succ.succ
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ prev (y :: l) (nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn)
      (_ : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ∈ y :: l) =
    nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l))
convert hl n.succ y h.of_cons (Nat.le_of_succ_le_succ hn) using 1
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l))
      (_ : (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) < length (y :: l))
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l))
      (_ : (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) < length (y :: l))
have : ∀ k hk, (y :: l).nthLe k hk = (x :: y :: l).nthLe (k + 1) (Nat.succ_lt_succ hk) := by
  intros
  simp [List.nthLe]
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (x :: y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l) + 1)
      (_ : Nat.succ ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l)) < Nat.succ (length (y :: l)))
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l))
      (_ : (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) < length (y :: l))
rw [this]
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) =
    (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) + 1
case h.e'_3
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ nthLe (x :: y :: l) ((Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l))
      (_ : (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) < length (x :: y :: l)) =
    nthLe (x :: y :: l) ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l) + 1)
      (_ : Nat.succ ((Nat.succ n + (length (y :: l) - 1)) % length (y :: l)) < Nat.succ (length (y :: l)))
congr
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ (Nat.succ (Nat.succ n) + (length l + 1)) % (length l + 1 + 1) = (Nat.succ n + length l) % (length l + 1) + 1
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ (Nat.succ (Nat.succ n) + (length (x :: y :: l) - 1)) % length (x :: y :: l) =
    (Nat.succ n + (length (y :: l) - 1)) % length (y :: l) + 1
simp only [Nat.add_succ_sub_one, add_zero, length]
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
hn : n < length l
⊢ (Nat.succ (Nat.succ n) + (length l + 1)) % (length l + 1 + 1) = (Nat.succ n + length l) % (length l + 1) + 1
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
⊢ (Nat.succ (Nat.succ n) + (length l + 1)) % (length l + 1 + 1) = (Nat.succ n + length l) % (length l + 1) + 1
simp only [length, Nat.succ_lt_succ_iff] at hn
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ (Nat.succ (Nat.succ n) + (k + 1)) % (k + 1 + 1) = (Nat.succ n + k) % (k + 1) + 1
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
hn : n < length l
⊢ (Nat.succ (Nat.succ n) + (length l + 1)) % (length l + 1 + 1) = (Nat.succ n + length l) % (length l + 1) + 1
set k := l.length
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ n < Nat.succ k

case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ n + 1 < Nat.succ (k + 1)
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ (Nat.succ (Nat.succ n) + (k + 1)) % (k + 1 + 1) = (Nat.succ n + k) % (k + 1) + 1
rw [Nat.succ_add, ← Nat.add_succ, Nat.add_mod_right, Nat.succ_add, ← Nat.add_succ _ k,
  Nat.add_mod_right, Nat.mod_eq_of_lt, Nat.mod_eq_of_lt]
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
k✝ : ℕ
hk✝ : k✝ < length (y :: l)
⊢ nthLe (y :: l) k✝ hk✝ = nthLe (x :: y :: l) (k✝ + 1) (_ : Nat.succ k✝ < Nat.succ (length (y :: l)))
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
intros
no goals
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
k✝ : ℕ
hk✝ : k✝ < length (y :: l)
⊢ nthLe (y :: l) k✝ hk✝ = nthLe (x :: y :: l) (k✝ + 1) (_ : Nat.succ k✝ < Nat.succ (length (y :: l)))
simp [List.nthLe]
no goals
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ n < Nat.succ k
exact Nat.lt_succ_of_lt hn
no goals
case h.e'_3.e_n
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
this :
  ∀ (k : ℕ) (hk : k < length (y :: l)),
    nthLe (y :: l) k hk = nthLe (x :: y :: l) (k + 1) (_ : Nat.succ k < Nat.succ (length (y :: l)))
k : ℕ := length l
hn : n < k
⊢ n + 1 < Nat.succ (k + 1)
exact Nat.succ_lt_succ (Nat.lt_succ_of_lt hn)
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ False
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ≠ x
intro H
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ Nat.succ (Nat.succ n) = 0
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ False
suffices n.succ.succ = 0 by simpa
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ Nat.succ (Nat.succ n) = 0
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ Nat.succ (Nat.succ n) = 0
rw [nodup_iff_nthLe_inj] at h
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = nthLe (x :: y :: l) 0 (_ : 0 < Nat.succ (length (y :: l)))
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ Nat.succ (Nat.succ n) = 0
refine' h _ _ hn Nat.succ_pos' _
no goals
case cons.cons.succ.succ.hy
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = nthLe (x :: y :: l) 0 (_ : 0 < Nat.succ (length (y :: l)))
simpa using H
no goals
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = x
this : Nat.succ (Nat.succ n) = 0
⊢ False
simpa
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ False
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn ≠ y
intro H
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ Nat.succ (Nat.succ n) = 1
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ False
suffices n.succ.succ = 1 by simpa
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ Nat.succ (Nat.succ n) = 1
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ Nat.succ (Nat.succ n) = 1
rw [nodup_iff_nthLe_inj] at h
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = nthLe (x :: y :: l) 1 (_ : Nat.succ 0 < Nat.succ (length (y :: l)))
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ Nat.succ (Nat.succ n) = 1
refine' h _ _ hn (Nat.succ_lt_succ Nat.succ_pos') _
no goals
case cons.cons.succ.succ.hz
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h :
  ∀ (i j : ℕ) (h₁ : i < length (x :: y :: l)) (h₂ : j < length (x :: y :: l)),
    nthLe (x :: y :: l) i h₁ = nthLe (x :: y :: l) j h₂ → i = j
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
⊢ nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = nthLe (x :: y :: l) 1 (_ : Nat.succ 0 < Nat.succ (length (y :: l)))
simpa using H
no goals
α : Type u_1
inst✝ : DecidableEq α
l✝¹ : List α
x✝¹ : α
n✝ : ℕ
x✝ : α
l✝ : List α
h✝ : Nodup (x✝ :: l✝)
hn✝ : n✝ < length (x✝ :: l✝)
y : α
l : List α
hl :
  ∀ (n : ℕ) (x : α),
    Nodup (x :: l) →
      ∀ (hn : n < length (x :: l)),
        prev (x :: l) (nthLe (x :: l) n hn) (_ : nthLe (x :: l) n hn ∈ x :: l) =
          nthLe (x :: l) ((n + (length (x :: l) - 1)) % length (x :: l))
            (_ : (n + (length (x :: l) - 1)) % length (x :: l) < length (x :: l))
x : α
h : Nodup (x :: y :: l)
n : ℕ
hn : Nat.succ (Nat.succ n) < length (x :: y :: l)
H : nthLe (x :: y :: l) (Nat.succ (Nat.succ n)) hn = y
this : Nat.succ (Nat.succ n) = 1
⊢ False
simpa