Theorem: Batteries.BinomialHeap.Imp.Heap.realSize_deleteMin
File: .lake/packages/batteries/Batteries/Data/BinomialHeap/Basic.lean

Proof steps:
state_before: α : Type u_1
le : α → α → Bool
a : α
s' s : Heap α
eq : deleteMin le s = some (a, s')
⊢ s.realSize = s'.realSize + 1
state_after: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
⊢ (cons r a c s).realSize =
    (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
          ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
            (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
      1
tactic: cases s with cases eq | cons r a c s => ?_
state_before: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
⊢ (cons r a c s).realSize =
    (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
          ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
            (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
      1
state_after: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
this :
  Batteries.BinomialHeap.Imp.FindMin.HasSize
    (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }) (c.realSize + s.realSize + 1)
⊢ (cons r a c s).realSize =
    (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
          ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
            (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
      1
tactic: have : (s.findMin le (cons r a c) ⟨id, a, c, s⟩).HasSize (c.realSize + s.realSize + 1) :=
    Heap.realSize_findMin (c.realSize + 1) (by simp) (Nat.add_right_comm ..) ⟨0, by simp⟩
state_before: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
this :
  Batteries.BinomialHeap.Imp.FindMin.HasSize
    (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }) (c.realSize + s.realSize + 1)
⊢ (cons r a c s).realSize =
    (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
          ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
            (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
      1
state_after: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
⊢ Batteries.BinomialHeap.Imp.FindMin.HasSize
      (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }) (c.realSize + s.realSize + 1) →
    (cons r a c s).realSize =
      (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
            ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
              (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
        1
tactic: revert this
state_before: case cons.refl
α : Type u_1
le : α → α → Bool
r : Nat
a : α
c : HeapNode α
s : Heap α
⊢ Batteries.BinomialHeap.Imp.FindMin.HasSize
      (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }) (c.realSize + s.realSize + 1) →
    (cons r a c s).realSize =
      (merge le (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).node.toHeap
            ((findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).before
              (findMin le (cons r a c) s { before := id, val := a, node := c, next := s }).next)).realSize +
        1
state_after: no goals
tactic: match s.findMin le (cons r a c) ⟨id, a, c, s⟩ with
  | { before, val, node, next } =>
    intro ⟨m, ih₁, ih₂⟩; dsimp only at ih₁ ih₂
    rw [realSize, Nat.add_right_comm, ih₂]
    simp only [realSize_merge, HeapNode.realSize_toHeap, ih₁, Nat.add_assoc, Nat.add_left_comm]