Theorem: project.deleteMin_non_empty
Proof state before:
case h_1
α : Type u_1
le : α → α → Bool
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₁ : IsHeap (Heap.heap (h :: hs))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
ts : List (BinTree α)
n : ℕ
btxn : BinTree α × ℕ
bt : BinTree α
ts₂ : List (BinTree α)
bt₂ : BinTree α
n₂ : ℕ
lebt : le bt₂.val bt.val = true
not_le_le : ∀ (x y : α), le x y = false → le y x = true
eqeq : t₁ = bt₂ ∧ 0 = n₂
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts₂
dmeq :
  (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.val = y ∧
    merge le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts₂) (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd))
        (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children =
      ys
ys₂ xs₃ : Heap α
ts₃ ts₄ : List (HeapNodeAux α (Heap α))
heq₂ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children = Heap.heap ts₄
x✝¹ : List (HeapNodeAux α (Heap α))
x✝ : ℕ
heq✝ : t₁ :: bt :: ts₂ = []
heq : [] = ts₃
⊢ IsHeap (Heap.heap ts₃)

case h_2
α : Type u_1
le : α → α → Bool
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₁ : IsHeap (Heap.heap (h :: hs))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
ts : List (BinTree α)
n : ℕ
btxn : BinTree α × ℕ
bt : BinTree α
ts₂ : List (BinTree α)
bt₂ : BinTree α
n₂ : ℕ
lebt : le bt₂.val bt.val = true
not_le_le : ∀ (x y : α), le x y = false → le y x = true
eqeq : t₁ = bt₂ ∧ 0 = n₂
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts₂
dmeq :
  (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.val = y ∧
    merge le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts₂) (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd))
        (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children =
      ys
ys₂ xs₃ : Heap α
ts₃ ts₄ : List (HeapNodeAux α (Heap α))
heq₂ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children = Heap.heap ts₄
x✝¹ : List (HeapNodeAux α (Heap α))
x✝ : ℕ
head✝ : HeapNodeAux α (Heap α)
as✝ : List (HeapNodeAux α (Heap α))
heq✝¹ : t₁ :: bt :: ts₂ = head✝ :: as✝
heq✝ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd = 0
heq : as✝ = ts₃
⊢ IsHeap (Heap.heap ts₃)

case h_3
α : Type u_1
le : α → α → Bool
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₁ : IsHeap (Heap.heap (h :: hs))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
ts : List (BinTree α)
n : ℕ
btxn : BinTree α × ℕ
bt : BinTree α
ts₂ : List (BinTree α)
bt₂ : BinTree α
n₂ : ℕ
lebt : le bt₂.val bt.val = true
not_le_le : ∀ (x y : α), le x y = false → le y x = true
eqeq : t₁ = bt₂ ∧ 0 = n₂
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts₂
dmeq :
  (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.val = y ∧
    merge le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts₂) (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd))
        (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children =
      ys
ys₂ xs₃ : Heap α
ts₃ ts₄ : List (HeapNodeAux α (Heap α))
heq₂ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children = Heap.heap ts₄
x✝¹ : List (HeapNodeAux α (Heap α))
x✝ : ℕ
a✝ : HeapNodeAux α (Heap α)
as✝ : List (HeapNodeAux α (Heap α))
n✝ : ℕ
heq✝¹ : t₁ :: bt :: ts₂ = a✝ :: as✝
heq✝ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd = Nat.succ n✝
heq : a✝ :: List.eraseIdx as✝ n✝ = ts₃
⊢ IsHeap (Heap.heap ts₃)
Tactic:
. simp_all
Proof state after:
case h_2
α : Type u_1
le : α → α → Bool
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₁ : IsHeap (Heap.heap (h :: hs))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
ts : List (BinTree α)
n : ℕ
btxn : BinTree α × ℕ
bt : BinTree α
ts₂ : List (BinTree α)
bt₂ : BinTree α
n₂ : ℕ
lebt : le bt₂.val bt.val = true
not_le_le : ∀ (x y : α), le x y = false → le y x = true
eqeq : t₁ = bt₂ ∧ 0 = n₂
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts₂
dmeq :
  (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.val = y ∧
    merge le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts₂) (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd))
        (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children =
      ys
ys₂ xs₃ : Heap α
ts₃ ts₄ : List (HeapNodeAux α (Heap α))
heq₂ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children = Heap.heap ts₄
x✝¹ : List (HeapNodeAux α (Heap α))
x✝ : ℕ
head✝ : HeapNodeAux α (Heap α)
as✝ : List (HeapNodeAux α (Heap α))
heq✝¹ : t₁ :: bt :: ts₂ = head✝ :: as✝
heq✝ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd = 0
heq : as✝ = ts₃
⊢ IsHeap (Heap.heap ts₃)

case h_3
α : Type u_1
le : α → α → Bool
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₁ : IsHeap (Heap.heap (h :: hs))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
ts : List (BinTree α)
n : ℕ
btxn : BinTree α × ℕ
bt : BinTree α
ts₂ : List (BinTree α)
bt₂ : BinTree α
n₂ : ℕ
lebt : le bt₂.val bt.val = true
not_le_le : ∀ (x y : α), le x y = false → le y x = true
eqeq : t₁ = bt₂ ∧ 0 = n₂
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts₂
dmeq :
  (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.val = y ∧
    merge le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts₂) (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd))
        (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children =
      ys
ys₂ xs₃ : Heap α
ts₃ ts₄ : List (HeapNodeAux α (Heap α))
heq₂ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).fst.children = Heap.heap ts₄
x✝¹ : List (HeapNodeAux α (Heap α))
x✝ : ℕ
a✝ : HeapNodeAux α (Heap α)
as✝ : List (HeapNodeAux α (Heap α))
n✝ : ℕ
heq✝¹ : t₁ :: bt :: ts₂ = a✝ :: as✝
heq✝ : (findMin le ts₂ (1 + 1) (bt₂, n₂)).snd = Nat.succ n✝
heq : a✝ :: List.eraseIdx as✝ n✝ = ts₃
⊢ IsHeap (Heap.heap ts₃)