Equations
- Chapter1.map₁ f [] = []
- Chapter1.map₁ f (x :: xs_2) = f x :: Chapter1.map₁ f xs_2
Instances For
Equations
- Chapter1.map f [] = []
- Chapter1.map f (x :: xs_1) = f x :: Chapter1.map f xs_1
Instances For
Equations
- Chapter1.filter p [] = []
- Chapter1.filter p (x_1 :: xs) = if p x_1 = true then x_1 :: Chapter1.filter p xs else Chapter1.filter p xs
Instances For
Equations
- Chapter1.foldr f e [] = e
- Chapter1.foldr f e (x_1 :: xs) = f x_1 (Chapter1.foldr f e xs)
Instances For
Equations
- Chapter1.label xs = (List.range xs.length).zip xs
Instances For
Equations
- Chapter1.length₁ xs = Chapter1.foldr (fun (x : a) (y : ℕ) => y + 1) 0 xs
Instances For
Equations
- Chapter1.length₂ = Chapter1.foldr (fun (x : α) (n : ℕ) => n + 1) 0
Instances For
Equations
- Chapter1.sum as = Chapter1.foldr Nat.add 0 as
Instances For
Equations
- Chapter1.foldl f e [] = e
- Chapter1.foldl f e (x_1 :: xs) = Chapter1.foldl f (f e x_1) xs
Instances For
Equations
- Chapter1.foldl₀ f e = Chapter1.foldr (flip f) e ∘ List.reverse
Instances For
Equations
- Chapter1.foldl₁ f e xs = Chapter1.foldr (flip f) e xs.reverse
Instances For
@[implicit_reducible]
Equations
- Chapter1.instReprPoint = { reprPrec := Chapter1.instReprPoint.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[implicit_reducible]
Equations
- Chapter1.head = List.foldr (fun (x x_1 : α) => x) default
Instances For
Equations
- Chapter1.head₁ = List.foldr (fun (x : α) (x_1 : Option α) => some x) none
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Chapter1.scanl f x✝ [] = [x✝]
- Chapter1.scanl f x✝ (x_2 :: xs) = x✝ :: Chapter1.scanl f (f x✝ x_2) xs
Instances For
Equations
- Chapter1.scanr₀ f q₀ as = ↑(Chapter1.scanr₀.aux f q₀ as)
Instances For
Equations
- Chapter1.inserts x [] = [[x]]
- Chapter1.inserts x (x_1 :: xs_1) = (x :: x_1 :: xs_1) :: Chapter1.map (fun (x : List a) => x_1 :: x) (Chapter1.inserts x xs_1)
Instances For
Equations
Instances For
Equations
- Chapter1.perms1₁ [] = [[]]
- Chapter1.perms1₁ (x_1 :: xs) = Chapter1.concat₁ (List.map (fun (x : List a) => Chapter1.inserts x_1 x) (Chapter1.perms1₁ xs))
Instances For
Equations
- Chapter1.perms1₂ [] = [[]]
- Chapter1.perms1₂ (x :: xs_1) = List.flatMap (fun (x_1 : List a) => Chapter1.inserts x x_1) (Chapter1.perms1₂ xs_1)
Instances For
Instances For
Equations
Instances For
Equations
Instances For
@[irreducible]
Uses List.attach to pair each element with its membership proof, then
pattern-matches on ⟨p, hp⟩ to obtain hp : p ∈ picks xs inline.
Instances For
Equations
Instances For
@[irreducible]
Avoids attach by using an explicit helper go that threads the membership
proof ∀ p, p ∈ ps → p.2.length < xs.length through the recursion. Requires a
lexicographic termination measure (xs.length, ps.length).
Equations
- Chapter1.perms2₅ [] = [[]]
- Chapter1.perms2₅ x✝ = Chapter1.perms2₅.go x✝ (Chapter1.picks x✝) ⋯
Instances For
@[irreducible]
Equations
- Chapter1.perms2₅.go xs [] x_2 = []
- Chapter1.perms2₅.go xs (p :: ps_1) h = List.map (fun (x : List a) => p.1 :: x) (Chapter1.perms2₅ p.2) ++ Chapter1.perms2₅.go xs ps_1 ⋯
Instances For
Equations
- Chapter1.while' p = Chapter1.until' (not ∘ p)
Instances For
theorem
Chapter1.foldr_fusion
{a b c : Type}
(f : a → c → c)
(e : c)
(xs : List a)
(g : a → b → b)
(h : c → b)
(h₁ : ∀ (x : a) (y : c), h (f x y) = g x (h y))
:
Equations
- Chapter1.collapse₀ xss = Chapter1.collapse₀.help [] xss
Instances For
Equations
- Chapter1.collapse₁ xss = Chapter1.collapse₁.help [] xss
Instances For
Equations
Instances For
Equations
- Chapter1.collapse₂.labelsum xss = (Chapter1.map List.sum xss).zip xss