internlm/Lean-Github huggingface dataset:
Theorem: project.deleteMin_non_empty
Proof state before:
case a.a
α : 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsHeapForest' t₁.rank (bt :: ts)
Tactic:
. cases h₁
  rw[← heqh.left, ← heqh.right]
  assumption
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsHeap (Heap.heap ts₃)
Tactic:
rw[← heq₄]
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsHeap (findMin le ts (1 + 1) (bt, 1)).fst.children
Theorem: project.deleteMin_non_empty
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsHeap (findMin le ts (1 + 1) (bt, 1)).fst.children
Tactic:
apply children_IsHeap
Proof state after:
case a
α : 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsHeap (Heap.heap [(findMin le ts (1 + 1) (bt, 1)).fst])
Theorem: project.deleteMin_non_empty
Proof state before:
case a.a
α : 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsHeapForest' (findMin le ts (1 + 1) (bt, 1)).fst.rank []
Tactic:
. constructor
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
heqh : Heap.heap (h :: hs) = Heap.heap (t₁ :: bt :: ts)
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
⊢ IsBinTree (findMin le ts (1 + 1) (bt, 1)).fst
Tactic:
simp at heqh
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsBinTree (findMin le ts (1 + 1) (bt, 1)).fst
Theorem: project.deleteMin_non_empty
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsBinTree (findMin le ts (1 + 1) (bt, 1)).fst
Tactic:
rw[heqh.right] at h₁
Proof 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 α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h₁ : IsHeap (Heap.heap (h :: bt :: ts))
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsBinTree (findMin le ts (1 + 1) (bt, 1)).fst
Theorem: project.deleteMin_non_empty
Proof 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 α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h₁ : IsHeap (Heap.heap (h :: bt :: ts))
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsBinTree (findMin le ts (1 + 1) (bt, 1)).fst
Tactic:
apply IsBinTree_findMin <;>
  cases h₁ with | cons _ _ hf =>
  cases hf
  assumption
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof state before:
case a.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝¹ : IsBinTree h
a✝ : 0 < h.rank
hf : IsHeapForest' h.rank (bt :: ts)
⊢ IsBinTree bt
Tactic:
cases hf
Proof state after:
case a.cons.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝⁴ : IsBinTree h
a✝³ : 0 < h.rank
a✝² : IsBinTree bt
a✝¹ : h.rank < bt.rank
a✝ : IsHeapForest' bt.rank ts
⊢ IsBinTree bt
Theorem: project.deleteMin_non_empty
Proof state before:
case a.cons.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝⁴ : IsBinTree h
a✝³ : 0 < h.rank
a✝² : IsBinTree bt
a✝¹ : h.rank < bt.rank
a✝ : IsHeapForest' bt.rank ts
⊢ IsBinTree bt
Tactic:
assumption
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof state before:
case a.a.a.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝¹ : IsBinTree h
a✝ : 0 < h.rank
hf : IsHeapForest' h.rank (bt :: ts)
⊢ IsBinTree bt
Tactic:
cases hf
Proof state after:
case a.a.a.cons.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝⁴ : IsBinTree h
a✝³ : 0 < h.rank
a✝² : IsBinTree bt
a✝¹ : h.rank < bt.rank
a✝ : IsHeapForest' bt.rank ts
⊢ IsBinTree bt
Theorem: project.deleteMin_non_empty
Proof state before:
case a.a.a.cons.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
xs : Heap α
y : α
ys : Heap α
h : HeapNodeAux α (Heap α)
hs : List (HeapNodeAux α (Heap α))
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeap (Heap.heap ts₂)
heqh : h = t₁ ∧ hs = bt :: ts
a✝⁴ : IsBinTree h
a✝³ : 0 < h.rank
a✝² : IsBinTree bt
a✝¹ : h.rank < bt.rank
a✝ : IsHeapForest' bt.rank ts
⊢ IsBinTree bt
Tactic:
assumption
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof state before:
α : 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₁ : IsHeapForest' 0 (h :: hs)
h₂ : IsMinHeap le (Heap.heap (h :: hs))
xs₂ : Heap α
t₁ : HeapNodeAux α (Heap α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
ihts₂ : IsHeapForest' 0 ts₂
h₂₄ : IsHeapForest' 0 ts₃
not_le_le : ∀ (x y : α), le x y = false → le y x = true
heq✝ : t₁ = h'✝ ∧ 0 = idx'✝
hne₂ : True
heqh : h = t₁ ∧ hs = bt :: ts
h✝ : le h'✝.val bt.val = false
heq₃ : List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd = ts₂
⊢ 0 = min 0 0
Tactic:
simp
Proof state after:
no goals
Theorem: project.deleteMin_non_empty
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsMinHeap le (Heap.heap ts₂)
Tactic:
rw[← heq₃]
Proof 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 α
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 α)
x✝⁴ : List (BinTree α)
x✝³ : ℕ
x✝² : BinTree α × ℕ
bt : BinTree α
ts : List (BinTree α)
h'✝ : BinTree α
idx'✝ : ℕ
heq✝ : (t₁, 0) = (h'✝, idx'✝)
hne₂ : bt :: ts = [] → False
h✝ : ¬le h'✝.val bt.val = true
left✝ : (findMin le ts (1 + 1) (bt, 1)).fst.val = y
x✝¹ x✝ : Heap α
ts₂ ts₃ : List (HeapNodeAux α (Heap α))
heq₃ : Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd) = Heap.heap ts₂
heq₄ : (findMin le ts (1 + 1) (bt, 1)).fst.children = Heap.heap ts₃
heq : Heap.heap (mergeNodes le ts₂ ts₃) = ys
heqh : h = t₁ ∧ hs = bt :: ts
⊢ IsMinHeap le (Heap.heap (List.eraseIdx (t₁ :: bt :: ts) (findMin le ts (1 + 1) (bt, 1)).snd))