theorem
List.nodup_flatMap_of_disjoint
{α : Type u_1}
{β : Type u_2}
{xs : List α}
{f : α → List β}
(hxs : xs.Nodup)
(hrow : ∀ (x : α), x ∈ xs → (f x).Nodup)
(hdisj : ∀ (x : α), x ∈ xs → ∀ (y : α), y ∈ xs → x ≠ y → ∀ (z : β), z ∈ f x → z ∈ f y → False)
:
A flat map is duplicate-free when every row is duplicate-free and rows coming from distinct source elements are disjoint.
theorem
List.compareLex_zipWith
{α : Type u_1}
{β : Type u_2}
(cmp : α → α → Ordering)
(f : α → β → α)
(hcmp : ∀ (a b : α) (c : β), cmp a b = cmp (f a c) (f b c))
(as bs : List α)
(cs : List β)
:
Lexicographic comparison is unchanged by pointwise combining both lists
with the same third list when the element comparison has the corresponding
invariance. The length hypotheses ensure zipWith does not truncate.