Theoremlength_flatMap_two
Statement
theorem length_flatMap_two {α β : Type} (f g : α → β) :
∀ l : List α, (l.flatMap fun a => [f a, g a]).length = 2 * l.length
| [] => rfl
| a :: l => by
simp only [List.flatMap_cons, List.length_append, List.length_cons, List.length_nil,
length_flatMap_two f g l]
omegaProof
Proved by a term, which Lean's kernel checks directly.
Used by
In StandardElmMech/Stat/CopyLoop.lean: The copy loop terminates within 2^k + 1 rounds, makes the least set of copies closed under requests, at most 2^k (copyLoop_fuel, copyLoop_least, copies_le_pow).
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.