The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V33. Data structures and computation

Mathlib.Data.List.TFAE

13 declarations. Mathlib docs · Source

The Following Are Equivalent

This file allows to state that all propositions in a list are equivalent. It is used by Mathlib/Tactic/Tfae.lean.

def List.TFAE E1 #

List Prop → Prop

TFAE: The Following (propositions) Are Equivalent.

The tfae_have and tfae_finish tactics can be useful in proofs with TFAE goals.

theorem List.tfae_nil E1 #

[].TFAE

theorem List.tfae_singleton E0 #

∀ (p : Prop), [p].TFAE

theorem List.TFAE.subset E1 #

∀ {l₁ l₂ : List Prop}, l₂.TFAE → l₁ ⊆ l₂ → l₁.TFAE

theorem List.tfae_congr E1 #

∀ {l₁ l₂ : List Prop}, l₁ ⊆ l₂ → l₂ ⊆ l₁ → (l₁.TFAE ↔ l₂.TFAE)

theorem List.Perm.tfae_iff E0 #

∀ {l₁ l₂ : List Prop}, l₁.Perm l₂ → (l₁.TFAE ↔ l₂.TFAE)

theorem List.tfae_reverse E0 #

∀ {l : List Prop}, l.reverse.TFAE ↔ l.TFAE

theorem List.tfae_of_forall E1 #

∀ {b : Prop} {l : List Prop}, (∀ a ∈ l, a ↔ b) → l.TFAE

theorem List.TFAE.out E1 #

∀ {l : List Prop},
  l.TFAE →
    ∀ (i j : ℕ) {a b : Prop},
      autoParam (l[i - 1]? = some a) List.TFAE.out._auto_1 →
        autoParam (l[j - 1]? = some b) List.TFAE.out._auto_3 →
          autoParam (i ≠ 0) List.TFAE.out._auto_5 → autoParam (j ≠ 0) List.TFAE.out._auto_7 → (a ↔ b)

(TFAE [P₁, P₂, P₃, ...]).out i j, where i, j are the 1-indexed indices for TFAE statements, yields a proof of Pᵢ ↔ Pⱼ. Indices therefore must be greater than 0. This convention matches the statement numbering in tfae tactics.

theorem List.forall_tfae E1 #

∀ {α : Type u_1} (l : List (α → Prop)),
  (∀ (a : α), (List.map (fun p ↦ p a) l).TFAE) → (List.map (fun p ↦ ∀ (a : α), p a) l).TFAE

If P₁ x ↔ ... ↔ Pₙ x for all x, then (∀ x, P₁ x) ↔ ... ↔ (∀ x, Pₙ x). Note: in concrete cases, Lean has trouble finding the list [P₁, ..., Pₙ] from the list [(∀ x, P₁ x), ..., (∀ x, Pₙ x)], but simply providing a list of underscores with the right length makes it happier.

Example:

example (P₁ P₂ P₃ : ℕ → Prop) (H : ∀ n, [P₁ n, P₂ n, P₃ n].TFAE) :
    [∀ n, P₁ n, ∀ n, P₂ n, ∀ n, P₃ n].TFAE :=
  forall_tfae [_, _, _] H

theorem List.exists_tfae E1 #

∀ {α : Type u_1} (l : List (α → Prop)),
  (∀ (a : α), (List.map (fun p ↦ p a) l).TFAE) → (List.map (fun p ↦ ∃ a, p a) l).TFAE

If P₁ x ↔ ... ↔ Pₙ x for all x, then (∃ x, P₁ x) ↔ ... ↔ (∃ x, Pₙ x). Note: in concrete cases, Lean has trouble finding the list [P₁, ..., Pₙ] from the list [(∃ x, P₁ x), ..., (∃ x, Pₙ x)], but simply providing a list of underscores with the right length makes it happier.

Example:

example (P₁ P₂ P₃ : ℕ → Prop) (H : ∀ n, [P₁ n, P₂ n, P₃ n].TFAE) :
    [∃ n, P₁ n, ∃ n, P₂ n, ∃ n, P₃ n].TFAE :=
  exists_tfae [_, _, _] H

theorem List.tfae_not_iff E0 #

∀ {l : List Prop}, (List.map Not l).TFAE ↔ l.TFAE

theorem List.TFAE.not E1 #

∀ {l : List Prop}, l.TFAE → (List.map Not l).TFAE

Alias of the reverse direction of List.tfae_not_iff.