Double universal quantification on a list #
This file provides an API for List.Forall₂
(definition in Data.List.Defs
).
Forall₂ R l₁ l₂
means that l₁
and l₂
have the same length, and whenever a
is the nth element
of l₁
, and b
is the nth element of l₂
, then R a b
is satisfied.
theorem
List.Forall₂.flip
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{a : List α}
{b : List β}
:
Forall₂ (_root_.flip R) b a → Forall₂ R a b
theorem
Relator.LeftUnique.forall₂
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
(hr : LeftUnique R)
:
theorem
Relator.RightUnique.forall₂
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
(hr : RightUnique R)
:
theorem
Relator.BiUnique.forall₂
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
(hr : BiUnique R)
:
BiUnique (List.Forall₂ R)
theorem
List.rel_mem
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
(hr : Relator.BiUnique R)
:
Relator.LiftFun R (Relator.LiftFun (Forall₂ R) Iff) (fun (x1 : α) (x2 : List α) => x1 ∈ x2)
fun (x1 : β) (x2 : List β) => x1 ∈ x2
theorem
List.rel_map
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Relator.LiftFun R P) (Relator.LiftFun (Forall₂ R) (Forall₂ P)) map map
theorem
List.rel_append
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
:
Relator.LiftFun (Forall₂ R) (Relator.LiftFun (Forall₂ R) (Forall₂ R)) (fun (x1 x2 : List α) => x1 ++ x2)
fun (x1 x2 : List β) => x1 ++ x2
theorem
List.rel_reverse
{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
:
Relator.LiftFun (Forall₂ R) (Forall₂ R) reverse reverse
@[deprecated List.rel_flatten (since := "2025-10-15")]
Alias of List.rel_flatten
.
theorem
List.rel_flatMap
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Forall₂ R) (Relator.LiftFun (Relator.LiftFun R (Forall₂ P)) (Forall₂ P)) (Function.swap flatMap)
(Function.swap flatMap)
@[deprecated List.rel_flatMap (since := "2025-10-16")]
theorem
List.rel_bind
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Forall₂ R) (Relator.LiftFun (Relator.LiftFun R (Forall₂ P)) (Forall₂ P)) (Function.swap flatMap)
(Function.swap flatMap)
Alias of List.rel_flatMap
.
theorem
List.rel_foldl
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Relator.LiftFun P (Relator.LiftFun R P)) (Relator.LiftFun P (Relator.LiftFun (Forall₂ R) P)) foldl
foldl
theorem
List.rel_foldr
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Relator.LiftFun R (Relator.LiftFun P P)) (Relator.LiftFun P (Relator.LiftFun (Forall₂ R) P)) foldr
foldr
theorem
List.rel_filterMap
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}
:
Relator.LiftFun (Relator.LiftFun R (Option.Rel P)) (Relator.LiftFun (Forall₂ R) (Forall₂ P)) filterMap filterMap
Given a relation R
, sublist_forall₂ r l₁ l₂
indicates that there is a sublist of l₂
such
that forall₂ r l₁ l₂
.
- nil {α : Type u_1} {β : Type u_2} {R : α → β → Prop} {l : List β} : SublistForall₂ R [] l
- cons {α : Type u_1} {β : Type u_2} {R : α → β → Prop} {a₁ : α} {a₂ : β} {l₁ : List α} {l₂ : List β} : R a₁ a₂ → SublistForall₂ R l₁ l₂ → SublistForall₂ R (a₁ :: l₁) (a₂ :: l₂)
- cons_right {α : Type u_1} {β : Type u_2} {R : α → β → Prop} {a : β} {l₁ : List α} {l₂ : List β} : SublistForall₂ R l₁ l₂ → SublistForall₂ R l₁ (a :: l₂)
Instances For
instance
List.SublistForall₂.is_refl
{α : Type u_1}
{Rₐ : α → α → Prop}
[IsRefl α Rₐ]
:
IsRefl (List α) (SublistForall₂ Rₐ)
instance
List.SublistForall₂.is_trans
{α : Type u_1}
{Rₐ : α → α → Prop}
[IsTrans α Rₐ]
:
IsTrans (List α) (SublistForall₂ Rₐ)
theorem
List.Sublist.sublistForall₂
{α : Type u_1}
{Rₐ : α → α → Prop}
{l₁ l₂ : List α}
(h : l₁.Sublist l₂)
[IsRefl α Rₐ]
:
SublistForall₂ Rₐ l₁ l₂
theorem
List.tail_sublistForall₂_self
{α : Type u_1}
{Rₐ : α → α → Prop}
[IsRefl α Rₐ]
(l : List α)
:
SublistForall₂ Rₐ l.tail l