Theorem: project.empty_heap_merge_right (Project/Merge.lean)

State before:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
h : List (BinTree α)
⊢ mergeNodes le h [] = h
Tactic:
unfold mergeNodes
State after:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
h : List (BinTree α)
⊢ (match h, [] with
    | [], h => h
    | h, [] => h
    | f@h:(h₁ :: t₁), s@h_1:(h₂ :: t₂) =>
      if h₁.rank < h₂.rank then h₁ :: mergeNodes le t₁ s
      else
        if h₂.rank < h₁.rank then h₂ :: mergeNodes le t₂ f
        else
          let merged := combine le h₁ h₂;
          let r := merged.rank;
          if (r != hRank t₁) = true then
            if (r != hRank t₂) = true then merged :: mergeNodes le t₁ t₂ else mergeNodes le (merged :: t₁) t₂
          else if (r != hRank t₂) = true then mergeNodes le t₁ (merged :: t₂) else merged :: mergeNodes le t₁ t₂) =
    h

State before:
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
h : List (BinTree α)
⊢ (match h, [] with
    | [], h => h
    | h, [] => h
    | f@h:(h₁ :: t₁), s@h_1:(h₂ :: t₂) =>
      if h₁.rank < h₂.rank then h₁ :: mergeNodes le t₁ s
      else
        if h₂.rank < h₁.rank then h₂ :: mergeNodes le t₂ f
        else
          let merged := combine le h₁ h₂;
          let r := merged.rank;
          if (r != hRank t₁) = true then
            if (r != hRank t₂) = true then merged :: mergeNodes le t₁ t₂ else mergeNodes le (merged :: t₁) t₂
          else if (r != hRank t₂) = true then mergeNodes le t₁ (merged :: t₂) else merged :: mergeNodes le t₁ t₂) =
    h
Tactic:
split
State after:
case h_1
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
⊢ [] = []

case h_2
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝³ x✝² x✝¹ : List (BinTree α)
x✝ : x✝³ = [] → False
heq✝ : [] = []
⊢ x✝³ = x✝³

case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝

State before:
case h_1
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
⊢ [] = []

case h_2
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝³ x✝² x✝¹ : List (BinTree α)
x✝ : x✝³ = [] → False
heq✝ : [] = []
⊢ x✝³ = x✝³

case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝
Tactic:
. rfl
State after:
case h_2
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝³ x✝² x✝¹ : List (BinTree α)
x✝ : x✝³ = [] → False
heq✝ : [] = []
⊢ x✝³ = x✝³

case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝

State before:
case h_2
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝³ x✝² x✝¹ : List (BinTree α)
x✝ : x✝³ = [] → False
heq✝ : [] = []
⊢ x✝³ = x✝³

case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝
Tactic:
. rfl
State after:
case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝

State before:
case h_3
α : Type u_1
le : α → α → Bool
not_le_le : ∀ (x y : α), ¬le x y = true → le y x = true
x✝¹ x✝ : List (BinTree α)
h₁✝ : BinTree α
t₁✝ : List (BinTree α)
h₂✝ : BinTree α
t₂✝ : List (BinTree α)
heq✝ : [] = h₂✝ :: t₂✝
⊢ (if h₁✝.rank < h₂✝.rank then h₁✝ :: mergeNodes le t₁✝ (h₂✝ :: t₂✝)
    else
      if h₂✝.rank < h₁✝.rank then h₂✝ :: mergeNodes le t₂✝ (h₁✝ :: t₁✝)
      else
        let merged := combine le h₁✝ h₂✝;
        let r := merged.rank;
        if (r != hRank t₁✝) = true then
          if (r != hRank t₂✝) = true then merged :: mergeNodes le t₁✝ t₂✝ else mergeNodes le (merged :: t₁✝) t₂✝
        else if (r != hRank t₂✝) = true then mergeNodes le t₁✝ (merged :: t₂✝) else merged :: mergeNodes le t₁✝ t₂✝) =
    h₁✝ :: t₁✝
Tactic:
. rename_i heq
  cases heq
State after:
no goals