url
stringclasses
147 values
commit
stringclasses
147 values
file_path
stringlengths
7
101
full_name
stringlengths
1
94
start
stringlengths
6
10
end
stringlengths
6
11
tactic
stringlengths
1
11.2k
state_before
stringlengths
3
2.09M
state_after
stringlengths
6
2.09M
input
stringlengths
73
2.09M
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
contrapose! h
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = head? c
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
exact ⟨head c (ToMultiset.not_isEmpty_of_mem hx), MinHeap.head_mem _ _, pc, by intro h'; simp [← h'] at h, fun h' ↦ (h'.trans_le (head_le c _ hx)).ne rfl⟩
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
intro h'
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ head c ⋯ ≠ x
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ head c ⋯ ≠ x TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
simp [← h'] at h
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.eq_head_of_forall_le
[83, 1]
[87, 57]
apply WithTop.coe_injective
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ x = head c hc
case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ x = head c hc TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.eq_head_of_forall_le
[83, 1]
[87, 57]
simpa using coe_eq_head?_of_forall_le c p hc pc x hx h
case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc) TACTIC:...
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
by_cases hc : isEmpty c
C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMulti...
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
simp [head?_eq_top c hc, hc]
case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
no goals
Please generate a tactic in lean4 to solve the state. STATE: case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
apply le_antisymm
case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c...
Please generate a tactic in lean4 to solve the state. STATE: case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
have := head?_le c
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
aesop
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
no goals
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
have := head?_mem_toMultiset_map c hc
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
apply Multiset.inf_le
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c)
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
aesop
case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/Size.lean
isEmpty_eq_decide_size
[31, 1]
[32, 58]
simp only [← isEmpty_iff_size_eq_zero, Bool.decide_coe]
C : Type u_1 α : Type ?u.565 inst✝ : Size C c : C ⊢ isEmpty c = decide (size c = 0)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type ?u.565 inst✝ : Size C c : C ⊢ isEmpty c = decide (size c = 0) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/Size.lean
isEmpty_eq_size_beq_zero
[34, 1]
[36, 23]
rw [isEmpty_eq_decide_size]
C : Type u_1 α : Type ?u.736 inst✝ : Size C c : C ⊢ isEmpty c = (size c == 0)
C : Type u_1 α : Type ?u.736 inst✝ : Size C c : C ⊢ decide (size c = 0) = (size c == 0)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type ?u.736 inst✝ : Size C c : C ⊢ isEmpty c = (size c == 0) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/Size.lean
isEmpty_eq_size_beq_zero
[34, 1]
[36, 23]
cases size c <;> rfl
C : Type u_1 α : Type ?u.736 inst✝ : Size C c : C ⊢ decide (size c = 0) = (size c == 0)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type ?u.736 inst✝ : Size C c : C ⊢ decide (size c = 0) = (size c == 0) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.head?_isSome
[18, 1]
[19, 38]
simp
C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).head?.isSome = true ↔ head✝ :: tail✝ ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).head?.isSome = true ↔ head✝ :: tail✝ ≠ [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.tail?_isSome
[21, 1]
[22, 38]
simp
C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).tail?.isSome = true ↔ head✝ :: tail✝ ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).tail?.isSome = true ↔ head✝ :: tail✝ ≠ [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_eq_decide_eq_nil
[35, 1]
[36, 29]
cases l <;> simp [isEmpty]
C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l = [])
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l = []) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_eq_decide_length
[38, 1]
[39, 29]
cases l <;> simp [isEmpty]
C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l.length = 0)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l.length = 0) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_reverse
[41, 1]
[43, 33]
rw [isEmpty_eq_decide_eq_nil, isEmpty_eq_decide_eq_nil]
C : Type u_1 α : Type u_2 l : List α ⊢ l.reverse.isEmpty = l.isEmpty
C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = [])
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.reverse.isEmpty = l.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_reverse
[41, 1]
[43, 33]
simp only [reverse_eq_nil_iff]
C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = [])
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = []) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.reverse_dropLast
[45, 1]
[50, 38]
rw [dropLast, reverse_cons x, reverse_cons x, reverse_dropLast (_::_), tail_append_of_ne_nil] <;> simp
C : Type u_1 α : Type u_2 l✝ l : List α x head✝ : α tail✝ : List α ⊢ (x :: head✝ :: tail✝).dropLast.reverse = (x :: head✝ :: tail✝).reverse.tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l✝ l : List α x head✝ : α tail✝ : List α ⊢ (x :: head✝ :: tail✝).dropLast.reverse = (x :: head✝ :: tail✝).reverse.tail TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.back?_toArray
[52, 1]
[55, 7]
rw [Array.back?, Array.get?_eq_data_get?, getLast?_eq_get?]
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).back? = l.getLast?
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).back? = l.getLast? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.back?_toArray
[52, 1]
[55, 7]
simp
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_data
[62, 1]
[63, 46]
rw [List.isEmpty_eq_decide_length, isEmpty]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.isEmpty = a.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_toList
[65, 1]
[66, 31]
rw [isEmpty_data, toList_eq]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.isEmpty = a.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_toListRev
[68, 1]
[69, 56]
rw [toListRev_eq, List.isEmpty_reverse, isEmpty_data]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.isEmpty = a.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.toList_length
[71, 1]
[72, 30]
rw [toList_eq, data_length]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.length = a.size
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.length = a.size TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.get?_data
[74, 1]
[77, 31]
ext i
C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.get? = a.get?
case h.a C : Type u_1 α : Type u_2 a : Array α i : ℕ a✝ : α ⊢ a✝ ∈ a.data.get? i ↔ a✝ ∈ a.get? i
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.get? = a.get? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.get?_data
[74, 1]
[77, 31]
rw [Array.get?_eq_data_get?]
case h.a C : Type u_1 α : Type u_2 a : Array α i : ℕ a✝ : α ⊢ a✝ ∈ a.data.get? i ↔ a✝ ∈ a.get? i
no goals
Please generate a tactic in lean4 to solve the state. STATE: case h.a C : Type u_1 α : Type u_2 a : Array α i : ℕ a✝ : α ⊢ a✝ ∈ a.data.get? i ↔ a✝ ∈ a.get? i TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.get?_toList
[79, 1]
[80, 28]
rw [toList_eq, get?_data]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.get? = a.get?
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.get? = a.get? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.get?_toListRev
[82, 1]
[84, 75]
rw [toListRev_eq, List.get?_reverse _ (by rwa [data_length]), get?_data]
C : Type u_1 α : Type u_2 a : Array α i : ℕ h : i < a.size ⊢ a.toListRev.get? i = a.get? (a.size - 1 - i)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α i : ℕ h : i < a.size ⊢ a.toListRev.get? i = a.get? (a.size - 1 - i) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.get?_toListRev
[82, 1]
[84, 75]
rwa [data_length]
C : Type u_1 α : Type u_2 a : Array α i : ℕ h : i < a.size ⊢ i < a.data.length
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α i : ℕ h : i < a.size ⊢ i < a.data.length TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
cases a.size.eq_zero_or_pos
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.head? = a.back?
case inl C : Type u_1 α : Type u_2 a : Array α h✝ : a.size = 0 ⊢ a.toListRev.head? = a.back? case inr C : Type u_1 α : Type u_2 a : Array α h✝ : a.size > 0 ⊢ a.toListRev.head? = a.back?
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.head? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
case inl h => rw [toListRev_eq, back?, ← get?_data] simp [List.length_eq_zero.mp h]
C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.toListRev.head? = a.back?
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.toListRev.head? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
case inr h => rw [← List.get?_zero, get?_toListRev _ _ h, Nat.sub_zero] rfl
C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.toListRev.head? = a.back?
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.toListRev.head? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
rw [toListRev_eq, back?, ← get?_data]
C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.toListRev.head? = a.back?
C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.data.reverse.head? = a.data.get? (a.size - 1)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.toListRev.head? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
simp [List.length_eq_zero.mp h]
C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.data.reverse.head? = a.data.get? (a.size - 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size = 0 ⊢ a.data.reverse.head? = a.data.get? (a.size - 1) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
rw [← List.get?_zero, get?_toListRev _ _ h, Nat.sub_zero]
C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.toListRev.head? = a.back?
C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.get? (a.size - 1) = a.back?
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.toListRev.head? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.head?_toListRev
[86, 1]
[93, 8]
rfl
C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.get? (a.size - 1) = a.back?
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α h : a.size > 0 ⊢ a.get? (a.size - 1) = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.getLast?_toList
[95, 1]
[97, 7]
rw [back?, get?_eq_data_get?, List.getLast?_eq_get?]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.getLast? = a.back?
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.get? (a.toList.length - 1) = a.data.get? (a.size - 1)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.getLast? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.getLast?_toList
[95, 1]
[97, 7]
simp
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.get? (a.toList.length - 1) = a.data.get? (a.size - 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.get? (a.toList.length - 1) = a.data.get? (a.size - 1) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.getLast?_data
[99, 1]
[101, 27]
simp [← getLast?_toList]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.getLast? = a.back?
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.getLast? = a.back? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.dropLast_toList
[103, 1]
[104, 7]
simp
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.dropLast = a.pop.toList
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.dropLast = a.pop.toList TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
ToList.lawfulEmptyCollection_iff
[127, 1]
[130, 20]
rw [ToMultiset.lawfulEmptyCollection_iff]
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C ⊢ LawfulEmptyCollection C α ↔ toList ∅ = []
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toList ∅ = []
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C ⊢ LawfulEmptyCollection C α ↔ toList ∅ = [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
ToList.lawfulEmptyCollection_iff
[127, 1]
[130, 20]
simp [toMultiset]
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toList ∅ = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toList ∅ = [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
toList_empty
[134, 1]
[137, 49]
rwa [ToList.lawfulEmptyCollection_iff] at inst
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C inst : LawfulEmptyCollection C α ⊢ toList ∅ = []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : EmptyCollection C inst : LawfulEmptyCollection C α ⊢ toList ∅ = [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
size_eq_size_toArray
[143, 1]
[144, 31]
simp [size_eq_length_toList]
C : Type u_1 α : Type u_2 inst✝ : ToList C α c : C ⊢ size c = (toArray c).size
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝ : ToList C α c : C ⊢ size c = (toArray c).size TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
isEmpty_toList
[155, 1]
[156, 84]
rw [isEmpty_eq_decide_size, List.isEmpty_eq_decide_length, size_eq_length_toList]
C : Type u_1 α : Type u_2 inst✝ : ToList C α c : C ⊢ (toList c).isEmpty = isEmpty c
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝ : ToList C α c : C ⊢ (toList c).isEmpty = isEmpty c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
front?_isSome
[179, 1]
[181, 85]
rwa [front?_def, List.head?_isSome, ← List.not_isEmpty_iff_ne_nil, isEmpty_toList]
C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : Front C α c : C h : ¬isEmpty c = true ⊢ (front? c).isSome = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : Front C α c : C h : ¬isEmpty c = true ⊢ (front? c).isSome = true TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
front_def
[183, 1]
[186, 64]
simpa using (front_mem c h).symm
C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : Front C α c : C h : ¬isEmpty c = true ⊢ some (front c h) = some ((front? c).get ⋯)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : Front C α c : C h : ¬isEmpty c = true ⊢ some (front c h) = some ((front? c).get ⋯) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
back?_isSome
[202, 1]
[204, 87]
rwa [back?_def, List.getLast?_isSome, ← List.not_isEmpty_iff_ne_nil, isEmpty_toList]
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : Back C α c : C h : ¬isEmpty c = true ⊢ (back? c).isSome = true
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : Back C α c : C h : ¬isEmpty c = true ⊢ (back? c).isSome = true TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
back_def
[206, 1]
[209, 63]
simpa using (back_mem c h).symm
C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : Back C α c : C h : ¬isEmpty c = true ⊢ some (back c h) = some ((back? c).get ⋯)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : ToList C α inst✝ : Back C α c : C h : ¬isEmpty c = true ⊢ some (back c h) = some ((back? c).get ⋯) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
ToList.RandomAccess.get_toArray
[258, 1]
[260, 31]
rw [get_eq_get_toArray]
C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : RandomAccess C α c : C i : Fin (toArray c).size ⊢ (toArray c).get i = get c (Fin.cast ⋯ i)
C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : RandomAccess C α c : C i : Fin (toArray c).size ⊢ (toArray c).get i = (toArray c).get (Fin.cast ⋯ (Fin.cast ⋯ i))
Please generate a tactic in lean4 to solve the state. STATE: C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : RandomAccess C α c : C i : Fin (toArray c).size ⊢ (toArray c).get i = get c (Fin.cast ⋯ i) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
ToList.RandomAccess.get_toArray
[258, 1]
[260, 31]
rfl
C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : RandomAccess C α c : C i : Fin (toArray c).size ⊢ (toArray c).get i = (toArray c).get (Fin.cast ⋯ (Fin.cast ⋯ i))
no goals
Please generate a tactic in lean4 to solve the state. STATE: C✝ : Type u_1 α✝ : Type u_2 C : Type u_3 α : Type u_4 inst✝¹ : ToList C α inst✝ : RandomAccess C α c : C i : Fin (toArray c).size ⊢ (toArray c).get i = (toArray c).get (Fin.cast ⋯ (Fin.cast ⋯ i)) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
Multiset.inf_eq_top
[13, 1]
[15, 7]
rw [le_antisymm_iff]
α : Type u_1 inst✝¹ : SemilatticeInf α inst✝ : OrderTop α m : Multiset α ⊢ m.inf = ⊤ ↔ ∀ a ∈ m, a = ⊤
α : Type u_1 inst✝¹ : SemilatticeInf α inst✝ : OrderTop α m : Multiset α ⊢ m.inf ≤ ⊤ ∧ ⊤ ≤ m.inf ↔ ∀ a ∈ m, a = ⊤
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝¹ : SemilatticeInf α inst✝ : OrderTop α m : Multiset α ⊢ m.inf = ⊤ ↔ ∀ a ∈ m, a = ⊤ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
Multiset.inf_eq_top
[13, 1]
[15, 7]
simp
α : Type u_1 inst✝¹ : SemilatticeInf α inst✝ : OrderTop α m : Multiset α ⊢ m.inf ≤ ⊤ ∧ ⊤ ≤ m.inf ↔ ∀ a ∈ m, a = ⊤
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 inst✝¹ : SemilatticeInf α inst✝ : OrderTop α m : Multiset α ⊢ m.inf ≤ ⊤ ∧ ⊤ ≤ m.inf ↔ ∀ a ∈ m, a = ⊤ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_ne_top
[52, 1]
[56, 15]
intro hc
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head? c ≠ ⊤
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head? c ≠ ⊤ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_ne_top
[52, 1]
[56, 15]
have := hc ▸ (head?_mem_toMultiset_map c h)
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ ⊢ False
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ this : ⊤ ∈ Multiset.map WithTop.some (toMultiset c) ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ ⊢ False TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_ne_top
[52, 1]
[56, 15]
simp at this
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ this : ⊤ ∈ Multiset.map WithTop.some (toMultiset c) ⊢ False
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true hc : head? c = ⊤ this : ⊤ ∈ Multiset.map WithTop.some (toMultiset c) ⊢ False TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head_def
[58, 1]
[61, 71]
simpa using MinHeap.coe_head_eq_head? c h
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ ↑(head c h) = ↑((head? c).untop ⋯)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ ↑(head c h) = ↑((head? c).untop ⋯) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head_mem_toMultiset
[63, 1]
[66, 20]
obtain ⟨x, hx₁, hx₂⟩ := Multiset.mem_map.mp (head?_mem_toMultiset_map c h)
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head c h ∈ toMultiset c
case intro.intro C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true x : α hx₁ : x ∈ toMultiset c hx₂ : ↑x = head? c ⊢ head c h ∈ toMultiset c
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head c h ∈ toMultiset c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head_mem_toMultiset
[63, 1]
[66, 20]
simp [hx₁, ← hx₂]
case intro.intro C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true x : α hx₁ : x ∈ toMultiset c hx₂ : ↑x = head? c ⊢ head c h ∈ toMultiset c
no goals
Please generate a tactic in lean4 to solve the state. STATE: case intro.intro C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true x : α hx₁ : x ∈ toMultiset c hx₂ : ↑x = head? c ⊢ head c h ∈ toMultiset c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head_mem
[68, 1]
[70, 52]
exact mem_toMultiset.mp (head_mem_toMultiset c h)
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head c h ∈ c
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C h : ¬isEmpty c = true ⊢ head c h ∈ c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head_le
[72, 1]
[74, 53]
simpa [WithTop.untop_le_iff] using head?_le c x hx
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C x : α hx : x ∈ c ⊢ head c ⋯ ≤ x
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C x : α hx : x ∈ c ⊢ head c ⋯ ≤ x TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
contrapose! h
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = head? c
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
exact ⟨head c (ToMultiset.not_isEmpty_of_mem hx), MinHeap.head_mem _ _, pc, by intro h'; simp [← h'] at h, fun h' ↦ (h'.trans_le (head_le c _ hx)).ne rfl⟩
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ ∃ y ∈ c, p y ∧ y ≠ x ∧ ¬x < y TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
intro h'
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ head c ⋯ ≠ x
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c ⊢ head c ⋯ ≠ x TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.coe_eq_head?_of_forall_le
[76, 1]
[81, 52]
simp [← h'] at h
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ↑x ≠ head? c h' : head c ⋯ = x ⊢ False TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.eq_head_of_forall_le
[83, 1]
[87, 57]
apply WithTop.coe_injective
C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ x = head c hc
case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ x = head c hc TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.eq_head_of_forall_le
[83, 1]
[87, 57]
simpa using coe_eq_head?_of_forall_le c p hc pc x hx h
case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case a C : Type u_1 α : Type u_2 inst✝² : Preorder α inst✝¹ : IsTotalPreorder α fun x x_1 => x ≤ x_1 inst✝ : MinHeap C α c : C p : α → Prop hc : ¬isEmpty c = true pc : p (head c hc) x : α hx : x ∈ c h : ∀ y ∈ c, p y → y ≠ x → x < y ⊢ ↑x = ↑(head c hc) TACTIC:...
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
by_cases hc : isEmpty c
C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMulti...
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
simp [head?_eq_top c hc, hc]
case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
no goals
Please generate a tactic in lean4 to solve the state. STATE: case pos C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
apply le_antisymm
case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c...
Please generate a tactic in lean4 to solve the state. STATE: case neg C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c = (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
have := head?_le c
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
aesop
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf
no goals
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : ∀ x ∈ c, head? c ≤ ↑x ⊢ head? c ≤ (Multiset.map WithTop.some (toMultiset c)).inf TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
have := head?_mem_toMultiset_map c hc
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
apply Multiset.inf_le
case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c
case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c)
Please generate a tactic in lean4 to solve the state. STATE: case neg.a C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ (Multiset.map WithTop.some (toMultiset c)).inf ≤ head? c TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/MinHeap.lean
MinHeap.head?_def
[95, 1]
[104, 12]
aesop
case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c)
no goals
Please generate a tactic in lean4 to solve the state. STATE: case neg.a.h C : Type u_1 α : Type u_2 inst✝¹ : LinearOrder α inst✝ : MinHeap C α c : C hc : ¬isEmpty c = true this : head? c ∈ Multiset.map WithTop.some (toMultiset c) ⊢ head? c ∈ Multiset.map WithTop.some (toMultiset c) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToFinset.lean
ToFinset.lawfulEmptyCollection_iff
[34, 1]
[38, 7]
rw [ToMultiset.lawfulEmptyCollection_iff]
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ LawfulEmptyCollection C α ↔ toFinset ∅ = ∅
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toFinset ∅ = ∅
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ LawfulEmptyCollection C α ↔ toFinset ∅ = ∅ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToFinset.lean
ToFinset.lawfulEmptyCollection_iff
[34, 1]
[38, 7]
change (toFinset (∅ : C)).val = ∅ ↔ _
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toFinset ∅ = ∅
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ (toFinset ∅).val = ∅ ↔ toFinset ∅ = ∅
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ ToMultiset.toMultiset ∅ = 0 ↔ toFinset ∅ = ∅ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToFinset.lean
ToFinset.lawfulEmptyCollection_iff
[34, 1]
[38, 7]
simp
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ (toFinset ∅).val = ∅ ↔ toFinset ∅ = ∅
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C ⊢ (toFinset ∅).val = ∅ ↔ toFinset ∅ = ∅ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToFinset.lean
toFinset_empty
[42, 1]
[45, 51]
rwa [ToFinset.lawfulEmptyCollection_iff] at inst
α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C inst : LawfulEmptyCollection C α ⊢ toFinset ∅ = ∅
no goals
Please generate a tactic in lean4 to solve the state. STATE: α✝ : Type u_1 C : Type u_2 α : Type u_3 inst✝⁴ : ToFinset C α c : C inst✝³ : EmptyCollection C inst✝² : LawfulEmptyCollection C α inst✝¹ : ToFinset C α inst✝ : EmptyCollection C inst : LawfulEmptyCollection C α ⊢ toFinset ∅ = ∅ TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Forest.lean
Forest.roots_subset_support
[26, 1]
[30, 76]
induction f with | nil => rfl | node a c s _ ihs => exact Set.insert_subset_insert (Set.subset_union_of_subset_right ihs _)
α : Type u_1 f : Forest α ⊢ f.roots ⊆ f.support
no goals
Please generate a tactic in lean4 to solve the state. STATE: α : Type u_1 f : Forest α ⊢ f.roots ⊆ f.support TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Forest.lean
Forest.roots_subset_support
[26, 1]
[30, 76]
rfl
case nil α : Type u_1 ⊢ nil.roots ⊆ nil.support
no goals
Please generate a tactic in lean4 to solve the state. STATE: case nil α : Type u_1 ⊢ nil.roots ⊆ nil.support TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Forest.lean
Forest.roots_subset_support
[26, 1]
[30, 76]
exact Set.insert_subset_insert (Set.subset_union_of_subset_right ihs _)
case node α : Type u_1 a : α c s : Forest α child_ih✝ : c.roots ⊆ c.support ihs : s.roots ⊆ s.support ⊢ (node a c s).roots ⊆ (node a c s).support
no goals
Please generate a tactic in lean4 to solve the state. STATE: case node α : Type u_1 a : α c s : Forest α child_ih✝ : c.roots ⊆ c.support ihs : s.roots ⊆ s.support ⊢ (node a c s).roots ⊆ (node a c s).support TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.head?_isSome
[18, 1]
[19, 38]
simp
C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).head?.isSome = true ↔ head✝ :: tail✝ ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).head?.isSome = true ↔ head✝ :: tail✝ ≠ [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.tail?_isSome
[21, 1]
[22, 38]
simp
C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).tail?.isSome = true ↔ head✝ :: tail✝ ≠ []
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α head✝ : α tail✝ : List α ⊢ (head✝ :: tail✝).tail?.isSome = true ↔ head✝ :: tail✝ ≠ [] TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_eq_decide_eq_nil
[35, 1]
[36, 29]
cases l <;> simp [isEmpty]
C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l = [])
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l = []) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_eq_decide_length
[38, 1]
[39, 29]
cases l <;> simp [isEmpty]
C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l.length = 0)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.isEmpty = decide (l.length = 0) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_reverse
[41, 1]
[43, 33]
rw [isEmpty_eq_decide_eq_nil, isEmpty_eq_decide_eq_nil]
C : Type u_1 α : Type u_2 l : List α ⊢ l.reverse.isEmpty = l.isEmpty
C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = [])
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ l.reverse.isEmpty = l.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.isEmpty_reverse
[41, 1]
[43, 33]
simp only [reverse_eq_nil_iff]
C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = [])
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ decide (l.reverse = []) = decide (l = []) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.reverse_dropLast
[45, 1]
[50, 38]
rw [dropLast, reverse_cons x, reverse_cons x, reverse_dropLast (_::_), tail_append_of_ne_nil] <;> simp
C : Type u_1 α : Type u_2 l✝ l : List α x head✝ : α tail✝ : List α ⊢ (x :: head✝ :: tail✝).dropLast.reverse = (x :: head✝ :: tail✝).reverse.tail
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l✝ l : List α x head✝ : α tail✝ : List α ⊢ (x :: head✝ :: tail✝).dropLast.reverse = (x :: head✝ :: tail✝).reverse.tail TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.back?_toArray
[52, 1]
[55, 7]
rw [Array.back?, Array.get?_eq_data_get?, getLast?_eq_get?]
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).back? = l.getLast?
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1)
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).back? = l.getLast? TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
List.back?_toArray
[52, 1]
[55, 7]
simp
C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1)
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 l : List α ⊢ (toArray l).data.get? ((toArray l).size - 1) = l.get? (l.length - 1) TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_data
[62, 1]
[63, 46]
rw [List.isEmpty_eq_decide_length, isEmpty]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.data.isEmpty = a.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_toList
[65, 1]
[66, 31]
rw [isEmpty_data, toList_eq]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toList.isEmpty = a.isEmpty TACTIC:
https://github.com/negiizhao/Algorithm.git
ae2bb2d101ce546ffe90434d718f919ef346c2ea
Algorithm/Data/Classes/ToList.lean
Array.isEmpty_toListRev
[68, 1]
[69, 56]
rw [toListRev_eq, List.isEmpty_reverse, isEmpty_data]
C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.isEmpty = a.isEmpty
no goals
Please generate a tactic in lean4 to solve the state. STATE: C : Type u_1 α : Type u_2 a : Array α ⊢ a.toListRev.isEmpty = a.isEmpty TACTIC: