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/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
have h1 : (biggerPrime M) ∣ M ! + 1 := minFac_dvd _
M : ℕ hqM : ¬biggerPrime M ≥ M ⊢ False
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 ⊢ False
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
have hqM2 : biggerPrime M ≤ M := by linarith
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 ⊢ False
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M ⊢ False
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
have hqM3 : biggerPrime M ∣ M ! := Iff.mpr (Prime.dvd_factorial (biggerPrimeIsPrime _)) hqM2
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M ⊢ False
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M hqM3 : biggerPrime M ∣ M ! ⊢ False
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
have hq1 : biggerPrime M ∣ 1 := Iff.mp (Nat.dvd_add_right hqM3) h1
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M hqM3 : biggerPrime M ∣ M ! ⊢ False
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M hqM3 : biggerPrime M ∣ M ! hq1 : biggerPrime M ∣ 1 ⊢ False
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
apply Nat.Prime.not_dvd_one (biggerPrimeIsPrime _) hq1
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 hqM2 : biggerPrime M ≤ M hqM3 : biggerPrime M ∣ M ! hq1 : biggerPrime M ∣ 1 ⊢ False
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
biggerPrimeIsBigger
[156, 1]
[165, 7]
linarith
M : ℕ hqM : ¬biggerPrime M ≥ M h1 : biggerPrime M ∣ M ! + 1 ⊢ biggerPrime M ≤ M
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
intro N
⊢ ∀ (N : ℕ), ∃ p, p ≥ N ∧ Nat.Prime p
N : ℕ ⊢ ∃ p, p ≥ N ∧ Nat.Prime p
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
use biggerPrime N
N : ℕ ⊢ ∃ p, p ≥ N ∧ Nat.Prime p
case h N : ℕ ⊢ biggerPrime N ≥ N ∧ Nat.Prime (biggerPrime N)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
apply And.intro
case h N : ℕ ⊢ biggerPrime N ≥ N ∧ Nat.Prime (biggerPrime N)
case h.left N : ℕ ⊢ biggerPrime N ≥ N case h.right N : ℕ ⊢ Nat.Prime (biggerPrime N)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
{ exact biggerPrimeIsBigger _ }
case h.left N : ℕ ⊢ biggerPrime N ≥ N case h.right N : ℕ ⊢ Nat.Prime (biggerPrime N)
case h.right N : ℕ ⊢ Nat.Prime (biggerPrime N)
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
{ exact biggerPrimeIsPrime _ }
case h.right N : ℕ ⊢ Nat.Prime (biggerPrime N)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
exact biggerPrimeIsBigger _
case h.left N : ℕ ⊢ biggerPrime N ≥ N
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe00_Preface_Demo.lean
infinitude_of_primes2
[169, 1]
[175, 7]
exact biggerPrimeIsPrime _
case h.right N : ℕ ⊢ Nat.Prime (biggerPrime N)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVeXX_ALookUnderTheHood_Demo.lean
a_silly_theorem
[101, 1]
[102, 39]
simp
⊢ True
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.Nat.succ_neq_self
[68, 1]
[73, 28]
induction n with | zero => simp | succ n' ih => simp [ih]
n : ℕ ⊢ Nat.succ n ≠ n
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.Nat.succ_neq_self
[68, 1]
[73, 28]
simp
case zero ⊢ Nat.succ Nat.zero ≠ Nat.zero
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.Nat.succ_neq_self
[68, 1]
[73, 28]
simp [ih]
case succ n' : ℕ ih : Nat.succ n' ≠ n' ⊢ Nat.succ (Nat.succ n') ≠ Nat.succ n'
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.proof_of_False
[108, 1]
[118, 21]
rw [←hi]
hi : immoral 0 = immoral 0 + 1 ⊢ immoral 0 - immoral 0 = immoral 0 + 1 - immoral 0
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.proof_of_False
[108, 1]
[118, 21]
simp at him
hi : immoral 0 = immoral 0 + 1 him : immoral 0 - immoral 0 = immoral 0 + 1 - immoral 0 ⊢ 0 = 1
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.proof_of_False
[108, 1]
[118, 21]
simp at h0eq1
hi : immoral 0 = immoral 0 + 1 him : immoral 0 - immoral 0 = immoral 0 + 1 - immoral 0 h0eq1 : 0 = 1 ⊢ False
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.shuffle_shuffle_shuffle
[245, 1]
[247, 9]
rfl
c : RGB ⊢ shuffle (shuffle (shuffle c)) = c
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head
[272, 1]
[275, 9]
rfl
α : Type inst✝ : Inhabited α xs : List α ⊢ head [head xs] = head xs
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head_cases
[308, 1]
[314, 24]
cases xs with | nil => rfl | cons x xs' => rfl
α : Type inst✝ : Inhabited α xs : List α ⊢ head [head xs] = head xs
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head_cases
[308, 1]
[314, 24]
rfl
case nil α : Type inst✝ : Inhabited α ⊢ head [head []] = head []
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head_cases
[308, 1]
[314, 24]
rfl
case cons α : Type inst✝ : Inhabited α x : α xs' : List α ⊢ head [head (x :: xs')] = head (x :: xs')
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head_match
[318, 1]
[323, 30]
rfl
α : Type inst✝ : Inhabited α xs : List α ⊢ head [head []] = head []
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.head_head_match
[318, 1]
[323, 30]
rfl
α : Type inst✝ : Inhabited α xs : List α x : α xs' : List α ⊢ head [head (x :: xs')] = head (x :: xs')
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.injection_example
[329, 1]
[334, 9]
cases h
α : Type x y : α xs ys : List α h : x :: xs = y :: ys ⊢ x = y ∧ xs = ys
case refl α : Type x : α xs : List α ⊢ x = x ∧ xs = xs
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.injection_example
[329, 1]
[334, 9]
simp
case refl α : Type x : α xs : List α ⊢ x = x ∧ xs = xs
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.distinctness_example
[338, 1]
[341, 13]
cases h
α : Type y : α ys : List α h : [] = y :: ys ⊢ false = true
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_ident
[353, 1]
[358, 38]
induction xs with | nil => rfl | cons x xs' ih => simp [map, ih]
α : Type xs : List α ⊢ map (fun x => x) xs = xs
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_ident
[353, 1]
[358, 38]
rfl
case nil α : Type ⊢ map (fun x => x) [] = []
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_ident
[353, 1]
[358, 38]
simp [map, ih]
case cons α : Type x : α xs' : List α ih : map (fun x => x) xs' = xs' ⊢ map (fun x => x) (x :: xs') = x :: xs'
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_comp
[360, 1]
[366, 38]
induction xs with | nil => rfl | cons x xs' ih => simp [map, ih]
α β γ : Type f : α → β g : β → γ xs : List α ⊢ map g (map f xs) = map (fun x => g (f x)) xs
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_comp
[360, 1]
[366, 38]
rfl
case nil α β γ : Type f : α → β g : β → γ ⊢ map g (map f []) = map (fun x => g (f x)) []
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_comp
[360, 1]
[366, 38]
simp [map, ih]
case cons α β γ : Type f : α → β g : β → γ x : α xs' : List α ih : map g (map f xs') = map (fun x => g (f x)) xs' ⊢ map g (map f (x :: xs')) = map (fun x => g (f x)) (x :: xs')
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_append
[368, 1]
[374, 38]
induction xs with | nil => rfl | cons x xs' ih => simp [map, ih]
α β : Type f : α → β xs ys : List α ⊢ map f (xs ++ ys) = map f xs ++ map f ys
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_append
[368, 1]
[374, 38]
rfl
case nil α β : Type f : α → β ys : List α ⊢ map f ([] ++ ys) = map f [] ++ map f ys
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_append
[368, 1]
[374, 38]
simp [map, ih]
case cons α β : Type f : α → β ys : List α x : α xs' : List α ih : map f (xs' ++ ys) = map f xs' ++ map f ys ⊢ map f (x :: xs' ++ ys) = map f (x :: xs') ++ map f ys
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add
[410, 1]
[415, 29]
cases Classical.em (m ≤ n) with | inl h => simp [min, h] | inr h => simp [min, h]
l m n : ℕ ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add
[410, 1]
[415, 29]
simp [min, h]
case inl l m n : ℕ h : m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add
[410, 1]
[415, 29]
simp [min, h]
case inr l m n : ℕ h : ¬m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add_match
[417, 1]
[421, 33]
simp [min, h]
l m n : ℕ h : m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add_match
[417, 1]
[421, 33]
simp [min, h]
l m n : ℕ h : ¬m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add_if
[423, 1]
[428, 21]
simp [min, h]
l m n : ℕ h : m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.min_add_add_if
[423, 1]
[428, 21]
simp [min, h]
l m n : ℕ h : ¬m ≤ n ⊢ min (m + l) (n + l) = min m n + l
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_zip
[430, 1]
[438, 62]
induction xs generalizing ys with | nil => simp [min, length] | cons x xs' ih => cases ys with | nil => rfl | cons y ys' => simp [zip, length, ih ys', min_add_add]
α β : Type xs : List α ys : List β ⊢ length (zip xs ys) = min (length xs) (length ys)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_zip
[430, 1]
[438, 62]
simp [min, length]
case nil α β : Type ys : List β ⊢ length (zip [] ys) = min (length []) (length ys)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_zip
[430, 1]
[438, 62]
cases ys with | nil => rfl | cons y ys' => simp [zip, length, ih ys', min_add_add]
case cons α β : Type x : α xs' : List α ih : ∀ (ys : List β), length (zip xs' ys) = min (length xs') (length ys) ys : List β ⊢ length (zip (x :: xs') ys) = min (length (x :: xs')) (length ys)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_zip
[430, 1]
[438, 62]
rfl
case cons.nil α β : Type x : α xs' : List α ih : ∀ (ys : List β), length (zip xs' ys) = min (length xs') (length ys) ⊢ length (zip (x :: xs') []) = min (length (x :: xs')) (length [])
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_zip
[430, 1]
[438, 62]
simp [zip, length, ih ys', min_add_add]
case cons.cons α β : Type x : α xs' : List α ih : ∀ (ys : List β), length (zip xs' ys) = min (length xs') (length ys) y : β ys' : List β ⊢ length (zip (x :: xs') (y :: ys')) = min (length (x :: xs')) (length (y :: ys'))
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_zip
[440, 1]
[448, 31]
simp [zip, map, map_zip f g xs ys]
α α' β β' : Type f : α → α' g : β → β' x : α xs : List α y : β ys : List β ⊢ map (fun ab => (f ab.fst, g ab.snd)) (zip (x :: xs) (y :: ys)) = zip (map f (x :: xs)) (map g (y :: ys))
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_zip
[440, 1]
[448, 31]
rfl
α α' β β' : Type f : α → α' g : β → β' x✝ : List β ⊢ map (fun ab => (f ab.fst, g ab.snd)) (zip [] x✝) = zip (map f []) (map g x✝)
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.map_zip
[440, 1]
[448, 31]
rfl
α α' β β' : Type f : α → α' g : β → β' head✝ : α tail✝ : List α ⊢ map (fun ab => (f ab.fst, g ab.snd)) (zip (head✝ :: tail✝) []) = zip (map f (head✝ :: tail✝)) (map g [])
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror
[478, 1]
[483, 56]
induction t with | empty => rfl | node a l r ih_l ih_r => simp [mirror, ih_l, ih_r]
α : Type t : BTree α ⊢ mirror (mirror t) = t
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror
[478, 1]
[483, 56]
rfl
case empty α : Type ⊢ mirror (mirror BTree.empty) = BTree.empty
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror
[478, 1]
[483, 56]
simp [mirror, ih_l, ih_r]
case node α : Type a : α l r : BTree α ih_l : mirror (mirror l) = l ih_r : mirror (mirror r) = r ⊢ mirror (mirror (BTree.node a l r)) = BTree.node a l r
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror_calc
[485, 1]
[499, 37]
rfl
α : Type ⊢ mirror (mirror BTree.empty) = BTree.empty
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror_calc
[485, 1]
[499, 37]
rfl
α : Type a : α l r : BTree α ⊢ mirror (mirror (BTree.node a l r)) = mirror (BTree.node a (mirror r) (mirror l))
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror_calc
[485, 1]
[499, 37]
rfl
α : Type a : α l r : BTree α ⊢ mirror (BTree.node a (mirror r) (mirror l)) = BTree.node a (mirror (mirror l)) (mirror (mirror r))
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror_calc
[485, 1]
[499, 37]
rw [mirror_mirror_calc l]
α : Type a : α l r : BTree α ⊢ BTree.node a (mirror (mirror l)) (mirror (mirror r)) = BTree.node a l (mirror (mirror r))
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_mirror_calc
[485, 1]
[499, 37]
rw [mirror_mirror_calc r]
α : Type a : α l r : BTree α ⊢ BTree.node a l (mirror (mirror r)) = BTree.node a l r
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_Eq_empty_Iff
[501, 1]
[504, 41]
simp [mirror]
α : Type ⊢ mirror BTree.empty = BTree.empty ↔ BTree.empty = BTree.empty
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.mirror_Eq_empty_Iff
[501, 1]
[504, 41]
simp [mirror]
α : Type a✝² : α a✝¹ a✝ : BTree α ⊢ mirror (BTree.node a✝² a✝¹ a✝) = BTree.empty ↔ BTree.node a✝² a✝¹ a✝ = BTree.empty
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_listOfVec
[525, 1]
[529, 46]
rfl
α : Type ⊢ List.length (listOfVec Vec.nil) = 0
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe05_FunctionalProgramming_Demo.lean
LoVe.length_listOfVec
[525, 1]
[529, 46]
simp [listOfVec, length_listOfVec _ v]
α : Type a : α n✝ : ℕ v : Vec α n✝ ⊢ List.length (listOfVec (Vec.cons a v)) = n✝ + 1
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props
[31, 1]
[36, 13]
intro a b
⊢ ∀ (a b : Prop), a → b → a
a b : Prop ⊢ a → b → a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props
[31, 1]
[36, 13]
intro ha hb
a b : Prop ⊢ a → b → a
a b : Prop ha : a hb : b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props
[31, 1]
[36, 13]
apply ha
a b : Prop ha : a hb : b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props_params
[60, 1]
[62, 14]
apply ha
a b : Prop ha : a hb : b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.prop_comp
[66, 1]
[72, 13]
intro ha
a b c : Prop hab : a → b hbc : b → c ⊢ a → c
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ c
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.prop_comp
[66, 1]
[72, 13]
apply hbc
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ c
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ b
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.prop_comp
[66, 1]
[72, 13]
apply hab
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ b
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.prop_comp
[66, 1]
[72, 13]
apply ha
a b c : Prop hab : a → b hbc : b → c ha : a ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props_exact
[86, 1]
[88, 14]
exact ha
a b : Prop ha : a hb : b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.fst_of_two_props_assumption
[93, 1]
[96, 16]
assumption
a b : Prop ha : a hb : b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
intro hab
a b : Prop ⊢ a ∧ b → b ∧ a
a b : Prop hab : a ∧ b ⊢ b ∧ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
apply And.intro
a b : Prop hab : a ∧ b ⊢ b ∧ a
case left a b : Prop hab : a ∧ b ⊢ b case right a b : Prop hab : a ∧ b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
apply And.right
case left a b : Prop hab : a ∧ b ⊢ b case right a b : Prop hab : a ∧ b ⊢ a
case left.self a b : Prop hab : a ∧ b ⊢ ?left.a ∧ b case left.a a b : Prop hab : a ∧ b ⊢ Prop case right a b : Prop hab : a ∧ b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
exact hab
case left.self a b : Prop hab : a ∧ b ⊢ ?left.a ∧ b case left.a a b : Prop hab : a ∧ b ⊢ Prop case right a b : Prop hab : a ∧ b ⊢ a
case right a b : Prop hab : a ∧ b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
apply And.left
case right a b : Prop hab : a ∧ b ⊢ a
case right.self a b : Prop hab : a ∧ b ⊢ a ∧ ?right.b case right.b a b : Prop hab : a ∧ b ⊢ Prop
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap
[130, 1]
[138, 14]
exact hab
case right.self a b : Prop hab : a ∧ b ⊢ a ∧ ?right.b case right.b a b : Prop hab : a ∧ b ⊢ Prop
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
intro a b hab
⊢ ∀ (a b : Prop), a ∧ b → b ∧ a
a b : Prop hab : a ∧ b ⊢ b ∧ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
apply And.intro
a b : Prop hab : a ∧ b ⊢ b ∧ a
case left a b : Prop hab : a ∧ b ⊢ b case right a b : Prop hab : a ∧ b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
{ exact And.right hab }
case left a b : Prop hab : a ∧ b ⊢ b case right a b : Prop hab : a ∧ b ⊢ a
case right a b : Prop hab : a ∧ b ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
{ exact And.left hab }
case right a b : Prop hab : a ∧ b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
exact And.right hab
case left a b : Prop hab : a ∧ b ⊢ b
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.And_swap_braces
[155, 1]
[161, 27]
exact And.left hab
case right a b : Prop hab : a ∧ b ⊢ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.f5_if
[172, 1]
[174, 15]
exact h 5
h : ∀ (n : ℕ), f n = n ⊢ f 5 = 5
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
intro hab
a b : Prop ⊢ a ∨ b → b ∨ a
a b : Prop hab : a ∨ b ⊢ b ∨ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
apply Or.elim hab
a b : Prop hab : a ∨ b ⊢ b ∨ a
case left a b : Prop hab : a ∨ b ⊢ a → b ∨ a case right a b : Prop hab : a ∨ b ⊢ b → b ∨ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
{ intro ha exact Or.inr ha }
case left a b : Prop hab : a ∨ b ⊢ a → b ∨ a case right a b : Prop hab : a ∨ b ⊢ b → b ∨ a
case right a b : Prop hab : a ∨ b ⊢ b → b ∨ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
{ intro hb exact Or.inl hb }
case right a b : Prop hab : a ∨ b ⊢ b → b ∨ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
intro ha
case left a b : Prop hab : a ∨ b ⊢ a → b ∨ a
case left a b : Prop hab : a ∨ b ha : a ⊢ b ∨ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
exact Or.inr ha
case left a b : Prop hab : a ∨ b ha : a ⊢ b ∨ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
intro hb
case right a b : Prop hab : a ∨ b ⊢ b → b ∨ a
case right a b : Prop hab : a ∨ b hb : b ⊢ b ∨ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.Or_swap
[177, 1]
[185, 24]
exact Or.inl hb
case right a b : Prop hab : a ∨ b hb : b ⊢ b ∨ a
no goals
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.modus_ponens
[187, 1]
[192, 13]
intro hab ha
a b : Prop ⊢ (a → b) → a → b
a b : Prop hab : a → b ha : a ⊢ b
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.modus_ponens
[187, 1]
[192, 13]
apply hab
a b : Prop hab : a → b ha : a ⊢ b
a b : Prop hab : a → b ha : a ⊢ a
https://github.com/BrownCS1951x/fpv2023.git
9aaf6b5c454aa9a70fc4e6807adf3123b001ea66
LoVe/Lectures/LoVe03_BackwardProofs_Demo.lean
LoVe.BackwardProofs.modus_ponens
[187, 1]
[192, 13]
exact ha
a b : Prop hab : a → b ha : a ⊢ a
no goals