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/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_08/Diaphontine.lean
eqn_solvable_divides
[50, 1]
[62, 32]
apply Int.gcd_dvd_right
a b c x y : ℤ h : a * x + b * y = c ⊢ ↑(Int.gcd a b) ∣ b
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_08/Diaphontine.lean
eqn_solvable_divides
[50, 1]
[62, 32]
apply Int.dvd_mul_right
a b c x y : ℤ h : a * x + b * y = c ⊢ b ∣ b * y
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
match m, n, hyp with | m, 0, _ => simp [minus] | 0, _ +1, pf => contradiction | m + 1, n + 1 , pf => simp [minus] rw [← add_assoc] simp [minus_add_cancel]
m n : ℕ hyp : n ≤ m ⊢ minus m n hyp + n = m
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
simp [minus]
m✝ n : ℕ hyp : n ≤ m✝ m : ℕ x✝ : 0 ≤ m ⊢ minus m 0 x✝ + 0 = m
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
contradiction
m n : ℕ hyp : n ≤ m n✝ : ℕ pf : n✝ + 1 ≤ 0 ⊢ minus 0 (n✝ + 1) pf + (n✝ + 1) = 0
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
simp [minus]
m✝ n✝ : ℕ hyp : n✝ ≤ m✝ m n : ℕ pf : n + 1 ≤ m + 1 ⊢ minus (m + 1) (n + 1) pf + (n + 1) = m + 1
m✝ n✝ : ℕ hyp : n✝ ≤ m✝ m n : ℕ pf : n + 1 ≤ m + 1 ⊢ minus m n ⋯ + (n + 1) = m + 1
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
rw [← add_assoc]
m✝ n✝ : ℕ hyp : n✝ ≤ m✝ m n : ℕ pf : n + 1 ≤ m + 1 ⊢ minus m n ⋯ + (n + 1) = m + 1
m✝ n✝ : ℕ hyp : n✝ ≤ m✝ m n : ℕ pf : n + 1 ≤ m + 1 ⊢ minus m n ⋯ + n + 1 = m + 1
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMinus.lean
Nat.minus_add_cancel
[42, 1]
[51, 28]
simp [minus_add_cancel]
m✝ n✝ : ℕ hyp : n✝ ≤ m✝ m n : ℕ pf : n + 1 ≤ m + 1 ⊢ minus m n ⋯ + n + 1 = m + 1
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_11/NatLe.lean
four_le_seven
[106, 1]
[115, 20]
apply Nat.le_step
⊢ 4 ≤ 7
case h ⊢ 4 ≤ 6
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_11/NatLe.lean
four_le_seven
[106, 1]
[115, 20]
apply Nat.le_step
case h ⊢ 4 ≤ 6
case h.h ⊢ 4 ≤ 5
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_11/NatLe.lean
four_le_seven
[106, 1]
[115, 20]
apply Nat.le_step
case h.h ⊢ 4 ≤ 5
case h.h.h ⊢ 4 ≤ 4
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_11/NatLe.lean
four_le_seven
[106, 1]
[115, 20]
apply Nat.le_refl
case h.h.h ⊢ 4 ≤ 4
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_11/NatLe.lean
four_le_ten
[149, 1]
[150, 12]
decide
⊢ 4 ≤ 10
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.disagree_eq_maybe
[86, 1]
[89, 36]
cases ans <;> simp [disagree]
ans : Answer ⊢ disagree ans = ans → ans = Answer.maybe
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
intro h₁ h₂
a b c : Answer ⊢ a ≤ b → b ≤ c → a ≤ c
a b c : Answer h₁ : a ≤ b h₂ : b ≤ c ⊢ a ≤ c
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
cases c₁:h₁
a b c : Answer h₁ : a ≤ b h₂ : b ≤ c ⊢ a ≤ c
case no_le b c : Answer h₂ : b ≤ c h₁ : Answer.no ≤ b c₁ : h₁ = ⋯ ⊢ Answer.no ≤ c case le_yes a c : Answer h₁ : a ≤ Answer.yes h₂ : Answer.yes ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c case refl a c : Answer h₁ : a ≤ a h₂ : a ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
case no_le => apply Answer.le.no_le
b c : Answer h₂ : b ≤ c h₁ : Answer.no ≤ b c₁ : h₁ = ⋯ ⊢ Answer.no ≤ c
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
case le_yes => cases c₂:h₂ case le_yes => apply Answer.le.le_yes case refl => assumption
a c : Answer h₁ : a ≤ Answer.yes h₂ : Answer.yes ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
case refl => assumption
a c : Answer h₁ : a ≤ a h₂ : a ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
apply Answer.le.no_le
b c : Answer h₂ : b ≤ c h₁ : Answer.no ≤ b c₁ : h₁ = ⋯ ⊢ Answer.no ≤ c
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
cases c₂:h₂
a c : Answer h₁ : a ≤ Answer.yes h₂ : Answer.yes ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c
case le_yes a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes case refl a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
case le_yes => apply Answer.le.le_yes
a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
case refl => assumption
a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
apply Answer.le.le_yes
a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
assumption
a : Answer h₁ : a ≤ Answer.yes c₁ : h₁ = ⋯ h₂ : Answer.yes ≤ Answer.yes c₂ : h₂ = ⋯ ⊢ a ≤ Answer.yes
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_25/Answer.lean
Waffle.le_trans
[279, 1]
[290, 28]
assumption
a c : Answer h₁ : a ≤ a h₂ : a ≤ c c₁ : h₁ = ⋯ ⊢ a ≤ c
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
simp [List.remove]
case nil α : Type u inst✝ : DecidableEq α a : α ⊢ List.length (List.remove a []) ≤ List.length []
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
simp [List.remove]
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t ⊢ List.length (List.remove a (h' :: t)) ≤ List.length (h' :: t)
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t ⊢ List.length (if a = h' then List.remove a t else h' :: List.remove a t) ≤ Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
split
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t ⊢ List.length (if a = h' then List.remove a t else h' :: List.remove a t) ≤ Nat.succ (List.length t)
case cons.inl α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ Nat.succ (List.length t) case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ List.length (h' :: List.remove a t) ≤ Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
apply Nat.le_step
case cons.inl α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ Nat.succ (List.length t)
case cons.inl.h α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ List.length t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
assumption
case cons.inl.h α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ List.length t
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
rw [List.length_cons]
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ List.length (h' :: List.remove a t) ≤ Nat.succ (List.length t)
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ Nat.succ (List.length (List.remove a t)) ≤ Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
apply Nat.succ_le_succ
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ Nat.succ (List.length (List.remove a t)) ≤ Nat.succ (List.length t)
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ List.length (List.remove a t) ≤ List.length t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_length_le
[17, 1]
[28, 17]
exact ih
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : List.length (List.remove a t) ≤ List.length t h✝ : ¬a = h' ⊢ List.length (List.remove a t) ≤ List.length t
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
contradiction
case nil α : Type u inst✝ : DecidableEq α a : α hyp : a ∈ [] ⊢ List.length (List.remove a []) < List.length []
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
simp [List.remove]
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t ⊢ List.length (List.remove a (h' :: t)) < List.length (h' :: t)
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t ⊢ List.length (if a = h' then List.remove a t else h' :: List.remove a t) < Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
split
case cons α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t ⊢ List.length (if a = h' then List.remove a t else h' :: List.remove a t) < Nat.succ (List.length t)
case cons.inl α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : a = h' ⊢ List.length (List.remove a t) < Nat.succ (List.length t) case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ List.length (h' :: List.remove a t) < Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
apply Nat.lt_succ_of_le
case cons.inl α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : a = h' ⊢ List.length (List.remove a t) < Nat.succ (List.length t)
case cons.inl.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ List.length t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
apply remove_length_le
case cons.inl.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : a = h' ⊢ List.length (List.remove a t) ≤ List.length t
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
rw [List.length_cons]
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ List.length (h' :: List.remove a t) < Nat.succ (List.length t)
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ Nat.succ (List.length (List.remove a t)) < Nat.succ (List.length t)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
apply Nat.succ_lt_succ
case cons.inr α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ Nat.succ (List.length (List.remove a t)) < Nat.succ (List.length t)
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ List.length (List.remove a t) < List.length t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
have in_tail: a ∈ t := by have : ¬ a = h' := by assumption simp [List.mem_cons, this] at hyp assumption
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ List.length (List.remove a t) < List.length t
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' in_tail : a ∈ t ⊢ List.length (List.remove a t) < List.length t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
exact ih in_tail
case cons.inr.a α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' in_tail : a ∈ t ⊢ List.length (List.remove a t) < List.length t
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
have : ¬ a = h' := by assumption
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ a ∈ t
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ this : ¬a = h' ⊢ a ∈ t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
simp [List.mem_cons, this] at hyp
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ this : ¬a = h' ⊢ a ∈ t
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t h✝ this : ¬a = h' hyp : a ∈ t ⊢ a ∈ t
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
assumption
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t h✝ this : ¬a = h' hyp : a ∈ t ⊢ a ∈ t
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_24/Sampling.lean
remove_mem_length
[32, 1]
[47, 25]
assumption
α : Type u inst✝ : DecidableEq α a h' : α t : List α ih : a ∈ t → List.length (List.remove a t) < List.length t hyp : a ∈ h' :: t h✝ : ¬a = h' ⊢ ¬a = h'
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Labs/Lab02/AnswerLE.lean
Waffle.Answer.eq_of_le_le
[5, 1]
[6, 37]
sorry
a b : Answer ⊢ a ≤ b → b ≤ a → a = b
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
by_cases c:tail = []
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ smallest (head :: tail) hyp ∈ head :: tail
case pos l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : tail = [] ⊢ smallest (head :: tail) hyp ∈ head :: tail case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] ⊢ smallest (head :: tail) hyp ∈ head :: tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
simp [smallest, c]
case pos l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : tail = [] ⊢ smallest (head :: tail) hyp ∈ head :: tail
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
simp [smallest, c]
case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] ⊢ smallest (head :: tail) hyp ∈ head :: tail
case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
by_cases c':head ≤ smallest tail (by simp [c])
case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail
case pos l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
simp [c]
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] ⊢ tail ≠ []
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
left
case pos l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail
case pos.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
assumption
case pos.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
right
case neg l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ head ≤ smallest tail ⋯ ∨ Nat.min head (smallest tail ⋯) ∈ tail
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ Nat.min head (smallest tail ⋯) ∈ tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
have lem : Nat.min head (smallest tail (by simp [c])) = smallest tail (by simp [c]) := by apply Nat.min_eq_right apply Nat.le_of_not_le assumption
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ Nat.min head (smallest tail ⋯) ∈ tail
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ lem : Nat.min head (smallest tail ⋯) = smallest tail ⋯ ⊢ Nat.min head (smallest tail ⋯) ∈ tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
rw [lem]
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ lem : Nat.min head (smallest tail ⋯) = smallest tail ⋯ ⊢ Nat.min head (smallest tail ⋯) ∈ tail
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ lem : Nat.min head (smallest tail ⋯) = smallest tail ⋯ ⊢ smallest tail ⋯ ∈ tail
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
simp [smallest_in_list]
case neg.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ lem : Nat.min head (smallest tail ⋯) = smallest tail ⋯ ⊢ smallest tail ⋯ ∈ tail
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
simp [c]
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ tail ≠ []
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
apply Nat.min_eq_right
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ Nat.min head (smallest tail ⋯) = smallest tail ⋯
case h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ smallest tail ⋯ ≤ head
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
apply Nat.le_of_not_le
case h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ smallest tail ⋯ ≤ head
case h.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ ¬head ≤ smallest tail ⋯
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_in_list
[30, 1]
[48, 34]
assumption
case h.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] c : ¬tail = [] c' : ¬head ≤ smallest tail ⋯ ⊢ ¬head ≤ smallest tail ⋯
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
simp [smallest, hyp]
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ ∀ m ∈ head :: tail, smallest (head :: tail) hyp ≤ m
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ head ∧ ∀ a ∈ tail, (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
apply And.intro
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ head ∧ ∀ a ∈ tail, (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
case left l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ head case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ ∀ a ∈ tail, (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
split <;> simp
case left l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ head
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
intro a hyp'
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] ⊢ ∀ a ∈ tail, (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
have c'' : tail ≠ [] := by intro contra rw [contra] at hyp' contradiction
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
simp [c'']
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ (if c : tail = [] then head else Nat.min head (smallest tail c)) ≤ a
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ head ≤ a ∨ smallest tail ⋯ ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
right
case right l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ head ≤ a ∨ smallest tail ⋯ ≤ a
case right.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ smallest tail ⋯ ≤ a
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
exact smallest_le tail c'' a hyp'
case right.h l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail c'' : tail ≠ [] ⊢ smallest tail ⋯ ≤ a
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
intro contra
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail ⊢ tail ≠ []
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail contra : tail = [] ⊢ False
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
rw [contra] at hyp'
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ tail contra : tail = [] ⊢ False
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ [] contra : tail = [] ⊢ False
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_01_20/NatMin.lean
smallest_le
[62, 1]
[75, 40]
contradiction
l : List ℕ head : ℕ tail : List ℕ hyp : head :: tail ≠ [] a : ℕ hyp' : a ∈ [] contra : tail = [] ⊢ False
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Labs/Lab02/SelectionSort.lean
remove_length_le
[40, 1]
[41, 8]
sorry
a : ℕ l : List ℕ ⊢ List.length (List.remove a l) ≤ List.length l
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Labs/Lab02/SelectionSort.lean
remove_mem_length
[45, 1]
[46, 8]
sorry
a : ℕ l : List ℕ hyp : a ∈ l ⊢ List.length (List.remove a l) < List.length l
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_10/FormalCalculus.lean
integral_point
[24, 1]
[29, 15]
unfold integral
f : ℝ → ℝ int : Integrable f a : ℝ ⊢ integral f a a = 0
f : ℝ → ℝ int : Integrable f a : ℝ ⊢ Integrable.integral f a a = 0
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_10/FormalCalculus.lean
integral_point
[24, 1]
[29, 15]
have l := int.interval_union a a a
f : ℝ → ℝ int : Integrable f a : ℝ ⊢ Integrable.integral f a a = 0
f : ℝ → ℝ int : Integrable f a : ℝ l : Integrable.integral f a a = Integrable.integral f a a + Integrable.integral f a a ⊢ Integrable.integral f a a = 0
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_10/FormalCalculus.lean
integral_point
[24, 1]
[29, 15]
simp at l
f : ℝ → ℝ int : Integrable f a : ℝ l : Integrable.integral f a a = Integrable.integral f a a + Integrable.integral f a a ⊢ Integrable.integral f a a = 0
f : ℝ → ℝ int : Integrable f a : ℝ l : Integrable.integral f a a = 0 ⊢ Integrable.integral f a a = 0
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Lec_03_10/FormalCalculus.lean
integral_point
[24, 1]
[29, 15]
assumption
f : ℝ → ℝ int : Integrable f a : ℝ l : Integrable.integral f a a = 0 ⊢ Integrable.integral f a a = 0
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Extras/SumToN.lean
sum_formula
[7, 1]
[16, 13]
induction n with | zero => rfl | succ n ih => simp [sumTo] simp [left_distrib, ih] linarith
n : ℕ ⊢ 2 * sumTo n = n * (n + 1)
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Extras/SumToN.lean
sum_formula
[7, 1]
[16, 13]
rfl
case zero ⊢ 2 * sumTo Nat.zero = Nat.zero * (Nat.zero + 1)
no goals
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Extras/SumToN.lean
sum_formula
[7, 1]
[16, 13]
simp [sumTo]
case succ n : ℕ ih : 2 * sumTo n = n * (n + 1) ⊢ 2 * sumTo (Nat.succ n) = Nat.succ n * (Nat.succ n + 1)
case succ n : ℕ ih : 2 * sumTo n = n * (n + 1) ⊢ 2 * (n + 1 + sumTo n) = Nat.succ n * (Nat.succ n + 1)
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Extras/SumToN.lean
sum_formula
[7, 1]
[16, 13]
simp [left_distrib, ih]
case succ n : ℕ ih : 2 * sumTo n = n * (n + 1) ⊢ 2 * (n + 1 + sumTo n) = Nat.succ n * (Nat.succ n + 1)
case succ n : ℕ ih : 2 * sumTo n = n * (n + 1) ⊢ 2 * n + 2 + (n * n + n) = Nat.succ n * Nat.succ n + Nat.succ n
https://github.com/siddhartha-gadgil/proofs-and-programs-2023.git
92fd2d8464d8687b5b0bcd7b17612440c304d19c
PnP2023/Extras/SumToN.lean
sum_formula
[7, 1]
[16, 13]
linarith
case succ n : ℕ ih : 2 * sumTo n = n * (n + 1) ⊢ 2 * n + 2 + (n * n + n) = Nat.succ n * Nat.succ n + Nat.succ n
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
repeat (first | apply IsQuizSchema.consQuiz (by decide) | apply IsQuizSchema.consNonQuiz (by decide) | apply IsQuizSchema.nil)
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema (schema gradebook)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
(first | apply IsQuizSchema.consQuiz (by decide) | apply IsQuizSchema.consNonQuiz (by decide) | apply IsQuizSchema.nil)
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
first | apply IsQuizSchema.consQuiz (by decide) | apply IsQuizSchema.consNonQuiz (by decide) | apply IsQuizSchema.nil
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
apply IsQuizSchema.consQuiz (by decide)
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema [("final", Nat)]
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
decide
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ String.startsWith "quiz4" "quiz" = true
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
apply IsQuizSchema.consNonQuiz (by decide)
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema [("final", Nat)]
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema []
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
decide
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ String.startsWith "final" "quiz" = false
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/ExamplePrograms.lean
gradebook_schema_is_quiz_schema
[140, 1]
[143, 42]
apply IsQuizSchema.nil
η : Type u_η inst✝ : DecidableEq η sch : Schema ⊢ IsQuizSchema []
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Demo.lean
nrows_groupBySubtractive
[199, 1]
[205, 30]
have h_gbs := groupBySubtractive_spec7 t c hc
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema ⊢ nrows (groupBySubtractive t c) ≤ nrows t
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ nrows (groupBySubtractive t c) ≤ nrows t
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Demo.lean
nrows_groupBySubtractive
[199, 1]
[205, 30]
rw [h_gbs]
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ nrows (groupBySubtractive t c) ≤ nrows t
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ List.length (List.unique (getColumn2 t c)) ≤ nrows t
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Demo.lean
nrows_groupBySubtractive
[199, 1]
[205, 30]
rw [←getColumn2_spec2 t c hc]
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ List.length (List.unique (getColumn2 t c)) ≤ nrows t
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ List.length (List.unique (getColumn2 t c)) ≤ List.length (getColumn2 t c)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Demo.lean
nrows_groupBySubtractive
[199, 1]
[205, 30]
apply List.length_unique_le
η : Type u_1 τ : Type u_2 inst✝¹ : DecidableEq η inst✝ : DecidableEq τ schema : Schema t : Table schema c : η hc : Schema.HasCol (c, τ) schema h_gbs : nrows (groupBySubtractive t c) = List.length (List.unique (getColumn2 t c)) ⊢ List.length (List.unique (getColumn2 t c)) ≤ List.length (getColumn2 t c)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Schema.lean
Schema.lookup_of_colImpliesName
[353, 1]
[361, 33]
rw [colImpliesName_eq_1 (sch' := ss) (hdr := (nm, τ)), lookup_eq_1]
η : Type u_η dec_η : DecidableEq η schema : Schema nm : η τ : Type u_1 ss : List Header ⊢ lookup ((nm, τ) :: ss) { fst := nm, snd := colImpliesName HasCol.hd } = (nm, τ)
no goals
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Schema.lean
Schema.lookup_of_colImpliesName
[353, 1]
[361, 33]
rw [colImpliesName_eq_2, lookup_eq_2]
η : Type u_η dec_η : DecidableEq η schema : Schema nm : η τ : Type u_1 head✝ : Header ss : List Header h : HasCol (nm, τ) ss ⊢ lookup (head✝ :: ss) { fst := nm, snd := colImpliesName (HasCol.tl h) } = (nm, τ)
η : Type u_η dec_η : DecidableEq η schema : Schema nm : η τ : Type u_1 head✝ : Header ss : List Header h : HasCol (nm, τ) ss ⊢ lookup ss { fst := nm, snd := colImpliesName h } = (nm, τ)
https://github.com/jrr6/lean-tables.git
7dfa8308e13cb7b15296cc63fa2cbd26c0d0f712
Table/Schema.lean
Schema.lookup_of_colImpliesName
[353, 1]
[361, 33]
apply lookup_of_colImpliesName
η : Type u_η dec_η : DecidableEq η schema : Schema nm : η τ : Type u_1 head✝ : Header ss : List Header h : HasCol (nm, τ) ss ⊢ lookup ss { fst := nm, snd := colImpliesName h } = (nm, τ)
no goals