Theorem: Array.eq_of_isEqvAux
File: src/lean/Init/Data/Array/DecidableEq.lean

tactic: by_cases h : i < a.size
state_before: α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
heqv : isEqvAux a b hsz (fun x y => decide (x = y)) i = true
j : Nat
low : i ≤ j
high : j < size a
⊢ a[j] = b[j]

tactic: unfold Array.isEqvAux at heqv
state_before: case inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
heqv : isEqvAux a b hsz (fun x y => decide (x = y)) i = true
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
⊢ a[j] = b[j]

tactic: simp [h] at heqv
state_before: case inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
heqv :
  (if h : i < size a then
      let_fun this := (_ : i < size b);
      decide (a[i] = b[i]) && isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1)
    else true) =
    true
⊢ a[j] = b[j]

tactic: have hind := eq_of_isEqvAux a b hsz (i+1) (Nat.succ_le_of_lt h) heqv.2
state_before: case inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
heqv : a[i] = b[i] ∧ isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1) = true
⊢ a[j] = b[j]

tactic: by_cases heq : i = j
state_before: case inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
heqv : a[i] = b[i] ∧ isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1) = true
hind : ∀ (j : Nat), i + 1 ≤ j → ∀ (high : j < size a), a[j] = b[j]
⊢ a[j] = b[j]

tactic: subst heq
state_before: case inl.inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
heqv : a[i] = b[i] ∧ isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1) = true
hind : ∀ (j : Nat), i + 1 ≤ j → ∀ (high : j < size a), a[j] = b[j]
heq : i = j
⊢ a[j] = b[j]

tactic: exact heqv.1
state_before: case inl.inl
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
h : i < size a
heqv : a[i] = b[i] ∧ isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1) = true
hind : ∀ (j : Nat), i + 1 ≤ j → ∀ (high : j < size a), a[j] = b[j]
low : i ≤ i
high : i < size a
⊢ a[i] = b[i]

tactic: exact hind j (Nat.succ_le_of_lt (Nat.lt_of_le_of_ne low heq)) high
state_before: case inl.inr
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
j : Nat
low : i ≤ j
high : j < size a
h : i < size a
heqv : a[i] = b[i] ∧ isEqvAux a b hsz (fun x y => decide (x = y)) (i + 1) = true
hind : ∀ (j : Nat), i + 1 ≤ j → ∀ (high : j < size a), a[j] = b[j]
heq : ¬i = j
⊢ a[j] = b[j]

tactic: have heq : i = a.size := Nat.le_antisymm hi (Nat.ge_of_not_lt h)
state_before: case inr
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
heqv : isEqvAux a b hsz (fun x y => decide (x = y)) i = true
j : Nat
low : i ≤ j
high : j < size a
h : ¬i < size a
⊢ a[j] = b[j]

tactic: subst heq
state_before: case inr
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
i : Nat
hi : i ≤ size a
heqv : isEqvAux a b hsz (fun x y => decide (x = y)) i = true
j : Nat
low : i ≤ j
high : j < size a
h : ¬i < size a
heq : i = size a
⊢ a[j] = b[j]

tactic: exact absurd (Nat.lt_of_lt_of_le high low) (Nat.lt_irrefl j)
state_before: case inr
α : Type u_1
inst✝ : DecidableEq α
a b : Array α
hsz : size a = size b
j : Nat
high : j < size a
hi : size a ≤ size a
heqv : isEqvAux a b hsz (fun x y => decide (x = y)) (size a) = true
low : size a ≤ j
h : ¬size a < size a
⊢ a[j] = b[j]