Theorem: project.deleteMin_empty_heap (Project/DeleteMin.lean)

State before:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
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 α
⊢ deleteMin le xs = none → isEmpty xs = true
Tactic:
intro heq
State after:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
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 α
heq : deleteMin le xs = none
⊢ isEmpty xs = true

State before:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
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 α
heq : deleteMin le xs = none
⊢ isEmpty xs = true
Tactic:
unfold deleteMin at heq
State after:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
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 α
heq :
  (match xs with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      match findMin le hs 1 (h, 0) with
      | (min, minIdx) =>
        let rest := List.eraseIdx hhs minIdx;
        let tail := merge le (Heap.heap rest) min.children;
        some (min.val, tail)) =
    none
⊢ isEmpty xs = true

State before:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
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 α
heq :
  (match xs with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      match findMin le hs 1 (h, 0) with
      | (min, minIdx) =>
        let rest := List.eraseIdx hhs minIdx;
        let tail := merge le (Heap.heap rest) min.children;
        some (min.val, tail)) =
    none
⊢ isEmpty xs = true
Tactic:
cases xs with | heap ts =>
cases ts with 
| nil =>
  rfl
| cons _ ts =>
  dsimp at heq
  cases ts <;> contradiction
State after:
no goals

State before:
case heap
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
ts : List (HeapNodeAux α (Heap α))
heq :
  (match Heap.heap ts with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      match findMin le hs 1 (h, 0) with
      | (min, minIdx) =>
        let rest := List.eraseIdx hhs minIdx;
        let tail := merge le (Heap.heap rest) min.children;
        some (min.val, tail)) =
    none
⊢ isEmpty (Heap.heap ts) = true
Tactic:
cases ts with 
| nil =>
  rfl
| cons _ ts =>
  dsimp at heq
  cases ts <;> contradiction
State after:
no goals

State before:
case heap.nil
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
heq :
  (match Heap.heap [] with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      match findMin le hs 1 (h, 0) with
      | (min, minIdx) =>
        let rest := List.eraseIdx hhs minIdx;
        let tail := merge le (Heap.heap rest) min.children;
        some (min.val, tail)) =
    none
⊢ isEmpty (Heap.heap []) = true
Tactic:
rfl
State after:
no goals

State before:
case heap.cons
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
head✝ : HeapNodeAux α (Heap α)
ts : List (HeapNodeAux α (Heap α))
heq :
  (match Heap.heap (head✝ :: ts) with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      match findMin le hs 1 (h, 0) with
      | (min, minIdx) =>
        let rest := List.eraseIdx hhs minIdx;
        let tail := merge le (Heap.heap rest) min.children;
        some (min.val, tail)) =
    none
⊢ isEmpty (Heap.heap (head✝ :: ts)) = true
Tactic:
dsimp at heq
State after:
case heap.cons
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
head✝ : HeapNodeAux α (Heap α)
ts : List (HeapNodeAux α (Heap α))
heq :
  (match Heap.heap (head✝ :: ts) with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      some
        ((findMin le hs 1 (h, 0)).fst.val,
          merge le (Heap.heap (List.eraseIdx hhs (findMin le hs 1 (h, 0)).snd))
            (findMin le hs 1 (h, 0)).fst.children)) =
    none
⊢ isEmpty (Heap.heap (head✝ :: ts)) = true

State before:
case heap.cons
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
le_trans : ∀ (x y z : α), le x y = true → le y z = true → le x z = true
le_rfl : ∀ (z : α), le z z = true
head✝ : HeapNodeAux α (Heap α)
ts : List (HeapNodeAux α (Heap α))
heq :
  (match Heap.heap (head✝ :: ts) with
    | Heap.heap [] => none
    | Heap.heap [h] => some (h.val, h.children)
    | Heap.heap hhs@h_1:(h :: hs) =>
      some
        ((findMin le hs 1 (h, 0)).fst.val,
          merge le (Heap.heap (List.eraseIdx hhs (findMin le hs 1 (h, 0)).snd))
            (findMin le hs 1 (h, 0)).fst.children)) =
    none
⊢ isEmpty (Heap.heap (head✝ :: ts)) = true
Tactic:
cases ts <;> contradiction
State after:
no goals