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.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
apply funext
α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) ⊢ (fun x_1 => decide ¬x_1 ∈ x :: acc) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) ⊢ ∀ (x_1 : α), (decide ¬x_1 ∈ x :: acc) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
intros a
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) ⊢ ∀ (x_1 : α), (decide ¬x_1 ∈ x :: acc) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) a : α ⊢ (decide ¬a ∈ x :: acc) = decide (¬a ∈ acc ∧ ¬a ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
apply Decidable.prop_eq_of_decide_eq
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) a : α ⊢ (decide ¬a ∈ x :: acc) = decide (¬a ∈ acc ∧ ¬a ∈ [x])
case h.a α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) a : α ⊢ (¬a ∈ x :: acc) = (¬a ∈ acc ∧ ¬a ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
rw [h_mem_iff_neg, not_or_distrib, And.comm]
case h.a α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc this : (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x]) h_mem_iff : ∀ (x_1 : α), x_1 ∈ x :: acc ↔ x_1 ∈ [x] ∨ x_1 ∈ acc h_mem_iff_neg : ∀ (x_1 : α), ¬x_1 ∈ x :: acc ↔ ¬(x_1 ∈ [x] ∨ x_1 ∈ acc) a : α ⊢ (¬a ∈ x :: acc) = (¬a ∈ acc ∧ ¬a ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
apply funext
α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc ⊢ (fun x_1 => decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true)) = fun x_1 => decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc ⊢ ∀ (x_1 : α), decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
intro x_1
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_1 => decide ¬x_1 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_1 => decide ¬x_1 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc ⊢ ∀ (x_1 : α), decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α ⊢ decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
simp only [decide_not, Bool.not_eq_true']
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α ⊢ decide ((decide ¬x_1 ∈ acc) = true ∧ (decide ¬x_1 ∈ [x]) = true) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α ⊢ decide (decide (x_1 ∈ acc) = false ∧ decide (x_1 ∈ [x]) = false) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
cases Decidable.em (x_1 ∈ acc) with | inl hmem => simp only [hmem, decide_True, not_true_eq_false, false_and] | inr hnmem => simp only [hnmem, decide_False, not_false_eq_true, true_and, decide_not] cases Decidable.em (x_1 ∈ [x]) with | inl hmem' => simp only [hmem', decide_True, decide_False, not] | inr hnmem' => simp only [hnmem', decide_True, decide_False, not]
case h α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α ⊢ decide (decide (x_1 ∈ acc) = false ∧ decide (x_1 ∈ [x]) = false) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
simp only [hmem, decide_True, not_true_eq_false, false_and]
case h.inl α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hmem : x_1 ∈ acc ⊢ decide (decide (x_1 ∈ acc) = false ∧ decide (x_1 ∈ [x]) = false) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
simp only [hnmem, decide_False, not_false_eq_true, true_and, decide_not]
case h.inr α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hnmem : ¬x_1 ∈ acc ⊢ decide (decide (x_1 ∈ acc) = false ∧ decide (x_1 ∈ [x]) = false) = decide (¬x_1 ∈ acc ∧ ¬x_1 ∈ [x])
case h.inr α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hnmem : ¬x_1 ∈ acc ⊢ decide (decide (x_1 ∈ [x]) = false) = !decide (x_1 ∈ [x])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
cases Decidable.em (x_1 ∈ [x]) with | inl hmem' => simp only [hmem', decide_True, decide_False, not] | inr hnmem' => simp only [hnmem', decide_True, decide_False, not]
case h.inr α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hnmem : ¬x_1 ∈ acc ⊢ decide (decide (x_1 ∈ [x]) = false) = !decide (x_1 ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
simp only [hmem', decide_True, decide_False, not]
case h.inr.inl α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hnmem : ¬x_1 ∈ acc hmem' : x_1 ∈ [x] ⊢ decide (decide (x_1 ∈ [x]) = false) = !decide (x_1 ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
simp only [hnmem', decide_True, decide_False, not]
case h.inr.inr α : Type u_1 inst✝ : DecidableEq α x : α xs acc : List α hterm : length (filter (fun a => decide ¬a ∈ acc) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ih₁ : uniqueAux xs acc = reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) ih₂ : uniqueAux xs (x :: acc) = reverse (x :: acc) ++ unique (filter (fun x_2 => decide ¬x_2 ∈ x :: acc) xs) ih₃ : uniqueAux (filter (fun a => decide ¬a ∈ acc) xs) [x] = reverse [x] ++ unique (filter (fun x_2 => decide ¬x_2 ∈ [x]) (filter (fun a => decide ¬a ∈ acc) xs)) hout : ¬x ∈ acc x_1 : α hnmem : ¬x_1 ∈ acc hnmem' : ¬x_1 ∈ [x] ⊢ decide (decide (x_1 ∈ [x]) = false) = !decide (x_1 ∈ [x])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append_filter
[1075, 1]
[1134, 25]
assumption
α : Type u_1 inst✝ : DecidableEq α _x✝ : (_ : List α) ×' List α a✝¹ : ∀ (y : (_ : List α) ×' List α), (invImage (fun a => PSigma.casesOn a fun xs snd => length xs) instWellFoundedRelation).1 y _x✝ → uniqueAux y.1 y.2 = reverse y.2 ++ unique (filter (fun x => decide ¬x ∈ y.2) y.1) x✝² x✝¹ : List α a✝ : ∀ (y : (_ : List α) ×' List α), (invImage (fun a => PSigma.casesOn a fun xs snd => length xs) instWellFoundedRelation).1 y { fst := x✝², snd := x✝¹ } → uniqueAux y.1 y.2 = reverse y.2 ++ unique (filter (fun x => decide ¬x ∈ y.2) y.1) x : α xs ys : List α x✝ : ∀ (y : (_ : List α) ×' List α), (invImage (fun a => PSigma.casesOn a fun xs snd => length xs) instWellFoundedRelation).1 y { fst := x :: xs, snd := ys } → uniqueAux y.1 y.2 = reverse y.2 ++ unique (filter (fun x => decide ¬x ∈ y.2) y.1) hterm : length (filter (fun a => decide ¬a ∈ ys) xs) < Nat.succ (length xs) hterm' : length xs < Nat.succ (length xs) ⊢ (invImage (fun a => PSigma.casesOn a fun xs snd => length xs) instWellFoundedRelation).1 { fst := xs, snd := ys } { fst := x :: xs, snd := ys }
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
have : filter (fun a => decide ¬a ∈ acc) xs = xs := by induction xs with | nil => simp [filter] | cons x xs ih => simp only [filter] have : decide (¬x ∈ acc) = true := by simp [h x (Mem.head _)] rw [this] simp only rw [ih] . intros x hx apply h x (Mem.tail _ hx)
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc ⊢ uniqueAux xs acc = reverse acc ++ unique xs
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) xs = xs ⊢ uniqueAux xs acc = reverse acc ++ unique xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
rw [uniqueAux_acc_append_filter]
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) xs = xs ⊢ uniqueAux xs acc = reverse acc ++ unique xs
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) xs = xs ⊢ reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) = reverse acc ++ unique xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
cases xs with | nil => apply congrArg; simp [filter] | cons x xs => apply congrArg rw [this]
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) xs = xs ⊢ reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) xs) = reverse acc ++ unique xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
induction xs with | nil => simp [filter] | cons x xs ih => simp only [filter] have : decide (¬x ∈ acc) = true := by simp [h x (Mem.head _)] rw [this] simp only rw [ih] . intros x hx apply h x (Mem.tail _ hx)
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc ⊢ filter (fun a => decide ¬a ∈ acc) xs = xs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
simp [filter]
case nil α : Type u_1 inst✝ : DecidableEq α acc : List α h : ∀ (x : α), x ∈ [] → ¬x ∈ acc ⊢ filter (fun a => decide ¬a ∈ acc) [] = []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
simp only [filter]
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc ⊢ filter (fun a => decide ¬a ∈ acc) (x :: xs) = x :: xs
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc ⊢ (match decide ¬x ∈ acc with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
have : decide (¬x ∈ acc) = true := by simp [h x (Mem.head _)]
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc ⊢ (match decide ¬x ∈ acc with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ (match decide ¬x ∈ acc with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
rw [this]
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ (match decide ¬x ∈ acc with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ (match true with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
simp only
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ (match true with | true => x :: filter (fun a => decide ¬a ∈ acc) xs | false => filter (fun a => decide ¬a ∈ acc) xs) = x :: xs
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ x :: filter (fun a => decide ¬a ∈ acc) xs = x :: xs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
rw [ih]
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ x :: filter (fun a => decide ¬a ∈ acc) xs = x :: xs
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ ∀ (x : α), x ∈ xs → ¬x ∈ acc
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
. intros x hx apply h x (Mem.tail _ hx)
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ ∀ (x : α), x ∈ xs → ¬x ∈ acc
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
simp [h x (Mem.head _)]
α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc ⊢ (decide ¬x ∈ acc) = true
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
intros x hx
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : (decide ¬x ∈ acc) = true ⊢ ∀ (x : α), x ∈ xs → ¬x ∈ acc
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x✝ : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x : α), x ∈ x✝ :: xs → ¬x ∈ acc this : (decide ¬x✝ ∈ acc) = true x : α hx : x ∈ xs ⊢ ¬x ∈ acc
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
apply h x (Mem.tail _ hx)
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x✝ : α xs : List α ih : (∀ (x : α), x ∈ xs → ¬x ∈ acc) → filter (fun a => decide ¬a ∈ acc) xs = xs h : ∀ (x : α), x ∈ x✝ :: xs → ¬x ∈ acc this : (decide ¬x✝ ∈ acc) = true x : α hx : x ∈ xs ⊢ ¬x ∈ acc
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
apply congrArg
case nil α : Type u_1 inst✝ : DecidableEq α acc : List α h : ∀ (x : α), x ∈ [] → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) [] = [] ⊢ reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) []) = reverse acc ++ unique []
case nil.h α : Type u_1 inst✝ : DecidableEq α acc : List α h : ∀ (x : α), x ∈ [] → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) [] = [] ⊢ unique (filter (fun x => decide ¬x ∈ acc) []) = unique []
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
simp [filter]
case nil.h α : Type u_1 inst✝ : DecidableEq α acc : List α h : ∀ (x : α), x ∈ [] → ¬x ∈ acc this : filter (fun a => decide ¬a ∈ acc) [] = [] ⊢ unique (filter (fun x => decide ¬x ∈ acc) []) = unique []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
apply congrArg
case cons α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : filter (fun a => decide ¬a ∈ acc) (x :: xs) = x :: xs ⊢ reverse acc ++ unique (filter (fun x => decide ¬x ∈ acc) (x :: xs)) = reverse acc ++ unique (x :: xs)
case cons.h α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : filter (fun a => decide ¬a ∈ acc) (x :: xs) = x :: xs ⊢ unique (filter (fun x => decide ¬x ∈ acc) (x :: xs)) = unique (x :: xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.uniqueAux_acc_append
[1136, 1]
[1155, 14]
rw [this]
case cons.h α : Type u_1 inst✝ : DecidableEq α acc : List α x : α xs : List α h : ∀ (x_1 : α), x_1 ∈ x :: xs → ¬x_1 ∈ acc this : filter (fun a => decide ¬a ∈ acc) (x :: xs) = x :: xs ⊢ unique (filter (fun x => decide ¬x ∈ acc) (x :: xs)) = unique (x :: xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux
[1157, 1]
[1160, 79]
rw [uniqueAux_acc_append _ _ h, length_append, length_reverse, Nat.add_comm]
α : Type u_1 inst✝ : DecidableEq α xs acc : List α h : ∀ (x : α), x ∈ xs → ¬x ∈ acc ⊢ length (uniqueAux xs acc) = length (unique xs) + length acc
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
intros xs k
κ : Type u_1 ν : Type u_2 inst : DecidableEq κ ⊢ ∀ (xs : List (κ × ν)) (k : κ), (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs)
κ : Type u_1 ν : Type u_2 inst : DecidableEq κ xs : List (κ × ν) k : κ ⊢ (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
induction xs with | nil => rfl | cons x xs ih => simp only [matchKey] cases inst x.1 k with | isFalse hfalse => simp only [hfalse, ite_false, ih, filter] exact rfl | isTrue htrue => simp [htrue, ite_true, filter, ih, map]
κ : Type u_1 ν : Type u_2 inst : DecidableEq κ xs : List (κ × ν) k : κ ⊢ (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
rfl
case nil κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ ⊢ (matchKey [] k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) [])
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
simp only [matchKey]
case cons κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) ⊢ (matchKey (x :: xs) k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) (x :: xs))
case cons κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) ⊢ (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) (x :: xs))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
cases inst x.1 k with | isFalse hfalse => simp only [hfalse, ite_false, ih, filter] exact rfl | isTrue htrue => simp [htrue, ite_true, filter, ih, map]
case cons κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) ⊢ (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) (x :: xs))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
simp only [hfalse, ite_false, ih, filter]
case cons.isFalse κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) hfalse : ¬x.fst = k ⊢ (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) (x :: xs))
case cons.isFalse κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) hfalse : ¬x.fst = k ⊢ map Prod.snd (filter (fun x => decide (x.fst = k)) xs) = map Prod.snd (match decide False with | true => x :: filter (fun x => decide (x.fst = k)) xs | false => filter (fun x => decide (x.fst = k)) xs)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
exact rfl
case cons.isFalse κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) hfalse : ¬x.fst = k ⊢ map Prod.snd (filter (fun x => decide (x.fst = k)) xs) = map Prod.snd (match decide False with | true => x :: filter (fun x => decide (x.fst = k)) xs | false => filter (fun x => decide (x.fst = k)) xs)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_fst_eq_filter_k_map_snd
[1212, 1]
[1225, 47]
simp [htrue, ite_true, filter, ih, map]
case cons.isTrue κ : Type u_1 ν : Type u_2 inst : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : (matchKey xs k).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) xs) htrue : x.fst = k ⊢ (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).fst = map Prod.snd (filter (fun x => decide (x.fst = k)) (x :: xs))
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.groupByKey_matchKey_snd_length_cons
[1243, 1]
[1254, 48]
simp only [matchKey, length, ite_true]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ v : ν xs : List (κ × ν) ⊢ 1 + length (groupByKey (matchKey ((k, v) :: xs) k).snd) = 1 + length (groupByKey (matchKey xs k).snd)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
induction xs with | nil => intros; simp [uniqueAux] | cons x xs ih => intros acc hk simp only [length, uniqueAux] cases Decidable.em (x.fst ∈ acc) with | inl hin => simp only [hin, ite_true, matchKey] rw [ih _ hk] cases Decidable.em (x.1 = k) with | inl heq => simp only [heq, ite_true] | inr hneq => simp only [hneq, ite_false, map, uniqueAux, hin, ite_true] | inr hout => simp only [hout, ite_false, matchKey] cases Decidable.em (x.1 = k) with | inl heq => apply absurd hk rw [heq] at hout exact hout | inr hneq => rw [ih _ (List.Mem.tail _ hk)] simp only [hneq, ite_false, uniqueAux, hout]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ xs : List (κ × ν) k : κ ⊢ ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
intros
case nil κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ ⊢ ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst []) acc) = length (uniqueAux (map Prod.fst (matchKey [] k).snd) acc)
case nil κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ acc✝ : List κ hk✝ : k ∈ acc✝ ⊢ length (uniqueAux (map Prod.fst []) acc✝) = length (uniqueAux (map Prod.fst (matchKey [] k).snd) acc✝)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp [uniqueAux]
case nil κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ acc✝ : List κ hk✝ : k ∈ acc✝ ⊢ length (uniqueAux (map Prod.fst []) acc✝) = length (uniqueAux (map Prod.fst (matchKey [] k).snd) acc✝)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
intros acc hk
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) ⊢ ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst (x :: xs)) acc) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc ⊢ length (uniqueAux (map Prod.fst (x :: xs)) acc) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [length, uniqueAux]
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc ⊢ length (uniqueAux (map Prod.fst (x :: xs)) acc) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc ⊢ length (if x.fst ∈ acc then uniqueAux (map Prod.fst xs) acc else uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
cases Decidable.em (x.fst ∈ acc) with | inl hin => simp only [hin, ite_true, matchKey] rw [ih _ hk] cases Decidable.em (x.1 = k) with | inl heq => simp only [heq, ite_true] | inr hneq => simp only [hneq, ite_false, map, uniqueAux, hin, ite_true] | inr hout => simp only [hout, ite_false, matchKey] cases Decidable.em (x.1 = k) with | inl heq => apply absurd hk rw [heq] at hout exact hout | inr hneq => rw [ih _ (List.Mem.tail _ hk)] simp only [hneq, ite_false, uniqueAux, hout]
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc ⊢ length (if x.fst ∈ acc then uniqueAux (map Prod.fst xs) acc else uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [hin, ite_true, matchKey]
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc ⊢ length (if x.fst ∈ acc then uniqueAux (map Prod.fst xs) acc else uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
rw [ih _ hk]
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
cases Decidable.em (x.1 = k) with | inl heq => simp only [heq, ite_true] | inr hneq => simp only [hneq, ite_false, map, uniqueAux, hin, ite_true]
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [heq, ite_true]
case cons.inl.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc heq : x.fst = k ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [hneq, ite_false, map, uniqueAux, hin, ite_true]
case cons.inl.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hin : x.fst ∈ acc hneq : ¬x.fst = k ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [hout, ite_false, matchKey]
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc ⊢ length (if x.fst ∈ acc then uniqueAux (map Prod.fst xs) acc else uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (matchKey (x :: xs) k).snd) acc)
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
cases Decidable.em (x.1 = k) with | inl heq => apply absurd hk rw [heq] at hout exact hout | inr hneq => rw [ih _ (List.Mem.tail _ hk)] simp only [hneq, ite_false, uniqueAux, hout]
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc ⊢ length (uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
apply absurd hk
case cons.inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc heq : x.fst = k ⊢ length (uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
case cons.inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc heq : x.fst = k ⊢ ¬k ∈ acc
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
rw [heq] at hout
case cons.inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc heq : x.fst = k ⊢ ¬k ∈ acc
case cons.inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬k ∈ acc heq : x.fst = k ⊢ ¬k ∈ acc
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
exact hout
case cons.inr.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬k ∈ acc heq : x.fst = k ⊢ ¬k ∈ acc
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
rw [ih _ (List.Mem.tail _ hk)]
case cons.inr.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc hneq : ¬x.fst = k ⊢ length (uniqueAux (map Prod.fst xs) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
case cons.inr.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc hneq : ¬x.fst = k ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_uniqueAux_matchKey
[1256, 1]
[1282, 54]
simp only [hneq, ite_false, uniqueAux, hout]
case cons.inr.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ x : κ × ν xs : List (κ × ν) ih : ∀ (acc : List κ), k ∈ acc → length (uniqueAux (map Prod.fst xs) acc) = length (uniqueAux (map Prod.fst (matchKey xs k).snd) acc) acc : List κ hk : k ∈ acc hout : ¬x.fst ∈ acc hneq : ¬x.fst = k ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) (x.fst :: acc)) = length (uniqueAux (map Prod.fst (if x.fst = k then (x.snd :: (matchKey xs k).fst, (matchKey xs k).snd) else ((matchKey xs k).fst, (x.fst, x.snd) :: (matchKey xs k).snd)).snd) acc)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
have hterm : length (matchKey xs k).snd < Nat.succ (length xs) := Nat.lt_of_succ_le $ Nat.succ_le_succ $ matchKey_snd_length xs k
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) ⊢ length (groupByKey ((k, v) :: xs)) = length (unique (map Prod.fst ((k, v) :: xs)))
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ⊢ length (groupByKey ((k, v) :: xs)) = length (unique (map Prod.fst ((k, v) :: xs)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
have ih := length_groupByKey (matchKey xs k).2
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ⊢ length (groupByKey ((k, v) :: xs)) = length (unique (map Prod.fst ((k, v) :: xs)))
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey ((k, v) :: xs)) = length (unique (map Prod.fst ((k, v) :: xs)))
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
simp only [map, unique, uniqueAux, List.not_mem_nil, ite_false, groupByKey]
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey ((k, v) :: xs)) = length (unique (map Prod.fst ((k, v) :: xs)))
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length ((k, v :: (matchKey xs k).fst) :: groupByKey (matchKey xs k).snd) = length (uniqueAux (map Prod.fst xs) [k])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
simp only [length]
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length ((k, v :: (matchKey xs k).fst) :: groupByKey (matchKey xs k).snd) = length (uniqueAux (map Prod.fst xs) [k])
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey (matchKey xs k).snd) + 1 = length (uniqueAux (map Prod.fst xs) [k])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
rw [length_uniqueAux_matchKey _ k _ $ List.Mem.head _]
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey (matchKey xs k).snd) + 1 = length (uniqueAux (map Prod.fst xs) [k])
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey (matchKey xs k).snd) + 1 = length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
rw [ih]
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (groupByKey (matchKey xs k).snd) + 1 = length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k])
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (unique (map Prod.fst (matchKey xs k).snd)) + 1 = length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k])
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
apply Eq.symm
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (unique (map Prod.fst (matchKey xs k).snd)) + 1 = length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k])
case h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k]) = length (unique (map Prod.fst (matchKey xs k).snd)) + 1
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
apply List.length_uniqueAux (acc := [k])
case h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ length (uniqueAux (map Prod.fst (matchKey xs k).snd) [k]) = length (unique (map Prod.fst (matchKey xs k).snd)) + 1
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ ∀ (x : κ), x ∈ map Prod.fst (matchKey xs k).snd → ¬x ∈ [k]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
intro x
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) ⊢ ∀ (x : κ), x ∈ map Prod.fst (matchKey xs k).snd → ¬x ∈ [k]
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ ⊢ x ∈ map Prod.fst (matchKey xs k).snd → ¬x ∈ [k]
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
rw [mem_singleton_iff]
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ ⊢ x ∈ map Prod.fst (matchKey xs k).snd → ¬x ∈ [k]
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ ⊢ x ∈ map Prod.fst (matchKey xs k).snd → ¬x = k
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
intro hmem hneg
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ ⊢ x ∈ map Prod.fst (matchKey xs k).snd → ¬x = k
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs k).snd hneg : x = k ⊢ False
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
have := not_mem_matchKey_self_map_snd x xs
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs k).snd hneg : x = k ⊢ False
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs k).snd hneg : x = k this : ¬x ∈ map Prod.fst (matchKey xs x).snd ⊢ False
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
rw [←hneg] at hmem
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs k).snd hneg : x = k this : ¬x ∈ map Prod.fst (matchKey xs x).snd ⊢ False
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs x).snd hneg : x = k this : ¬x ∈ map Prod.fst (matchKey xs x).snd ⊢ False
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
exact this hmem
case h.h κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 k : κ v : ν xs : List (κ × ν) hterm : length (matchKey xs k).snd < Nat.succ (length xs) ih : length (groupByKey (matchKey xs k).snd) = length (unique (map Prod.fst (matchKey xs k).snd)) x : κ hmem : x ∈ map Prod.fst (matchKey xs x).snd hneg : x = k this : ¬x ∈ map Prod.fst (matchKey xs x).snd ⊢ False
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.length_groupByKey
[1294, 1]
[1316, 25]
assumption
κ : Type u_1 inst✝ : DecidableEq κ ν : Type u_2 xs✝ : List (κ × ν) a✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y xs✝ → length (groupByKey y) = length (unique (map Prod.fst y)) k : κ v : ν xs : List (κ × ν) x✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y ((k, v) :: xs) → length (groupByKey y) = length (unique (map Prod.fst y)) hterm : 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.matchKey_snd_sublist
[1324, 1]
[1331, 74]
simp only [matchKey, h, ite_true]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : kv.fst = k ⊢ (matchKey (kv :: kvs) k).snd <+ kv :: kvs
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : kv.fst = k ⊢ (matchKey kvs k).snd <+ kv :: kvs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist
[1324, 1]
[1331, 74]
exact Sublist.cons _ _ _ ih
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : kv.fst = k ⊢ (matchKey kvs k).snd <+ kv :: kvs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist
[1324, 1]
[1331, 74]
simp only [matchKey, h, ite_true]
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : ¬kv.fst = k ⊢ (matchKey (kv :: kvs) k).snd <+ kv :: kvs
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : ¬kv.fst = k ⊢ (if False then (kv.snd :: (matchKey kvs k).fst, (matchKey kvs k).snd) else ((matchKey kvs k).fst, (kv.fst, kv.snd) :: (matchKey kvs k).snd)).snd <+ kv :: kvs
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist
[1324, 1]
[1331, 74]
exact Sublist.cons2 _ _ _ ih
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ kv : κ × ν kvs : List (κ × ν) ih : (matchKey kvs k).snd <+ kvs h : ¬kv.fst = k ⊢ (if False then (kv.snd :: (matchKey kvs k).fst, (matchKey kvs k).snd) else ((matchKey kvs k).fst, (kv.fst, kv.snd) :: (matchKey kvs k).snd)).snd <+ kv :: kvs
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
intro k xs ys h
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ ⊢ ∀ (k : κ) (xs ys : List (κ × ν)), xs <+ ys → (matchKey xs k).snd <+ (matchKey ys k).snd
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) h : xs <+ ys ⊢ (matchKey xs k).snd <+ (matchKey ys k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
induction h with | nil => constructor | cons xs' ys' x' h' ih => simp only [matchKey] cases Decidable.em (x'.fst = k) with | inl heq => simp only [heq, ite_true]; apply ih | inr hneq => simp only [hneq, ite_false]; apply Sublist.cons _ _ _ ih | cons2 xs' ys' x' h' ih => simp only [matchKey] cases Decidable.em (x'.fst = k) with | inl heq => simp only [heq, ite_true]; assumption | inr hneq => simp only [hneq, ite_false] apply Sublist.cons2 _ _ _ ih
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) h : xs <+ ys ⊢ (matchKey xs k).snd <+ (matchKey ys k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
constructor
case nil κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) ⊢ (matchKey [] k).snd <+ (matchKey [] k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [matchKey]
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (matchKey xs' k).snd <+ (matchKey (x' :: ys') k).snd
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (matchKey xs' k).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
cases Decidable.em (x'.fst = k) with | inl heq => simp only [heq, ite_true]; apply ih | inr hneq => simp only [hneq, ite_false]; apply Sublist.cons _ _ _ ih
case cons κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (matchKey xs' k).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [heq, ite_true]
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (matchKey xs' k).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (matchKey xs' k).snd <+ (matchKey ys' k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
apply ih
case cons.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (matchKey xs' k).snd <+ (matchKey ys' k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [hneq, ite_false]
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (matchKey xs' k).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (matchKey xs' k).snd <+ (x'.fst, x'.snd) :: (matchKey ys' k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
apply Sublist.cons _ _ _ ih
case cons.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (matchKey xs' k).snd <+ (x'.fst, x'.snd) :: (matchKey ys' k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [matchKey]
case cons2 κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (matchKey (x' :: xs') k).snd <+ (matchKey (x' :: ys') k).snd
case cons2 κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (if x'.fst = k then (x'.snd :: (matchKey xs' k).fst, (matchKey xs' k).snd) else ((matchKey xs' k).fst, (x'.fst, x'.snd) :: (matchKey xs' k).snd)).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
cases Decidable.em (x'.fst = k) with | inl heq => simp only [heq, ite_true]; assumption | inr hneq => simp only [hneq, ite_false] apply Sublist.cons2 _ _ _ ih
case cons2 κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd ⊢ (if x'.fst = k then (x'.snd :: (matchKey xs' k).fst, (matchKey xs' k).snd) else ((matchKey xs' k).fst, (x'.fst, x'.snd) :: (matchKey xs' k).snd)).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [heq, ite_true]
case cons2.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (if x'.fst = k then (x'.snd :: (matchKey xs' k).fst, (matchKey xs' k).snd) else ((matchKey xs' k).fst, (x'.fst, x'.snd) :: (matchKey xs' k).snd)).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
case cons2.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (matchKey xs' k).snd <+ (matchKey ys' k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
assumption
case cons2.inl κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd heq : x'.fst = k ⊢ (matchKey xs' k).snd <+ (matchKey ys' k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
simp only [hneq, ite_false]
case cons2.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (if x'.fst = k then (x'.snd :: (matchKey xs' k).fst, (matchKey xs' k).snd) else ((matchKey xs' k).fst, (x'.fst, x'.snd) :: (matchKey xs' k).snd)).snd <+ (if x'.fst = k then (x'.snd :: (matchKey ys' k).fst, (matchKey ys' k).snd) else ((matchKey ys' k).fst, (x'.fst, x'.snd) :: (matchKey ys' k).snd)).snd
case cons2.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (x'.fst, x'.snd) :: (matchKey xs' k).snd <+ (x'.fst, x'.snd) :: (matchKey ys' k).snd
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.matchKey_snd_sublist_of_sublist
[1333, 1]
[1350, 35]
apply Sublist.cons2 _ _ _ ih
case cons2.inr κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ k : κ xs ys : List (κ × ν) xs' ys' : List (κ × ν) x' : κ × ν h' : xs' <+ ys' ih : (matchKey xs' k).snd <+ (matchKey ys' k).snd hneq : ¬x'.fst = k ⊢ (x'.fst, x'.snd) :: (matchKey xs' k).snd <+ (x'.fst, x'.snd) :: (matchKey ys' k).snd
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/BuiltinExtensions.lean
List.fst_groupByKey_sublist
[1359, 1]
[1369, 25]
assumption
κ : Type u_1 ν : Type u_2 inst✝ : DecidableEq κ kvs : List (κ × ν) a✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y kvs → map Prod.fst (groupByKey y) <+ map Prod.fst y k : κ v : ν xs : List (κ × ν) x✝ : ∀ (y : List (κ × ν)), (invImage (fun a => length a) instWellFoundedRelation).1 y ((k, v) :: xs) → map Prod.fst (groupByKey y) <+ map Prod.fst y hterm : 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_fst_matchKey_key_or_snd
[1373, 1]
[1418, 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 (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 (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_matchKey_key_or_snd
[1373, 1]
[1418, 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_matchKey_key_or_snd this k cases ih with | inl => contradiction | inr hmem => exact hmem | inr hkneq => simp only [hkneq, ite_false] 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_matchKey_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 (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_matchKey_key_or_snd
[1373, 1]
[1418, 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 (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 (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 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 (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 (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 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 (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 (matchKey ys k).snd ⊢ x ∈ map Prod.fst (matchKey ys k).snd