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
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_map_fst
[1651, 1]
[1661, 26]
simp only [hneq, ite_false, map, incrCounts]
α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) h' : Mem x (map Prod.fst as) ih : map Prod.fst (incrCounts as x) = map Prod.fst as hneq : ¬a.fst = x ⊢ map Prod.fst (incrCounts (a :: as) x) = map Prod.fst (a :: as)
α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) h' : Mem x (map Prod.fst as) ih : map Prod.fst (incrCounts as x) = map Prod.fst as hneq : ¬a.fst = x ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_map_fst
[1651, 1]
[1661, 26]
exact congrArg _ ih
α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) h' : Mem x (map Prod.fst as) ih : map Prod.fst (incrCounts as x) = map Prod.fst as hneq : ¬a.fst = x ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
intros as h
α : Type u_1 inst✝ : DecidableEq α x : α ⊢ ∀ (as : List (α × Nat)), ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x]
α : Type u_1 inst✝ : DecidableEq α x : α as : List (α × Nat) h : ¬x ∈ map Prod.fst as ⊢ map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
induction as with | nil => simp only [incrCounts, map, HAppend.hAppend, Append.append, List.append] | cons a as ih => simp only [map, incrCounts] cases Decidable.em (a.1 = x) with | inl heq => apply absurd h apply not_not simp only [map, heq] apply List.Mem.head | inr hneq => simp only [hneq, ite_false, map] apply congrArg apply ih . intros hneg apply h apply List.Mem.tail _ hneg
α : Type u_1 inst✝ : DecidableEq α x : α as : List (α × Nat) h : ¬x ∈ map Prod.fst as ⊢ map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
simp only [incrCounts, map, HAppend.hAppend, Append.append, List.append]
case nil α : Type u_1 inst✝ : DecidableEq α x : α h : ¬x ∈ map Prod.fst [] ⊢ map Prod.fst (incrCounts [] x) = map Prod.fst [] ++ [x]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
simp only [map, incrCounts]
case cons α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) ⊢ map Prod.fst (incrCounts (a :: as) x) = map Prod.fst (a :: as) ++ [x]
case cons α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) ⊢ map Prod.fst (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
cases Decidable.em (a.1 = x) with | inl heq => apply absurd h apply not_not simp only [map, heq] apply List.Mem.head | inr hneq => simp only [hneq, ite_false, map] apply congrArg apply ih . intros hneg apply h apply List.Mem.tail _ hneg
case cons α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) ⊢ map Prod.fst (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply absurd h
case cons.inl α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ map Prod.fst (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
case cons.inl α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ ¬¬x ∈ map Prod.fst (a :: as)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply not_not
case cons.inl α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ ¬¬x ∈ map Prod.fst (a :: as)
case cons.inl.a α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ x ∈ map Prod.fst (a :: as)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
simp only [map, heq]
case cons.inl.a α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ x ∈ map Prod.fst (a :: as)
case cons.inl.a α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ x ∈ x :: map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply List.Mem.head
case cons.inl.a α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) heq : a.fst = x ⊢ x ∈ x :: map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
simp only [hneq, ite_false, map]
case cons.inr α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ map Prod.fst (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
case cons.inr α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply congrArg
case cons.inr α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as ++ [x]
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ map Prod.fst (incrCounts as x) = List.append (map Prod.fst as) [x]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply ih
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ map Prod.fst (incrCounts as x) = List.append (map Prod.fst as) [x]
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ ¬x ∈ map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
. intros hneg apply h apply List.Mem.tail _ hneg
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ ¬x ∈ map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
intros hneg
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x ⊢ ¬x ∈ map Prod.fst as
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x hneg : x ∈ map Prod.fst as ⊢ False
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply h
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x hneg : x ∈ map Prod.fst as ⊢ False
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x hneg : x ∈ map Prod.fst as ⊢ x ∈ map Prod.fst (a :: as)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_cons_fst
[1665, 1]
[1686, 35]
apply List.Mem.tail _ hneg
case cons.inr.h α : Type u_1 inst✝ : DecidableEq α x : α a : α × Nat as : List (α × Nat) ih : ¬x ∈ map Prod.fst as → map Prod.fst (incrCounts as x) = map Prod.fst as ++ [x] h : ¬x ∈ map Prod.fst (a :: as) hneq : ¬a.fst = x hneg : x ∈ map Prod.fst as ⊢ x ∈ map Prod.fst (a :: as)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply Iff.intro
α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ∨ x ∈ ys ↔ x ∈ xs ++ ys
case mp α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ∨ x ∈ ys → x ∈ xs ++ ys case mpr α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
. intros hf cases hf with | inl hxs => apply mem_append_front _ _ _ hxs | inr hys => apply mem_append_back _ _ _ hys
case mp α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ∨ x ∈ ys → x ∈ xs ++ ys case mpr α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys
case mpr α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
. intros hb induction xs with | nil => exact Or.intro_right _ hb | cons z xs ih => cases hb with | head _ => apply Or.intro_left _ (List.Mem.head _) | tail _ h' => cases ys with | nil => apply Or.intro_left apply List.Mem.tail simp at h' exact h' | cons y ys => simp at h' cases ih h' with | inl hxxs => apply Or.intro_left exact List.Mem.tail _ hxxs | inr hxys => exact Or.intro_right _ hxys
case mpr α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
intros hf
case mp α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ∨ x ∈ ys → x ∈ xs ++ ys
case mp α : Type u_1 x : α xs ys : List α hf : x ∈ xs ∨ x ∈ ys ⊢ x ∈ xs ++ ys
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
cases hf with | inl hxs => apply mem_append_front _ _ _ hxs | inr hys => apply mem_append_back _ _ _ hys
case mp α : Type u_1 x : α xs ys : List α hf : x ∈ xs ∨ x ∈ ys ⊢ x ∈ xs ++ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply mem_append_front _ _ _ hxs
case mp.inl α : Type u_1 x : α xs ys : List α hxs : x ∈ xs ⊢ x ∈ xs ++ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply mem_append_back _ _ _ hys
case mp.inr α : Type u_1 x : α xs ys : List α hys : x ∈ ys ⊢ x ∈ xs ++ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
intros hb
case mpr α : Type u_1 x : α xs ys : List α ⊢ x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys
case mpr α : Type u_1 x : α xs ys : List α hb : x ∈ xs ++ ys ⊢ x ∈ xs ∨ x ∈ ys
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
induction xs with | nil => exact Or.intro_right _ hb | cons z xs ih => cases hb with | head _ => apply Or.intro_left _ (List.Mem.head _) | tail _ h' => cases ys with | nil => apply Or.intro_left apply List.Mem.tail simp at h' exact h' | cons y ys => simp at h' cases ih h' with | inl hxxs => apply Or.intro_left exact List.Mem.tail _ hxxs | inr hxys => exact Or.intro_right _ hxys
case mpr α : Type u_1 x : α xs ys : List α hb : x ∈ xs ++ ys ⊢ x ∈ xs ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
exact Or.intro_right _ hb
case mpr.nil α : Type u_1 x : α ys : List α hb : x ∈ [] ++ ys ⊢ x ∈ [] ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
cases hb with | head _ => apply Or.intro_left _ (List.Mem.head _) | tail _ h' => cases ys with | nil => apply Or.intro_left apply List.Mem.tail simp at h' exact h' | cons y ys => simp at h' cases ih h' with | inl hxxs => apply Or.intro_left exact List.Mem.tail _ hxxs | inr hxys => exact Or.intro_right _ hxys
case mpr.cons α : Type u_1 x : α ys : List α z : α xs : List α ih : x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys hb : x ∈ z :: xs ++ ys ⊢ x ∈ z :: xs ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply Or.intro_left _ (List.Mem.head _)
case mpr.cons.head α : Type u_1 x : α ys xs : List α ih : x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys ⊢ x ∈ x :: xs ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
cases ys with | nil => apply Or.intro_left apply List.Mem.tail simp at h' exact h' | cons y ys => simp at h' cases ih h' with | inl hxxs => apply Or.intro_left exact List.Mem.tail _ hxxs | inr hxys => exact Or.intro_right _ hxys
case mpr.cons.tail α : Type u_1 x : α ys : List α z : α xs : List α ih : x ∈ xs ++ ys → x ∈ xs ∨ x ∈ ys h' : Mem x (List.append xs ys) ⊢ x ∈ z :: xs ∨ x ∈ ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply Or.intro_left
case mpr.cons.tail.nil α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x (List.append xs []) ⊢ x ∈ z :: xs ∨ x ∈ []
case mpr.cons.tail.nil.h α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x (List.append xs []) ⊢ x ∈ z :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply List.Mem.tail
case mpr.cons.tail.nil.h α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x (List.append xs []) ⊢ x ∈ z :: xs
case mpr.cons.tail.nil.h.a α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x (List.append xs []) ⊢ Mem x xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
simp at h'
case mpr.cons.tail.nil.h.a α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x (List.append xs []) ⊢ Mem x xs
case mpr.cons.tail.nil.h.a α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x xs ⊢ Mem x xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
exact h'
case mpr.cons.tail.nil.h.a α : Type u_1 x z : α xs : List α ih : x ∈ xs ++ [] → x ∈ xs ∨ x ∈ [] h' : Mem x xs ⊢ Mem x xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
simp at h'
case mpr.cons.tail.cons α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (List.append xs (y :: ys)) ⊢ x ∈ z :: xs ∨ x ∈ y :: ys
case mpr.cons.tail.cons α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) ⊢ x ∈ z :: xs ∨ x ∈ y :: ys
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
cases ih h' with | inl hxxs => apply Or.intro_left exact List.Mem.tail _ hxxs | inr hxys => exact Or.intro_right _ hxys
case mpr.cons.tail.cons α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) ⊢ x ∈ z :: xs ∨ x ∈ y :: ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
apply Or.intro_left
case mpr.cons.tail.cons.inl α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) hxxs : x ∈ xs ⊢ x ∈ z :: xs ∨ x ∈ y :: ys
case mpr.cons.tail.cons.inl.h α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) hxxs : x ∈ xs ⊢ x ∈ z :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
exact List.Mem.tail _ hxxs
case mpr.cons.tail.cons.inl.h α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) hxxs : x ∈ xs ⊢ x ∈ z :: xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_append_iff
[1693, 1]
[1720, 40]
exact Or.intro_right _ hxys
case mpr.cons.tail.cons.inr α : Type u_1 x z : α xs : List α y : α ys : List α ih : x ∈ xs ++ y :: ys → x ∈ xs ∨ x ∈ y :: ys h' : Mem x (xs ++ y :: ys) hxys : x ∈ y :: ys ⊢ x ∈ z :: xs ∨ x ∈ y :: ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
induction xs generalizing cs with | nil => simp [uniqueAux] rw [←Nat.add_one, Nat.add_assoc, Nat.add_comm (length cs), ←Nat.add_assoc] | cons z zs ih => have rearrange_mem : (z ∈ cs ++ x :: (as ++ [y])) ↔ (z ∈ cs ++ y :: x :: as) := by apply Iff.intro . intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back rw [←cons_append] at hcons cases mem_append_iff.mpr hcons with | inl hxas => exact List.Mem.tail _ hxas | inr hy => cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _ . intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back cases hcons with | head _ => apply List.Mem.tail apply List.mem_append_back apply (List.mem_singleton_iff y y).mpr rfl | tail _ hcons' => rw [←cons_append] exact List.mem_append_front _ _ _ hcons' simp only [uniqueAux] cases Decidable.em (z ∈ cs ++ x :: (as ++ [y])) with | inl hin => simp only [hin, rearrange_mem.mp hin, ite_true] apply ih | inr hout => simp only [hout, rearrange_mem.not_iff_not_of_iff.mp hout, ite_false] have rw_help (stuff) : (z :: (cs ++ stuff)) = ((z :: cs) ++ stuff) := rfl rw [rw_help, rw_help] apply ih
α : Type u_1 inst✝ : DecidableEq α x y : α as xs cs : List α ⊢ length (uniqueAux xs (cs ++ x :: (as ++ [y]))) = length (uniqueAux xs (cs ++ y :: x :: as))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
simp [uniqueAux]
case nil α : Type u_1 inst✝ : DecidableEq α x y : α as cs : List α ⊢ length (uniqueAux [] (cs ++ x :: (as ++ [y]))) = length (uniqueAux [] (cs ++ y :: x :: as))
case nil α : Type u_1 inst✝ : DecidableEq α x y : α as cs : List α ⊢ Nat.succ (length as + Nat.succ 0 + length cs) = length as + Nat.succ 0 + Nat.succ 0 + length cs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
rw [←Nat.add_one, Nat.add_assoc, Nat.add_comm (length cs), ←Nat.add_assoc]
case nil α : Type u_1 inst✝ : DecidableEq α x y : α as cs : List α ⊢ Nat.succ (length as + Nat.succ 0 + length cs) = length as + Nat.succ 0 + Nat.succ 0 + length cs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
have rearrange_mem : (z ∈ cs ++ x :: (as ++ [y])) ↔ (z ∈ cs ++ y :: x :: as) := by apply Iff.intro . intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back rw [←cons_append] at hcons cases mem_append_iff.mpr hcons with | inl hxas => exact List.Mem.tail _ hxas | inr hy => cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _ . intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back cases hcons with | head _ => apply List.Mem.tail apply List.mem_append_back apply (List.mem_singleton_iff y y).mpr rfl | tail _ hcons' => rw [←cons_append] exact List.mem_append_front _ _ _ hcons'
case cons α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ length (uniqueAux (z :: zs) (cs ++ x :: (as ++ [y]))) = length (uniqueAux (z :: zs) (cs ++ y :: x :: as))
case cons α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as ⊢ length (uniqueAux (z :: zs) (cs ++ x :: (as ++ [y]))) = length (uniqueAux (z :: zs) (cs ++ y :: x :: as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
simp only [uniqueAux]
case cons α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as ⊢ length (uniqueAux (z :: zs) (cs ++ x :: (as ++ [y]))) = length (uniqueAux (z :: zs) (cs ++ y :: x :: as))
case cons α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as ⊢ length (if z ∈ cs ++ x :: (as ++ [y]) then uniqueAux zs (cs ++ x :: (as ++ [y])) else uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (if z ∈ cs ++ y :: x :: as then uniqueAux zs (cs ++ y :: x :: as) else uniqueAux zs (z :: (cs ++ y :: x :: as)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases Decidable.em (z ∈ cs ++ x :: (as ++ [y])) with | inl hin => simp only [hin, rearrange_mem.mp hin, ite_true] apply ih | inr hout => simp only [hout, rearrange_mem.not_iff_not_of_iff.mp hout, ite_false] have rw_help (stuff) : (z :: (cs ++ stuff)) = ((z :: cs) ++ stuff) := rfl rw [rw_help, rw_help] apply ih
case cons α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as ⊢ length (if z ∈ cs ++ x :: (as ++ [y]) then uniqueAux zs (cs ++ x :: (as ++ [y])) else uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (if z ∈ cs ++ y :: x :: as then uniqueAux zs (cs ++ y :: x :: as) else uniqueAux zs (z :: (cs ++ y :: x :: as)))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply Iff.intro
α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as
case mp α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ x :: (as ++ [y]) → z ∈ cs ++ y :: x :: as case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ y :: x :: as → z ∈ cs ++ x :: (as ++ [y])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
. intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back rw [←cons_append] at hcons cases mem_append_iff.mpr hcons with | inl hxas => exact List.Mem.tail _ hxas | inr hy => cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _
case mp α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ x :: (as ++ [y]) → z ∈ cs ++ y :: x :: as case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ y :: x :: as → z ∈ cs ++ x :: (as ++ [y])
case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ y :: x :: as → z ∈ cs ++ x :: (as ++ [y])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
. intros h cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back cases hcons with | head _ => apply List.Mem.tail apply List.mem_append_back apply (List.mem_singleton_iff y y).mpr rfl | tail _ hcons' => rw [←cons_append] exact List.mem_append_front _ _ _ hcons'
case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ y :: x :: as → z ∈ cs ++ x :: (as ++ [y])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
intros h
case mp α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ x :: (as ++ [y]) → z ∈ cs ++ y :: x :: as
case mp α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) ⊢ z ∈ cs ++ y :: x :: as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back rw [←cons_append] at hcons cases mem_append_iff.mpr hcons with | inl hxas => exact List.Mem.tail _ hxas | inr hy => cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _
case mp α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) ⊢ z ∈ cs ++ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
exact List.mem_append_front _ _ _ hcs
case mp.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcs : z ∈ cs ⊢ z ∈ cs ++ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply List.mem_append_back
case mp.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: (as ++ [y]) ⊢ z ∈ cs ++ y :: x :: as
case mp.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: (as ++ [y]) ⊢ z ∈ y :: x :: as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
rw [←cons_append] at hcons
case mp.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: (as ++ [y]) ⊢ z ∈ y :: x :: as
case mp.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: as ++ [y] ⊢ z ∈ y :: x :: as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases mem_append_iff.mpr hcons with | inl hxas => exact List.Mem.tail _ hxas | inr hy => cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _
case mp.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: as ++ [y] ⊢ z ∈ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
exact List.Mem.tail _ hxas
case mp.inr.a.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: as ++ [y] hxas : z ∈ x :: as ⊢ z ∈ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases hy with | tail _ _ => contradiction | head _ => exact List.Mem.head _
case mp.inr.a.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: as ++ [y] hy : z ∈ [y] ⊢ z ∈ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
contradiction
case mp.inr.a.inr.tail α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ x :: (as ++ [y]) hcons : z ∈ x :: as ++ [y] a✝ : Mem z [] ⊢ z ∈ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
exact List.Mem.head _
case mp.inr.a.inr.head α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ x :: (as ++ [y]) hcons : y ∈ x :: as ++ [y] ⊢ y ∈ y :: x :: as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
intros h
case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α ⊢ z ∈ cs ++ y :: x :: as → z ∈ cs ++ x :: (as ++ [y])
case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as ⊢ z ∈ cs ++ x :: (as ++ [y])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases mem_append_iff.mpr h with | inl hcs => exact List.mem_append_front _ _ _ hcs | inr hcons => apply List.mem_append_back cases hcons with | head _ => apply List.Mem.tail apply List.mem_append_back apply (List.mem_singleton_iff y y).mpr rfl | tail _ hcons' => rw [←cons_append] exact List.mem_append_front _ _ _ hcons'
case mpr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as ⊢ z ∈ cs ++ x :: (as ++ [y])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
exact List.mem_append_front _ _ _ hcs
case mpr.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcs : z ∈ cs ⊢ z ∈ cs ++ x :: (as ++ [y])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply List.mem_append_back
case mpr.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons : z ∈ y :: x :: as ⊢ z ∈ cs ++ x :: (as ++ [y])
case mpr.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons : z ∈ y :: x :: as ⊢ z ∈ x :: (as ++ [y])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
cases hcons with | head _ => apply List.Mem.tail apply List.mem_append_back apply (List.mem_singleton_iff y y).mpr rfl | tail _ hcons' => rw [←cons_append] exact List.mem_append_front _ _ _ hcons'
case mpr.inr.a α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons : z ∈ y :: x :: as ⊢ z ∈ x :: (as ++ [y])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply List.Mem.tail
case mpr.inr.a.head α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ y :: x :: as ⊢ y ∈ x :: (as ++ [y])
case mpr.inr.a.head.a α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ y :: x :: as ⊢ Mem y (as ++ [y])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply List.mem_append_back
case mpr.inr.a.head.a α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ y :: x :: as ⊢ Mem y (as ++ [y])
case mpr.inr.a.head.a.a α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ y :: x :: as ⊢ y ∈ [y]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply (List.mem_singleton_iff y y).mpr rfl
case mpr.inr.a.head.a.a α : Type u_1 inst✝ : DecidableEq α x y : α as zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : y ∈ cs ++ y :: x :: as ⊢ y ∈ [y]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
rw [←cons_append]
case mpr.inr.a.tail α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons' : Mem z (x :: as) ⊢ z ∈ x :: (as ++ [y])
case mpr.inr.a.tail α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons' : Mem z (x :: as) ⊢ z ∈ x :: as ++ [y]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
exact List.mem_append_front _ _ _ hcons'
case mpr.inr.a.tail α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α h : z ∈ cs ++ y :: x :: as hcons' : Mem z (x :: as) ⊢ z ∈ x :: as ++ [y]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
simp only [hin, rearrange_mem.mp hin, ite_true]
case cons.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hin : z ∈ cs ++ x :: (as ++ [y]) ⊢ length (if z ∈ cs ++ x :: (as ++ [y]) then uniqueAux zs (cs ++ x :: (as ++ [y])) else uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (if z ∈ cs ++ y :: x :: as then uniqueAux zs (cs ++ y :: x :: as) else uniqueAux zs (z :: (cs ++ y :: x :: as)))
case cons.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hin : z ∈ cs ++ x :: (as ++ [y]) ⊢ length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply ih
case cons.inl α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hin : z ∈ cs ++ x :: (as ++ [y]) ⊢ length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
simp only [hout, rearrange_mem.not_iff_not_of_iff.mp hout, ite_false]
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) ⊢ length (if z ∈ cs ++ x :: (as ++ [y]) then uniqueAux zs (cs ++ x :: (as ++ [y])) else uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (if z ∈ cs ++ y :: x :: as then uniqueAux zs (cs ++ y :: x :: as) else uniqueAux zs (z :: (cs ++ y :: x :: as)))
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) ⊢ length (uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (uniqueAux zs (z :: (cs ++ y :: x :: as)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
have rw_help (stuff) : (z :: (cs ++ stuff)) = ((z :: cs) ++ stuff) := rfl
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) ⊢ length (uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (uniqueAux zs (z :: (cs ++ y :: x :: as)))
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) rw_help : ∀ (stuff : List α), z :: (cs ++ stuff) = z :: cs ++ stuff ⊢ length (uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (uniqueAux zs (z :: (cs ++ y :: x :: as)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
rw [rw_help, rw_help]
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) rw_help : ∀ (stuff : List α), z :: (cs ++ stuff) = z :: cs ++ stuff ⊢ length (uniqueAux zs (z :: (cs ++ x :: (as ++ [y])))) = length (uniqueAux zs (z :: (cs ++ y :: x :: as)))
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) rw_help : ∀ (stuff : List α), z :: (cs ++ stuff) = z :: cs ++ stuff ⊢ length (uniqueAux zs (z :: cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (z :: cs ++ y :: x :: as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_congr_append_cons_acc
[1722, 1]
[1772, 15]
apply ih
case cons.inr α : Type u_1 inst✝ : DecidableEq α x y : α as : List α z : α zs : List α ih : ∀ (cs : List α), length (uniqueAux zs (cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (cs ++ y :: x :: as)) cs : List α rearrange_mem : z ∈ cs ++ x :: (as ++ [y]) ↔ z ∈ cs ++ y :: x :: as hout : ¬z ∈ cs ++ x :: (as ++ [y]) rw_help : ∀ (stuff : List α), z :: (cs ++ stuff) = z :: cs ++ stuff ⊢ length (uniqueAux zs (z :: cs ++ x :: (as ++ [y]))) = length (uniqueAux zs (z :: cs ++ y :: x :: as))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
induction xs generalizing acc with | nil => simp [foldl, uniqueAux] | cons x xs ih => simp only [uniqueAux, foldl] cases acc with | nil => simp only [incrCounts, map, List.not_mem_nil, ite_false] apply ih | cons a as => simp only [incrCounts] cases Decidable.em (a.1 = x) with | inl htrue => simp only [htrue, ite_true, incrCounts, map] rw [if_pos] . apply ih . exact List.Mem.head _ | inr hfalse => simp only [hfalse, ite_false, incrCounts, map] rw [ih] cases Decidable.em (x ∈ map Prod.fst as) with | inl hin => have : x ∈ a.1 :: map Prod.fst as := List.Mem.tail _ hin simp only [this, ite_true, map, uniqueAux] apply congrArg apply congrArg apply congrArg exact map_fst_incrCounts_eq_map_fst x as hin | inr hout => have : ¬ (x ∈ a.1 :: map Prod.fst as) := by intros hneg; cases hneg; repeat contradiction simp only [this, ite_false, map] rw [map_fst_incrCounts_eq_cons_fst _ _ hout] apply List.length_uniqueAux_congr_append_cons_acc _ _ _ _ []
α : Type u_1 inst✝ : DecidableEq α xs : List α acc : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp [foldl, uniqueAux]
case nil α : Type u_1 inst✝ : DecidableEq α acc : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) acc []) = length (uniqueAux [] (map Prod.fst acc))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [uniqueAux, foldl]
case cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) acc : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) acc (x :: xs)) = length (uniqueAux (x :: xs) (map Prod.fst acc))
case cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) acc : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) (incrCounts acc x) xs) = length (if x ∈ map Prod.fst acc then uniqueAux xs (map Prod.fst acc) else uniqueAux xs (x :: map Prod.fst acc))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
cases acc with | nil => simp only [incrCounts, map, List.not_mem_nil, ite_false] apply ih | cons a as => simp only [incrCounts] cases Decidable.em (a.1 = x) with | inl htrue => simp only [htrue, ite_true, incrCounts, map] rw [if_pos] . apply ih . exact List.Mem.head _ | inr hfalse => simp only [hfalse, ite_false, incrCounts, map] rw [ih] cases Decidable.em (x ∈ map Prod.fst as) with | inl hin => have : x ∈ a.1 :: map Prod.fst as := List.Mem.tail _ hin simp only [this, ite_true, map, uniqueAux] apply congrArg apply congrArg apply congrArg exact map_fst_incrCounts_eq_map_fst x as hin | inr hout => have : ¬ (x ∈ a.1 :: map Prod.fst as) := by intros hneg; cases hneg; repeat contradiction simp only [this, ite_false, map] rw [map_fst_incrCounts_eq_cons_fst _ _ hout] apply List.length_uniqueAux_congr_append_cons_acc _ _ _ _ []
case cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) acc : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) (incrCounts acc x) xs) = length (if x ∈ map Prod.fst acc then uniqueAux xs (map Prod.fst acc) else uniqueAux xs (x :: map Prod.fst acc))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [incrCounts, map, List.not_mem_nil, ite_false]
case cons.nil α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) ⊢ length (foldl (fun acc v => incrCounts acc v) (incrCounts [] x) xs) = length (if x ∈ map Prod.fst [] then uniqueAux xs (map Prod.fst []) else uniqueAux xs (x :: map Prod.fst []))
case cons.nil α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) ⊢ length (foldl (fun acc v => incrCounts acc v) [(x, 1)] xs) = length (uniqueAux xs [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
apply ih
case cons.nil α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) ⊢ length (foldl (fun acc v => incrCounts acc v) [(x, 1)] xs) = length (uniqueAux xs [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [incrCounts]
case cons.cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) (incrCounts (a :: as) x) xs) = length (if x ∈ map Prod.fst (a :: as) then uniqueAux xs (map Prod.fst (a :: as)) else uniqueAux xs (x :: map Prod.fst (a :: as)))
case cons.cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ map Prod.fst (a :: as) then uniqueAux xs (map Prod.fst (a :: as)) else uniqueAux xs (x :: map Prod.fst (a :: as)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
cases Decidable.em (a.1 = x) with | inl htrue => simp only [htrue, ite_true, incrCounts, map] rw [if_pos] . apply ih . exact List.Mem.head _ | inr hfalse => simp only [hfalse, ite_false, incrCounts, map] rw [ih] cases Decidable.em (x ∈ map Prod.fst as) with | inl hin => have : x ∈ a.1 :: map Prod.fst as := List.Mem.tail _ hin simp only [this, ite_true, map, uniqueAux] apply congrArg apply congrArg apply congrArg exact map_fst_incrCounts_eq_map_fst x as hin | inr hout => have : ¬ (x ∈ a.1 :: map Prod.fst as) := by intros hneg; cases hneg; repeat contradiction simp only [this, ite_false, map] rw [map_fst_incrCounts_eq_cons_fst _ _ hout] apply List.length_uniqueAux_congr_append_cons_acc _ _ _ _ []
case cons.cons α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) ⊢ length (foldl (fun acc v => incrCounts acc v) (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ map Prod.fst (a :: as) then uniqueAux xs (map Prod.fst (a :: as)) else uniqueAux xs (x :: map Prod.fst (a :: as)))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [htrue, ite_true, incrCounts, map]
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ map Prod.fst (a :: as) then uniqueAux xs (map Prod.fst (a :: as)) else uniqueAux xs (x :: map Prod.fst (a :: as)))
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((x, a.snd + 1) :: as) xs) = length (if x ∈ x :: map Prod.fst as then uniqueAux xs (x :: map Prod.fst as) else uniqueAux xs (x :: x :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
rw [if_pos]
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((x, a.snd + 1) :: as) xs) = length (if x ∈ x :: map Prod.fst as then uniqueAux xs (x :: map Prod.fst as) else uniqueAux xs (x :: x :: map Prod.fst as))
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((x, a.snd + 1) :: as) xs) = length (uniqueAux xs (x :: map Prod.fst as)) case cons.cons.inl.hc α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ x ∈ x :: map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
. apply ih
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((x, a.snd + 1) :: as) xs) = length (uniqueAux xs (x :: map Prod.fst as)) case cons.cons.inl.hc α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ x ∈ x :: map Prod.fst as
case cons.cons.inl.hc α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ x ∈ x :: map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
. exact List.Mem.head _
case cons.cons.inl.hc α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ x ∈ x :: map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
apply ih
case cons.cons.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((x, a.snd + 1) :: as) xs) = length (uniqueAux xs (x :: map Prod.fst as))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
exact List.Mem.head _
case cons.cons.inl.hc α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) htrue : a.fst = x ⊢ x ∈ x :: map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [hfalse, ite_false, incrCounts, map]
case cons.cons.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) (if a.fst = x then (a.fst, a.snd + 1) :: as else (a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ map Prod.fst (a :: as) then uniqueAux xs (map Prod.fst (a :: as)) else uniqueAux xs (x :: map Prod.fst (a :: as)))
case cons.cons.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
rw [ih]
case cons.cons.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x ⊢ length (foldl (fun acc v => incrCounts acc v) ((a.fst, a.snd) :: incrCounts as x) xs) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
case cons.cons.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
cases Decidable.em (x ∈ map Prod.fst as) with | inl hin => have : x ∈ a.1 :: map Prod.fst as := List.Mem.tail _ hin simp only [this, ite_true, map, uniqueAux] apply congrArg apply congrArg apply congrArg exact map_fst_incrCounts_eq_map_fst x as hin | inr hout => have : ¬ (x ∈ a.1 :: map Prod.fst as) := by intros hneg; cases hneg; repeat contradiction simp only [this, ite_false, map] rw [map_fst_incrCounts_eq_cons_fst _ _ hout] apply List.length_uniqueAux_congr_append_cons_acc _ _ _ _ []
case cons.cons.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
have : x ∈ a.1 :: map Prod.fst as := List.Mem.tail _ hin
case cons.cons.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
case cons.cons.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [this, ite_true, map, uniqueAux]
case cons.cons.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
case cons.cons.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (a.fst :: map Prod.fst (incrCounts as x))) = length (uniqueAux xs (a.fst :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
apply congrArg
case cons.cons.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (a.fst :: map Prod.fst (incrCounts as x))) = length (uniqueAux xs (a.fst :: map Prod.fst as))
case cons.cons.inr.inl.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ uniqueAux xs (a.fst :: map Prod.fst (incrCounts as x)) = uniqueAux xs (a.fst :: map Prod.fst as)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
apply congrArg
case cons.cons.inr.inl.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ uniqueAux xs (a.fst :: map Prod.fst (incrCounts as x)) = uniqueAux xs (a.fst :: map Prod.fst as)
case cons.cons.inr.inl.h.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
apply congrArg
case cons.cons.inr.inl.h.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ a.fst :: map Prod.fst (incrCounts as x) = a.fst :: map Prod.fst as
case cons.cons.inr.inl.h.h.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ map Prod.fst (incrCounts as x) = map Prod.fst as
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
exact map_fst_incrCounts_eq_map_fst x as hin
case cons.cons.inr.inl.h.h.h α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hin : x ∈ map Prod.fst as this : x ∈ a.fst :: map Prod.fst as ⊢ map Prod.fst (incrCounts as x) = map Prod.fst as
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
have : ¬ (x ∈ a.1 :: map Prod.fst as) := by intros hneg; cases hneg; repeat contradiction
case cons.cons.inr.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hout : ¬x ∈ map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
case cons.cons.inr.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hout : ¬x ∈ map Prod.fst as this : ¬x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_counts_aux
[1774, 1]
[1810, 71]
simp only [this, ite_false, map]
case cons.cons.inr.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hout : ¬x ∈ map Prod.fst as this : ¬x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (map Prod.fst ((a.fst, a.snd) :: incrCounts as x))) = length (if x ∈ a.fst :: map Prod.fst as then uniqueAux xs (a.fst :: map Prod.fst as) else uniqueAux xs (x :: a.fst :: map Prod.fst as))
case cons.cons.inr.inr α : Type u_1 inst✝ : DecidableEq α x : α xs : List α ih : ∀ (acc : List (α × Nat)), length (foldl (fun acc v => incrCounts acc v) acc xs) = length (uniqueAux xs (map Prod.fst acc)) a : α × Nat as : List (α × Nat) hfalse : ¬a.fst = x hout : ¬x ∈ map Prod.fst as this : ¬x ∈ a.fst :: map Prod.fst as ⊢ length (uniqueAux xs (a.fst :: map Prod.fst (incrCounts as x))) = length (uniqueAux xs (x :: a.fst :: map Prod.fst as))