7 kyu
Another random fact about filtering
30 of 40donaldsebleung
Description:
Last time we proved a random fact about filtering. Here's another one: given two predicates f
, g
, the number of elements satisfying both cannot exceed that satisfying either.
forall (X : Type) (l : list X) (f g : X -> bool),
length (filter (fun x => f x && g x) l) <= length (filter f l) /\
length (filter (fun x => f x && g x) l) <= length (filter g l)
Prove it.
Theorem Proving
Logic
Fundamentals
Similar Kata:
Stats:
Created | Nov 6, 2021 |
Published | Nov 6, 2021 |
Warriors Trained | 75 |
Total Skips | 6 |
Total Code Submissions | 95 |
Total Times Completed | 40 |
Coq Completions | 30 |
Lean Completions | 13 |
Total Stars | 0 |
% of votes with a positive feedback rating | 100% of 6 |
Total "Very Satisfied" Votes | 6 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 3 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |