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 / V04. Order and lattices

Mathlib.Order.Fin.Tuple

46 declarations. Mathlib docs · Source

Order properties on tuples

theorem RelIso.mk.congr_simp E1 #

∀ {α : Type u_5} {β : Type u_6} {r : α → α → Prop} {s : β → β → Prop} (toEquiv toEquiv_1 : α ≃ β)
  (e_toEquiv : toEquiv = toEquiv_1) (map_rel_iff' : ∀ {a b : α}, s (toEquiv a) (toEquiv b) ↔ r a b),
  { toEquiv := toEquiv, map_rel_iff' := map_rel_iff' } = { toEquiv := toEquiv_1, map_rel_iff' := ⋯ }

theorem Fin.pi_lex_lt_cons_cons E1 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_1} {x₀ y₀ : α 0} {x y : (i : Fin n) → α i.succ}
  (s : {i : Fin n.succ} → α i → α i → Prop),
  Pi.Lex (fun x1 x2 ↦ x1 < x2) s (Fin.cons x₀ x) (Fin.cons y₀ y) ↔
    s x₀ y₀ ∨ x₀ = y₀ ∧ Pi.Lex (fun x1 x2 ↦ x1 < x2) (fun i ↦ s) x y

theorem Fin.insertNth_mem_Icc E1 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_1} [inst : (i : Fin (n + 1)) → Preorder (α i)] {i : Fin (n + 1)} {x : α i}
  {p : (j : Fin n) → α (i.succAbove j)} {q₁ q₂ : (j : Fin (n + 1)) → α j},
  i.insertNth x p ∈ Set.Icc q₁ q₂ ↔
    x ∈ Set.Icc (q₁ i) (q₂ i) ∧ p ∈ Set.Icc (fun j ↦ q₁ (i.succAbove j)) fun j ↦ q₂ (i.succAbove j)

theorem Fin.preimage_insertNth_Icc_of_mem E1 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_1} [inst : (i : Fin (n + 1)) → Preorder (α i)] {i : Fin (n + 1)} {x : α i}
  {q₁ q₂ : (j : Fin (n + 1)) → α j},
  x ∈ Set.Icc (q₁ i) (q₂ i) →
    i.insertNth x ⁻¹' Set.Icc q₁ q₂ = Set.Icc (fun j ↦ q₁ (i.succAbove j)) fun j ↦ q₂ (i.succAbove j)

theorem Fin.preimage_insertNth_Icc_of_notMem E1 #

∀ {n : ℕ} {α : Fin (n + 1) → Type u_1} [inst : (i : Fin (n + 1)) → Preorder (α i)] {i : Fin (n + 1)} {x : α i}
  {q₁ q₂ : (j : Fin (n + 1)) → α j}, x ∉ Set.Icc (q₁ i) (q₂ i) → i.insertNth x ⁻¹' Set.Icc q₁ q₂ = ∅

theorem liftFun_vecCons E1 #

∀ {α : Type u_1} {n : ℕ} (r : α → α → Prop) [IsTrans α r] {f : Fin (n + 1) → α} {a : α},
  Relator.LiftFun (fun x1 x2 ↦ x1 < x2) r (Matrix.vecCons a f) (Matrix.vecCons a f) ↔
    r a (f 0) ∧ Relator.LiftFun (fun x1 x2 ↦ x1 < x2) r f f

theorem Fin.liftFun_cons E1 #

∀ {α : Type u_1} {n : ℕ} (r : α → α → Prop) [IsTrans α r] {f : Fin n → α} {a : α},
  Relator.LiftFun (fun x1 x2 ↦ x1 < x2) r (Fin.cons a f) (Fin.cons a f) ↔
    (∀ (i : Fin n), r a (f i)) ∧ Relator.LiftFun (fun x1 x2 ↦ x1 < x2) r f f

theorem Fin.strictMono_insertNth_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} (q : Fin (n + 1)) (x : α) (f : Fin n → α),
  StrictMono (q.insertNth x f) ↔
    StrictMono f ∧ (∀ (i : Fin n), i.castSucc < q → f i < x) ∧ ∀ (i : Fin n), q ≤ i.castSucc → x < f i

theorem Fin.strictMono_cons E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α} {a : α},
  StrictMono (Fin.cons a f) ↔ (∀ (j : Fin n), a < f j) ∧ StrictMono f

theorem Fin.strictMono_cons_zero_succ E0 #

∀ {n : ℕ} {f : Fin n → Fin (n + 1)}, StrictMono (Fin.cons 0 f) ↔ f = Fin.succ

theorem strictMono_vecCons E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  StrictMono (Matrix.vecCons a f) ↔ a < f 0 ∧ StrictMono f

theorem monotone_vecCons E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  Monotone (Matrix.vecCons a f) ↔ a ≤ f 0 ∧ Monotone f

theorem monotone_vecEmpty E0 #

∀ {α : Type u_1} [inst : Preorder α] {a : α}, Monotone ![a]

theorem strictMono_vecEmpty E0 #

∀ {α : Type u_1} [inst : Preorder α] {a : α}, StrictMono ![a]

theorem strictAnti_vecCons E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  StrictAnti (Matrix.vecCons a f) ↔ f 0 < a ∧ StrictAnti f

theorem antitone_vecCons E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  Antitone (Matrix.vecCons a f) ↔ f 0 ≤ a ∧ Antitone f

theorem antitone_vecEmpty E0 #

∀ {α : Type u_1} [inst : Preorder α] {a : α}, Antitone ![a]

theorem strictAnti_vecEmpty E0 #

∀ {α : Type u_1} [inst : Preorder α] {a : α}, StrictAnti ![a]

theorem StrictMono.vecCons E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  StrictMono f → a < f 0 → StrictMono (Matrix.vecCons a f)

theorem StrictMono.removeNth E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α},
  StrictMono f → ∀ (i : Fin (n + 1)), StrictMono (i.removeNth f)

theorem StrictAnti.vecCons E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  StrictAnti f → f 0 < a → StrictAnti (Matrix.vecCons a f)

theorem Monotone.vecCons E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  Monotone f → a ≤ f 0 → Monotone (Matrix.vecCons a f)

theorem Antitone.vecCons E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin (n + 1) → α} {a : α},
  Antitone f → f 0 ≤ a → Antitone (Matrix.vecCons a f)

def OrderIso.piFinTwoIso E1 #

(α : Fin 2 → Type u_2) → [inst : (i : Fin 2) → Preorder (α i)] → ((i : Fin 2) → α i) ≃o α 0 × α 1

Π i : Fin 2, α i is order equivalent to α 0 × α 1. See also OrderIso.finTwoArrowEquiv for a non-dependent version.

def OrderIso.finTwoArrowIso E1 #

(α : Type u_2) → [inst : Preorder α] → (Fin 2 → α) ≃o α × α

The space of functions Fin 2 → α is order equivalent to α × α. See also OrderIso.piFinTwoIso.

def Fin.consOrderIso E1 #

{n : ℕ} →
  (α : Fin (n + 1) → Type u_2) →
    [inst : (i : Fin (n + 1)) → LE (α i)] → α 0 × ((i : Fin n) → α i.succ) ≃o ((i : Fin (n + 1)) → α i)

Order isomorphism between tuples of length n + 1 and pairs of an element and a tuple of length n given by separating out the first element of the tuple.

This is Fin.cons as an OrderIso.

theorem Fin.consOrderIso_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (f : α 0 × ((i : Fin n) → α i.succ))
  (i : Fin (n + 1)), (Fin.consOrderIso α) f i = Fin.cons f.1 f.2 i

theorem Fin.consOrderIso_symm_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (f : (i : Fin (n + 1)) → α i),
  (RelIso.symm (Fin.consOrderIso α)) f = (f 0, Fin.tail f)

theorem Fin.consOrderIso_toEquiv E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)],
  (Fin.consOrderIso α).toEquiv = Fin.consEquiv α

def Fin.snocOrderIso E1 #

{n : ℕ} →
  (α : Fin (n + 1) → Type u_2) →
    [inst : (i : Fin (n + 1)) → LE (α i)] → α (Fin.last n) × ((i : Fin n) → α i.castSucc) ≃o ((i : Fin (n + 1)) → α i)

Order isomorphism between tuples of length n + 1 and pairs of an element and a tuple of length n given by separating out the last element of the tuple.

This is Fin.snoc as an OrderIso.

theorem Fin.snocOrderIso_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)]
  (f : α (Fin.last n) × ((i : Fin n) → α i.castSucc)) (i : Fin (n + 1)), (Fin.snocOrderIso α) f i = Fin.snoc f.2 f.1 i

theorem Fin.snocOrderIso_symm_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (f : (i : Fin (n + 1)) → α i),
  (RelIso.symm (Fin.snocOrderIso α)) f = (f (Fin.last n), Fin.init f)

theorem Fin.snocOrderIso_toEquiv E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)],
  (Fin.snocOrderIso α).toEquiv = Fin.snocEquiv α

def Fin.insertNthOrderIso E1 #

{n : ℕ} →
  (α : Fin (n + 1) → Type u_2) →
    [inst : (i : Fin (n + 1)) → LE (α i)] →
      (p : Fin (n + 1)) → α p × ((i : Fin n) → α (p.succAbove i)) ≃o ((i : Fin (n + 1)) → α i)

Order isomorphism between tuples of length n + 1 and pairs of an element and a tuple of length n given by separating out the p-th element of the tuple.

This is Fin.insertNth as an OrderIso.

theorem Fin.insertNthOrderIso_symm_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (p : Fin (n + 1))
  (f : (i : Fin (n + 1)) → α i), (RelIso.symm (Fin.insertNthOrderIso α p)) f = (f p, p.removeNth f)

theorem Fin.insertNthOrderIso_toEquiv E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (p : Fin (n + 1)),
  (Fin.insertNthOrderIso α p).toEquiv = Fin.insertNthEquiv α p

theorem Fin.insertNthOrderIso_apply E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)] (p : Fin (n + 1))
  (f : α p × ((i : Fin n) → α (p.succAbove i))) (j : Fin (n + 1)),
  (Fin.insertNthOrderIso α p) f j = p.insertNth f.1 f.2 j

theorem Fin.insertNthOrderIso_zero E0 #

∀ {n : ℕ} (α : Fin (n + 1) → Type u_2) [inst : (i : Fin (n + 1)) → LE (α i)],
  Fin.insertNthOrderIso α 0 = Fin.consOrderIso α

theorem Fin.insertNthOrderIso_last E0 #

∀ (n : ℕ) (α : Type u_2) [inst : LE α], Fin.insertNthOrderIso (fun x ↦ α) (Fin.last n) = Fin.snocOrderIso fun x ↦ α

Note this lemma can only be written about non-dependent tuples as insertNth (last n) = snoc is not a definitional equality.

def finSuccAboveOrderIso E1 #

{n : ℕ} → (p : Fin (n + 1)) → Fin n ≃o { x // x ≠ p }

Fin.succAbove as an order isomorphism between Fin n and {x : Fin (n + 1) // x ≠ p}.

theorem finSuccAboveOrderIso_apply E0 #

∀ {n : ℕ} (p : Fin (n + 1)) (i : Fin n), (finSuccAboveOrderIso p) i = ⟨p.succAbove i, ⋯⟩

theorem finSuccAboveOrderIso_symm_apply_last E1 #

∀ {n : ℕ} (x : { x // x ≠ Fin.last n }), (finSuccAboveOrderIso (Fin.last n)).symm x = (↑x).castLT ⋯

theorem finSuccAboveOrderIso_symm_apply_ne_last E1 #

∀ {n : ℕ} {p : Fin (n + 1)} (h : p ≠ Fin.last n) (x : { x // x ≠ p }),
  (finSuccAboveEquiv p).symm x = (p.castLT ⋯).predAbove ↑x

def Fin.castLEOrderIso E1 #

{n m : ℕ} → n ≤ m → Fin n ≃o { i // ↑i < n }

Promote a Fin n into a larger Fin m, as a subtype where the underlying values are retained. This is the OrderIso version of Fin.castLE.

theorem Fin.castLEOrderIso_symm_apply E0 #

∀ {n m : ℕ} (h : n ≤ m) (i : { i // ↑i < n }), (RelIso.symm (Fin.castLEOrderIso h)) i = ⟨↑↑i, ⋯⟩

theorem Fin.castLEOrderIso_apply E0 #

∀ {n m : ℕ} (h : n ≤ m) (i : Fin n), (Fin.castLEOrderIso h) i = ⟨Fin.castLE h i, ⋯⟩