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.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases ih with | inl => contradiction | inr hmem => exact hmem
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys ih : x = k ∨ x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases hx with | head => contradiction | tail => assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k ⊢ x ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
contradiction
case head κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k h : ¬(k', v).fst = k ⊢ (k', v).fst ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
assumption
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k a✝ : Mem x (map Prod.fst ys) ⊢ x ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
contradiction
case inl.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys h✝ : x = k ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
exact hmem
case inl.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys hmem : x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
simp only [hkneq, ite_false]
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst (if k' = k then (v :: (matchKey ys k).fst, (matchKey ys k).snd) else ((matchKey ys k).fst, (k', v) :: (matchKey ys k).snd)).snd
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst ((k', v) :: (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
simp only [map]
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst ((k', v) :: (matchKey ys k).snd)
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ k' :: map Prod.fst (matchKey ys k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases Decidable.em (x = k') with | inl hxeq => rw [hxeq]; apply Mem.head | inr hxneq => apply Mem.tail have : x ∈ map Prod.fst (matchKey ys k).snd := by cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption have ih := mem_fst_matchKey_key_or_snd this k' cases ih with | inl => contradiction | inr => assumption
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ k' :: map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
rw [hxeq]
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ x ∈ k' :: map Prod.fst (matchKey ys k).snd
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ k' ∈ k' :: map Prod.fst (matchKey ys k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
apply Mem.head
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ k' ∈ k' :: map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
apply Mem.tail
case inr.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ x ∈ k' :: map Prod.fst (matchKey ys k).snd
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
have : x ∈ map Prod.fst (matchKey ys k).snd := by cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
have ih := mem_fst_matchKey_key_or_snd this k'
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ih : x = k' ∨ x ∈ map Prod.fst (matchKey (matchKey ys k).snd k').snd ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases ih with | inl => contradiction | inr => assumption
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ih : x = k' ∨ x ∈ map Prod.fst (matchKey (matchKey ys k).snd k').snd ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
contradiction
case head κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k h : ¬(k', v).fst = k hxneq : ¬(k', v).fst = k' ⊢ (k', v).fst ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
have := mem_fst_matchKey_key_or_snd htail k
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) ⊢ x ∈ map Prod.fst (matchKey ys k).snd
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) this : x = k ∨ x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
cases this with | inl => contradiction | inr => assumption
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) this : x = k ∨ x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
contradiction
case tail.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) h✝ : x = k ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
assumption
case tail.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) h✝ : x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
contradiction
case inr.inr.a.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd h✝ : x = k' ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
assumption
case inr.inr.a.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd h✝ : x ∈ map Prod.fst (matchKey (matchKey ys k).snd k').snd ⊢ Mem x (map Prod.fst (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_matchKey_key_or_snd
[1373, 1]
[1418, 25]
assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ _x✝ : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ a✝³ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y _x✝ → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (matchKey y.1 y.2.2.2).snd ys✝ : List (κ × ν) x✝¹ : (x : κ) ×' (_ : x ∈ map Prod.fst ys✝) ×' κ a✝² : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := x✝¹ } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (matchKey y.1 y.2.2.2).snd x : κ hx✝¹ : (_ : x ∈ map Prod.fst ys✝) ×' κ a✝¹ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := { fst := x, snd := hx✝¹ } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (matchKey y.1 y.2.2.2).snd hx✝ : x ∈ map Prod.fst ys✝ k : κ a✝ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := { fst := x, snd := { fst := hx✝, snd := k } } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (matchKey y.1 y.2.2.2).snd h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) x✝ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := (k', v) :: ys, snd := { fst := x, snd := { fst := hx, snd := k } } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (matchKey y.1 y.2.2.2).snd h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k h✝³ : (_ : k' = k ∨ ¬k' = k) = (_ : k' = k ∨ ¬k' = k) hxneq : ¬x = k' h✝² : (_ : x = k' ∨ ¬x = k') = (_ : x = k' ∨ ¬x = k') b✝ : κ as✝ : List κ htail✝ : Mem x as✝ h✝¹ : map Prod.fst ((k', v) :: ys) = b✝ :: as✝ head_eq✝ : (k', v).fst = b✝ tail_eq✝ : map Prod.fst ys = as✝ htail : Mem x (map Prod.fst ys) h✝ : HEq hx (_ : Mem x ((k', v).fst :: map Prod.fst ys)) ⊢ (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 { fst := ys, snd := { fst := x, snd := { fst := htail, snd := k } } } { fst := (k', v) :: ys, snd := { fst := x, snd := { fst := hx, snd := k } } }
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
simp only [matchKey]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) ⊢ x ∈ map Prod.fst (groupByKey (matchKey ((k', v) :: ys) k).snd)
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) ⊢ x ∈ map Prod.fst (groupByKey (if k' = k then (v :: (matchKey ys k).fst, (matchKey ys k).snd) else ((matchKey ys k).fst, (k', v) :: (matchKey ys k).snd)).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases Decidable.em (k' = k) with | inl hkeq => simp only [hkeq, ite_true] have : x ∈ map Prod.fst ys := by cases hx with | head => contradiction | tail => assumption have ih := mem_fst_groupByKey_key_or_snd this k cases ih with | inl => contradiction | inr hmem => exact hmem | inr hkneq => simp only [hkneq, ite_false] simp only [groupByKey] simp only [map] cases Decidable.em (x = k') with | inl hxeq => rw [hxeq]; apply Mem.head | inr hxneq => apply Mem.tail have : x ∈ map Prod.fst (matchKey ys k).snd := by cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption have ih := mem_fst_groupByKey_key_or_snd this k' cases ih with | inl => contradiction | inr => assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) ⊢ x ∈ map Prod.fst (groupByKey (if k' = k then (v :: (matchKey ys k).fst, (matchKey ys k).snd) else ((matchKey ys k).fst, (k', v) :: (matchKey ys k).snd)).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
simp only [hkeq, ite_true]
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k ⊢ x ∈ map Prod.fst (groupByKey (if k' = k then (v :: (matchKey ys k).fst, (matchKey ys k).snd) else ((matchKey ys k).fst, (k', v) :: (matchKey ys k).snd)).snd)
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
have : x ∈ map Prod.fst ys := by cases hx with | head => contradiction | tail => assumption
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
have ih := mem_fst_groupByKey_key_or_snd this k
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys ih : x = k ∨ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd) ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases ih with | inl => contradiction | inr hmem => exact hmem
case inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys ih : x = k ∨ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd) ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases hx with | head => contradiction | tail => assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k ⊢ x ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
contradiction
case head κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k h : ¬(k', v).fst = k ⊢ (k', v).fst ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
assumption
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k a✝ : Mem x (map Prod.fst ys) ⊢ x ∈ map Prod.fst ys
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
contradiction
case inl.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys h✝ : x = k ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
exact hmem
case inl.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkeq : k' = k this : x ∈ map Prod.fst ys hmem : x ∈ map Prod.fst (groupByKey (matchKey ys k).snd) ⊢ x ∈ map Prod.fst (groupByKey (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
simp only [hkneq, ite_false]
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst (groupByKey (if k' = k then (v :: (matchKey ys k).fst, (matchKey ys k).snd) else ((matchKey ys k).fst, (k', v) :: (matchKey ys k).snd)).snd)
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst (groupByKey ((k', v) :: (matchKey ys k).snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
simp only [groupByKey]
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst (groupByKey ((k', v) :: (matchKey ys k).snd))
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst ((k', v :: (matchKey (matchKey ys k).snd k').fst) :: groupByKey (matchKey (matchKey ys k).snd k').snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
simp only [map]
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ map Prod.fst ((k', v :: (matchKey (matchKey ys k).snd k').fst) :: groupByKey (matchKey (matchKey ys k).snd k').snd)
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases Decidable.em (x = k') with | inl hxeq => rw [hxeq]; apply Mem.head | inr hxneq => apply Mem.tail have : x ∈ map Prod.fst (matchKey ys k).snd := by cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption have ih := mem_fst_groupByKey_key_or_snd this k' cases ih with | inl => contradiction | inr => assumption
case inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k ⊢ x ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
rw [hxeq]
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ x ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ k' ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
apply Mem.head
case inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxeq : x = k' ⊢ k' ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
apply Mem.tail
case inr.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ x ∈ k' :: map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd)
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
have : x ∈ map Prod.fst (matchKey ys k).snd := by cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
have ih := mem_fst_groupByKey_key_or_snd this k'
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ih : x = k' ∨ x ∈ map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd) ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases ih with | inl => contradiction | inr => assumption
case inr.inr.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd ih : x = k' ∨ x ∈ map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd) ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases hx with | head => contradiction | tail _ htail => have := mem_fst_matchKey_key_or_snd htail k cases this with | inl => contradiction | inr => assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
contradiction
case head κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k h : ¬(k', v).fst = k hxneq : ¬(k', v).fst = k' ⊢ (k', v).fst ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
have := mem_fst_matchKey_key_or_snd htail k
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) ⊢ x ∈ map Prod.fst (matchKey ys k).snd
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) this : x = k ∨ x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
cases this with | inl => contradiction | inr => assumption
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) this : x = k ∨ x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
contradiction
case tail.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) h✝ : x = k ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
assumption
case tail.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' htail : Mem x (map Prod.fst ys) h✝ : x ∈ map Prod.fst (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
contradiction
case inr.inr.a.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd h✝ : x = k' ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
assumption
case inr.inr.a.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ys✝ : List (κ × ν) x k : κ h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k hxneq : ¬x = k' this : x ∈ map Prod.fst (matchKey ys k).snd h✝ : x ∈ map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd) ⊢ Mem x (map Prod.fst (groupByKey (matchKey (matchKey ys k).snd k').snd))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fst_groupByKey_key_or_snd
[1421, 1]
[1468, 25]
assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ _x✝ : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ a✝³ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y _x✝ → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (groupByKey (matchKey y.1 y.2.2.2).snd) ys✝ : List (κ × ν) x✝¹ : (x : κ) ×' (_ : x ∈ map Prod.fst ys✝) ×' κ a✝² : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := x✝¹ } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (groupByKey (matchKey y.1 y.2.2.2).snd) x : κ hx✝¹ : (_ : x ∈ map Prod.fst ys✝) ×' κ a✝¹ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := { fst := x, snd := hx✝¹ } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (groupByKey (matchKey y.1 y.2.2.2).snd) hx✝ : x ∈ map Prod.fst ys✝ k : κ a✝ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := ys✝, snd := { fst := x, snd := { fst := hx✝, snd := k } } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (groupByKey (matchKey y.1 y.2.2.2).snd) h : ¬x = k k' : κ v : ν ys : List (κ × ν) hx : x ∈ map Prod.fst ((k', v) :: ys) x✝ : ∀ (y : (ys : List (κ × ν)) ×' (x : κ) ×' (_ : x ∈ map Prod.fst ys) ×' κ), (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 y { fst := (k', v) :: ys, snd := { fst := x, snd := { fst := hx, snd := k } } } → y.2.1 = y.2.2.2 ∨ y.2.1 ∈ map Prod.fst (groupByKey (matchKey y.1 y.2.2.2).snd) h_term : length (matchKey ys k).snd < Nat.succ (length ys) h_term' : length ys < Nat.succ (length ys) hkneq : ¬k' = k h✝¹ : (_ : k' = k ∨ ¬k' = k) = (_ : k' = k ∨ ¬k' = k) hxneq : ¬x = k' h✝ : (_ : x = k' ∨ ¬x = k') = (_ : x = k' ∨ ¬x = k') this : x ∈ map Prod.fst (matchKey ys k).snd ⊢ (invImage (fun a => PSigma.casesOn a fun ys snd => PSigma.casesOn snd fun x snd => PSigma.casesOn snd fun hx snd => length ys) instWellFoundedRelation).1 { fst := (matchKey ys k).snd, snd := { fst := x, snd := { fst := this, snd := k' } } } { fst := (k', v) :: ys, snd := { fst := x, snd := { fst := hx, snd := k } } }
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
simp only [groupByKey]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst (groupByKey ((k, v) :: xs)) ⊢ x ∈ map Prod.fst (groupByKey ((k, v) :: ys))
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst (groupByKey ((k, v) :: xs)) ⊢ x ∈ map Prod.fst ((k, v :: (matchKey ys k).fst) :: groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
simp only [map]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst (groupByKey ((k, v) :: xs)) ⊢ x ∈ map Prod.fst ((k, v :: (matchKey ys k).fst) :: groupByKey (matchKey ys k).snd)
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst (groupByKey ((k, v) :: xs)) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
simp only [groupByKey] at hx
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst (groupByKey ((k, v) :: xs)) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst ((k, v :: (matchKey xs k).fst) :: groupByKey (matchKey xs k).snd) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
simp only [map] at hx
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ map Prod.fst ((k, v :: (matchKey xs k).fst) :: groupByKey (matchKey xs k).snd) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ k :: map Prod.fst (groupByKey (matchKey xs k).snd) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
cases hx with | head => constructor | tail _ htail => apply Mem.tail have : (matchKey xs k).snd <+ (matchKey ys k).snd := matchKey_snd_sublist_of_sublist _ _ _ hsubl have hterm := matchKey_length_lt k ys apply all_in_map_fst_groupByKey_of_sublist this assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ hx : x ∈ k :: map Prod.fst (groupByKey (matchKey xs k).snd) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
constructor
case head κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys ⊢ k ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
apply Mem.tail
case tail κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) ⊢ x ∈ k :: map Prod.fst (groupByKey (matchKey ys k).snd)
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
have : (matchKey xs k).snd <+ (matchKey ys k).snd := matchKey_snd_sublist_of_sublist _ _ _ hsubl
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
have hterm := matchKey_length_lt k ys
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd hterm : length (matchKey ys k).snd < Nat.succ (length ys) ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
apply all_in_map_fst_groupByKey_of_sublist this
case tail.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd hterm : length (matchKey ys k).snd < Nat.succ (length ys) ⊢ Mem x (map Prod.fst (groupByKey (matchKey ys k).snd))
case tail.a.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd hterm : length (matchKey ys k).snd < Nat.succ (length ys) ⊢ x ∈ map Prod.fst (groupByKey (matchKey xs k).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
assumption
case tail.a.a κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs✝ ys✝ xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x : κ htail : Mem x (map Prod.fst (groupByKey (matchKey xs k).snd)) this : (matchKey xs k).snd <+ (matchKey ys k).snd hterm : length (matchKey ys k).snd < Nat.succ (length ys) ⊢ x ∈ map Prod.fst (groupByKey (matchKey xs k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.all_in_map_fst_groupByKey_of_sublist
[1482, 1]
[1515, 25]
assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ _x✝ : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs) a✝⁵ : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y _x✝ → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) xs✝ : List (κ × ν) ys✝¹ : (ys : List (κ × ν)) ×' (_ : xs✝ <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs✝) a✝⁴ : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y { fst := xs✝, snd := ys✝¹ } → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) ys✝ : List (κ × ν) x✝⁶ : (_ : xs✝ <+ ys✝) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs✝) a✝³ : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y { fst := xs✝, snd := { fst := ys✝, snd := x✝⁶ } } → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) x✝⁵ : xs✝ <+ ys✝ x✝⁴ : (x : κ) ×' x ∈ map Prod.fst (groupByKey xs✝) a✝² : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y { fst := xs✝, snd := { fst := ys✝, snd := { fst := x✝⁵, snd := x✝⁴ } } } → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) x✝³ : κ x✝² : x✝³ ∈ map Prod.fst (groupByKey xs✝) a✝¹ : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y { fst := xs✝, snd := { fst := ys✝, snd := { fst := x✝⁵, snd := { fst := x✝³, snd := x✝² } } } } → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) xs ys : List (κ × ν) k : κ v : ν hsubl : xs <+ ys x✝¹ : κ hx : x✝¹ ∈ map Prod.fst (groupByKey ((k, v) :: xs)) x✝ : ∀ (y : (xs : List (κ × ν)) ×' (ys : List (κ × ν)) ×' (_ : xs <+ ys) ×' (x : κ) ×' x ∈ map Prod.fst (groupByKey xs)), (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 y { fst := (k, v) :: xs, snd := { fst := (k, v) :: ys, snd := { fst := (_ : (k, v) :: xs <+ (k, v) :: ys), snd := { fst := x✝¹, snd := hx } } } } → y.2.2.2.1 ∈ map Prod.fst (groupByKey y.2.1) b✝ : κ as✝ : List κ htail✝ : Mem x✝¹ as✝ h✝¹ : k :: map Prod.fst (groupByKey (matchKey xs k).snd) = b✝ :: as✝ head_eq✝ : k = b✝ tail_eq✝ : map Prod.fst (groupByKey (matchKey xs k).snd) = as✝ htail : Mem x✝¹ (map Prod.fst (groupByKey (matchKey xs k).snd)) h✝ : HEq (_ : x✝¹ ∈ map Prod.fst (let_fun h_help := (_ : length (matchKey xs k).snd < Nat.succ (length xs)); let fms := matchKey xs k; (k, v :: fms.fst) :: groupByKey fms.snd)) (_ : Mem x✝¹ (k :: map Prod.fst (groupByKey (matchKey xs k).snd))) this : (matchKey xs k).snd <+ (matchKey ys k).snd hterm : length (matchKey ys k).snd < Nat.succ (length ys) x : κ a✝ : x ∈ map Prod.fst (groupByKey (matchKey xs k).snd) ⊢ (invImage (fun a => PSigma.casesOn a fun xs snd => PSigma.casesOn snd fun ys snd => PSigma.casesOn snd fun hsubl snd => PSigma.casesOn snd fun x snd => length ys) instWellFoundedRelation).1 { fst := (matchKey xs k).snd, snd := { fst := (matchKey ys k).snd, snd := { fst := this, snd := { fst := x, snd := a✝ } } } } { fst := (k, v) :: xs, snd := { fst := (k, v) :: ys, snd := { fst := (_ : (k, v) :: xs <+ (k, v) :: ys), snd := { fst := x✝¹, snd := hx } } } }
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
intro h
κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ⊢ k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs
κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) h : k ∈ map Prod.fst (groupByKey kvs) ⊢ k ∈ map Prod.fst kvs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
induction kvs with | nil => contradiction | cons kv kvs ih => cases kv with | mk k₀ v₀ => simp only [groupByKey] at h simp only [map] at h simp only [map] cases h with | head => apply Mem.head | tail _ htail => apply Mem.tail apply ih apply all_in_map_fst_groupByKey_of_sublist (matchKey_snd_sublist k₀ kvs) assumption
κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) h : k ∈ map Prod.fst (groupByKey kvs) ⊢ k ∈ map Prod.fst kvs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
contradiction
case nil κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ h : k ∈ map Prod.fst (groupByKey []) ⊢ k ∈ map Prod.fst []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
cases kv with | mk k₀ v₀ => simp only [groupByKey] at h simp only [map] at h simp only [map] cases h with | head => apply Mem.head | tail _ htail => apply Mem.tail apply ih apply all_in_map_fst_groupByKey_of_sublist (matchKey_snd_sublist k₀ kvs) assumption
case cons κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kv : κ × ν kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs h : k ∈ map Prod.fst (groupByKey (kv :: kvs)) ⊢ k ∈ map Prod.fst (kv :: kvs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
simp only [groupByKey] at h
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ map Prod.fst (groupByKey ((k₀, v₀) :: kvs)) ⊢ k ∈ map Prod.fst ((k₀, v₀) :: kvs)
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ map Prod.fst ((k₀, v₀ :: (matchKey kvs k₀).fst) :: groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ map Prod.fst ((k₀, v₀) :: kvs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
simp only [map] at h
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ map Prod.fst ((k₀, v₀ :: (matchKey kvs k₀).fst) :: groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ map Prod.fst ((k₀, v₀) :: kvs)
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ k₀ :: map Prod.fst (groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ map Prod.fst ((k₀, v₀) :: kvs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
simp only [map]
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ k₀ :: map Prod.fst (groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ map Prod.fst ((k₀, v₀) :: kvs)
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ k₀ :: map Prod.fst (groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ k₀ :: map Prod.fst kvs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
cases h with | head => apply Mem.head | tail _ htail => apply Mem.tail apply ih apply all_in_map_fst_groupByKey_of_sublist (matchKey_snd_sublist k₀ kvs) assumption
case cons.mk κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν h : k ∈ k₀ :: map Prod.fst (groupByKey (matchKey kvs k₀).snd) ⊢ k ∈ k₀ :: map Prod.fst kvs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
apply Mem.head
case cons.mk.head κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs v₀ : ν ⊢ k ∈ k :: map Prod.fst kvs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
apply Mem.tail
case cons.mk.tail κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ k ∈ k₀ :: map Prod.fst kvs
case cons.mk.tail.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ Mem k (map Prod.fst kvs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
apply ih
case cons.mk.tail.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ Mem k (map Prod.fst kvs)
case cons.mk.tail.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ k ∈ map Prod.fst (groupByKey kvs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
apply all_in_map_fst_groupByKey_of_sublist (matchKey_snd_sublist k₀ kvs)
case cons.mk.tail.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ k ∈ map Prod.fst (groupByKey kvs)
case cons.mk.tail.a.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ k ∈ map Prod.fst (groupByKey (matchKey kvs k₀).snd)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_fsts_of_mem_fsts_groupByKey
[1550, 1]
[1566, 17]
assumption
case cons.mk.tail.a.a κ : Type u_1 ν : Type u_2 k : κ inst✝ : DecidableEq κ kvs : List (κ × ν) ih : k ∈ map Prod.fst (groupByKey kvs) → k ∈ map Prod.fst kvs k₀ : κ v₀ : ν htail : Mem k (map Prod.fst (groupByKey (matchKey kvs k₀).snd)) ⊢ k ∈ map Prod.fst (groupByKey (matchKey kvs k₀).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.groupByKey_fsts_no_duplicates
[1577, 1]
[1588, 25]
assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ kvs : List (κ × ν) a✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y kvs → NoDuplicates (map Prod.fst (groupByKey y)) k : κ v : ν xs : List (κ × ν) x✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y ((k, v) :: xs) → NoDuplicates (map Prod.fst (groupByKey y)) h_help : length (matchKey xs k).snd < Nat.succ (length xs) ⊢ (invImage (fun a => length a) instWellFoundedRelation).1 (matchKey xs k).snd ((k, v) :: xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
have ih := @mem_map α β f b xs
α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ⊢ b ∈ map f (x :: xs) ↔ ∃ a, a ∈ x :: xs ∧ f a = b
α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ b ∈ map f (x :: xs) ↔ ∃ a, a ∈ x :: xs ∧ f a = b
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
apply Iff.intro
α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ b ∈ map f (x :: xs) ↔ ∃ a, a ∈ x :: xs ∧ f a = b
case mp α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ b ∈ map f (x :: xs) → ∃ a, a ∈ x :: xs ∧ f a = b case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ (∃ a, a ∈ x :: xs ∧ f a = b) → b ∈ map f (x :: xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
. intro h cases h with | head => exact Exists.intro x (And.intro (List.Mem.head _) rfl) | tail x h' => have ih_val := ih.mp h' cases ih_val with | intro a ha => exact Exists.intro a (And.intro (Mem.tail _ ha.left) ha.right)
case mp α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ b ∈ map f (x :: xs) → ∃ a, a ∈ x :: xs ∧ f a = b case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ (∃ a, a ∈ x :: xs ∧ f a = b) → b ∈ map f (x :: xs)
case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ (∃ a, a ∈ x :: xs ∧ f a = b) → b ∈ map f (x :: xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
. intro h cases h with | intro a ha => simp only [map] cases ha.left with | head => rw [ha.right]; constructor | tail x h' => have h_in_tail := ih.mpr (Exists.intro a ⟨h', ha.right⟩) exact Mem.tail _ h_in_tail
case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ (∃ a, a ∈ x :: xs ∧ f a = b) → b ∈ map f (x :: xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
intro h
case mp α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ b ∈ map f (x :: xs) → ∃ a, a ∈ x :: xs ∧ f a = b
case mp α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h : b ∈ map f (x :: xs) ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
cases h with | head => exact Exists.intro x (And.intro (List.Mem.head _) rfl) | tail x h' => have ih_val := ih.mp h' cases ih_val with | intro a ha => exact Exists.intro a (And.intro (Mem.tail _ ha.left) ha.right)
case mp α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h : b ∈ map f (x :: xs) ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
exact Exists.intro x (And.intro (List.Mem.head _) rfl)
case mp.head α : Type u_1 β : Type u_2 f : α → β x : α xs : List α ih : f x ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = f x ⊢ ∃ a, a ∈ x :: xs ∧ f a = f x
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
have ih_val := ih.mp h'
case mp.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h' : Mem b (map f xs) ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
case mp.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h' : Mem b (map f xs) ih_val : ∃ a, a ∈ xs ∧ f a = b ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
cases ih_val with | intro a ha => exact Exists.intro a (And.intro (Mem.tail _ ha.left) ha.right)
case mp.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h' : Mem b (map f xs) ih_val : ∃ a, a ∈ xs ∧ f a = b ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
exact Exists.intro a (And.intro (Mem.tail _ ha.left) ha.right)
case mp.tail.intro α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h' : Mem b (map f xs) a : α ha : a ∈ xs ∧ f a = b ⊢ ∃ a, a ∈ x :: xs ∧ f a = b
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
intro h
case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ⊢ (∃ a, a ∈ x :: xs ∧ f a = b) → b ∈ map f (x :: xs)
case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h : ∃ a, a ∈ x :: xs ∧ f a = b ⊢ b ∈ map f (x :: xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
cases h with | intro a ha => simp only [map] cases ha.left with | head => rw [ha.right]; constructor | tail x h' => have h_in_tail := ih.mpr (Exists.intro a ⟨h', ha.right⟩) exact Mem.tail _ h_in_tail
case mpr α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b h : ∃ a, a ∈ x :: xs ∧ f a = b ⊢ b ∈ map f (x :: xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
simp only [map]
case mpr.intro α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b ⊢ b ∈ map f (x :: xs)
case mpr.intro α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b ⊢ b ∈ f x :: map f xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
cases ha.left with | head => rw [ha.right]; constructor | tail x h' => have h_in_tail := ih.mpr (Exists.intro a ⟨h', ha.right⟩) exact Mem.tail _ h_in_tail
case mpr.intro α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b ⊢ b ∈ f x :: map f xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
rw [ha.right]
case mpr.intro.head α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ha : x ∈ x :: xs ∧ f x = b ⊢ b ∈ f x :: map f xs
case mpr.intro.head α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ha : x ∈ x :: xs ∧ f x = b ⊢ b ∈ b :: map f xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
constructor
case mpr.intro.head α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b ha : x ∈ x :: xs ∧ f x = b ⊢ b ∈ b :: map f xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
have h_in_tail := ih.mpr (Exists.intro a ⟨h', ha.right⟩)
case mpr.intro.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b h' : Mem a xs ⊢ b ∈ f x :: map f xs
case mpr.intro.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b h' : Mem a xs h_in_tail : b ∈ map f xs ⊢ b ∈ f x :: map f xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.mem_map
[1591, 1]
[1612, 33]
exact Mem.tail _ h_in_tail
case mpr.intro.tail α : Type u_1 β : Type u_2 f : α → β b : β x : α xs : List α ih : b ∈ map f xs ↔ ∃ a, a ∈ xs ∧ f a = b a : α ha : a ∈ x :: xs ∧ f a = b h' : Mem a xs h_in_tail : b ∈ map f xs ⊢ b ∈ f x :: map f xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_map_fst
[1651, 1]
[1661, 26]
simp only [map, incrCounts]
α : Type u_1 inst✝ : DecidableEq α x : α snd✝ : Nat as : List (α × Nat) ⊢ map Prod.fst (incrCounts ((x, snd✝) :: as) x) = map Prod.fst ((x, snd✝) :: as)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.map_fst_incrCounts_eq_map_fst
[1651, 1]
[1661, 26]
simp only [map, incrCounts, heq, ite_true, map]
α : 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 heq : a.fst = x ⊢ map Prod.fst (incrCounts (a :: as) x) = map Prod.fst (a :: as)
no goals