Documentation

Cedar.Thm.Data.Set

Set properties #

This file proves useful properties of canonical list-based sets defined in Cedar.Data.Set.

Well-formed sets #

def Cedar.Data.Set.WellFormed {α : Type u_1} [LT α] [DecidableLT α] (s : Set α) :
Equations
Instances For
    theorem Cedar.Data.Set.if_wellformed_then_exists_make {α : Type u_1} [LT α] [DecidableLT α] (s : Set α) :
    s.WellFormed (list : List α), s = make list
    theorem Cedar.Data.Set.wf_iff_sorted {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (s : Set α) :

    contains and mem #

    @[simp]
    theorem Cedar.Data.Set.contains_prop_bool_equiv {α : Type u_1} [DecidableEq α] {v : α} {s : Set α} :
    @[simp]
    theorem Cedar.Data.Set.not_contains_prop_bool_equiv {α : Type u_1} [DecidableEq α] {v : α} {s : Set α} :
    theorem Cedar.Data.Set.mem_elts_iff_mem_set {α : Type u} (v : α) (s : Set α) :
    v s.elts v s
    theorem Cedar.Data.Set.mem_set_iff_mem_mk {α : Type u} (v : α) (xs : List α) :
    v xs v mk xs
    theorem Cedar.Data.Set.mem_mk_hd {α : Type u} (hd : α) (tl : List α) :
    hd mk (hd :: tl)
    theorem Cedar.Data.Set.mem_mk_tl {α : Type u} (a hd : α) (tl : List α) :
    a mk tla mk (hd :: tl)
    @[simp]
    theorem Cedar.Data.Set.mem_cons {α : Type u_1} {a hd : α} {tl : List α} :
    a mk (hd :: tl) a = hd a tl
    theorem Cedar.Data.Set.mem_set_implies_elts_non_empty {α : Type u} (v : α) (s : Set α) :
    v s¬s.elts = []

    empty #

    @[simp]
    theorem Cedar.Data.Set.not_mem_empty {α : Type u} (v : α) :

    Like List.not_mem_nil, lifted to Sets

    @[simp]
    theorem Cedar.Data.Set.map_empty {β : Type u_1} {α : Type u_2} [LT β] [DecidableLT β] (f : αβ) :
    @[simp]
    theorem Cedar.Data.Set.all_empty {α : Type u_1} (f : αBool) :
    @[simp]
    theorem Cedar.Data.Set.any_empty {α : Type u_1} (f : αBool) :

    isEmpty #

    @[simp]
    theorem Cedar.Data.Set.isEmpty_make {α : Type u_1} [DecidableEq α] [LT α] [DecidableLT α] {xs : List α} :
    @[simp]
    theorem Cedar.Data.Set.isEmpty_make_eq_false {α : Type u_1} [DecidableEq α] [LT α] [DecidableLT α] (xs : List α) :

    singleton #

    theorem Cedar.Data.Set.singleton_wf {α : Type u_1} [DecidableEq α] [LT α] [DecidableLT α] (a : α) :
    @[simp]
    theorem Cedar.Data.Set.mem_singleton {α : Type u_1} [DecidableEq α] (a b : α) :
    a singleton b a = b

    make #

    theorem Cedar.Data.Set.make_wf {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (xs : List α) :
    theorem Cedar.Data.Set.make_elts {α : Type u_1} [LT α] [DecidableLT α] {s : Set α} :
    s.WellFormedmake s.elts = s
    theorem Cedar.Data.Set.make_sorted {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {xs : List α} :
    xs.Sortedmake xs = mk xs
    @[simp]
    theorem Cedar.Data.Set.mem_make {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (x : α) (xs : List α) :
    x make xs x xs
    theorem Cedar.Data.Set.make_mk_eqv {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {xs ys : List α} :
    make xs = mk ysxs ys
    theorem Cedar.Data.Set.make_make_eqv {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {xs ys : List α} :
    make xs = make ys xs ys
    theorem Cedar.Data.Set.elts_make_eqv {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {xs : List α} :
    (make xs).elts xs
    @[simp]
    theorem Cedar.Data.Set.make_nil {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] :
    @[simp]
    theorem Cedar.Data.Set.make_eq_empty {α : Type u_1} [LT α] [DecidableLT α] [DecidableEq α] {xs : List α} :
    make xs = empty xs = []
    def Cedar.Data.Set.eq_means_eqv {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {s₁ s₂ : Set α} :
    s₁.WellFormeds₂.WellFormed → (s₁ = s₂ s₁.elts s₂.elts)
    Equations
    • =
    Instances For
      @[simp]
      theorem Cedar.Data.Set.any_make {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (f : αBool) (xs : List α) :
      any f (make xs) = xs.any f
      @[simp]
      theorem Cedar.Data.Set.make_elts_make {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (xs : List α) :
      make (make xs).elts = make xs
      theorem Cedar.Data.Set.elts_make_implies_equiv {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {xs ys : List α} :
      (make xs).elts = ysys xs
      theorem Cedar.Data.Set.make_cons {α : Type u_1} [LT α] [DecidableLT α] {xs ys : List α} {a : α} :
      make xs = make ysmake (a :: xs) = make (a :: ys)

      Note that the converse of this is not true: counterexample xs = [1], ys = [], a = 1.

      inter and union #

      theorem Cedar.Data.Set.inter_def {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] {s₁ s₂ : Set α} :
      s₁ s₂ = s₁.intersect s₂
      @[simp]
      theorem Cedar.Data.Set.mem_inter_iff {α : Type u_1} [DecidableEq α] {x : α} {s₁ s₂ : Set α} :
      x s₁ s₂ x s₁ x s₂
      theorem Cedar.Data.Set.inter_wf {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] {s₁ s₂ : Set α} (h₁ : s₁.WellFormed) :
      (s₁ s₂).WellFormed
      @[simp]
      theorem Cedar.Data.Set.inter_empty_left {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] (s : Set α) :
      @[simp]
      theorem Cedar.Data.Set.inter_empty_right {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] (s : Set α) :
      @[simp]
      theorem Cedar.Data.Set.inter_self {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] (s : Set α) :
      s s = s
      theorem Cedar.Data.Set.intersects_def {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] {s₁ s₂ : Set α} :
      (s₁.intersects s₂ = true) = ¬(s₁ s₂).isEmpty = true
      theorem Cedar.Data.Set.intersects_iff_exists {α : Type u_1} [LT α] [StrictLT α] [DecidableLT α] [DecidableEq α] {s₁ s₂ : Set α} :
      s₁.intersects s₂ = true (a : α), a s₁ a s₂
      theorem Cedar.Data.Set.union_wf {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (s₁ s₂ : Set α) :
      (s₁ s₂).WellFormed
      theorem Cedar.Data.Set.make_cons_eq_singleton_union {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (a : α) (xs : List α) :
      make (a :: xs) = singleton a make xs
      @[simp]
      theorem Cedar.Data.Set.mem_union {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (s₁ s₂ : Set α) (a : α) :
      a s₁ s₂ a s₁ a s₂
      theorem Cedar.Data.Set.prop_union_iff_prop_and {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (p : αProp) (s₁ s₂ : Set α) :
      ((∀ (a : α), a s₁p a) ∀ (a : α), a s₂p a) ∀ (a : α), a s₁ s₂p a
      theorem Cedar.Data.Set.union_comm {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (s₁ s₂ : Set α) :
      s₁ s₂ = s₂ s₁
      theorem Cedar.Data.Set.union_assoc {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (s₁ s₂ s₃ : Set α) :
      s₁ s₂ s₃ = s₁ (s₂ s₃)
      theorem Cedar.Data.Set.union_empty_right {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {s : Set α} :
      s.WellFormeds empty = s
      theorem Cedar.Data.Set.union_empty_left {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {s : Set α} :
      s.WellFormedempty s = s
      theorem Cedar.Data.Set.union_idempotent {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] {s : Set α} :
      s.WellFormeds s = s

      subset #

      theorem Cedar.Data.Set.elts_subset_then_subset {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] {xs ys : List α} :
      xs ysmake xs make ys
      theorem Cedar.Data.Set.subset_def {α : Type u_1} [DecidableEq α] {s₁ s₂ : Set α} :
      s₁ s₂ ∀ (a : α), a s₁a s₂

      Like List.subset_def, but lifted to Sets

      @[simp]
      theorem Cedar.Data.Set.subset_empty {α : Type u_1} [DecidableEq α] {s : Set α} :
      theorem Cedar.Data.Set.superset_empty_subset_empty {α : Type u_1} [DecidableEq α] {s₁ s₂ : Set α} :
      s₁ s₂s₂.isEmpty = trues₁.isEmpty = true
      theorem Cedar.Data.Set.subset_iff_subset_elts {α : Type u_1} [DecidableEq α] {s₁ s₂ : Set α} :
      s₁ s₂ s₁.elts s₂.elts
      theorem Cedar.Data.Set.subset_iff_eq {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] {s₁ s₂ : Set α} :
      s₁.WellFormeds₂.WellFormed → (s₁ s₂ s₂ s₁ s₁ = s₂)
      theorem Cedar.Data.Set.subset_trans {α : Type u_1} [DecidableEq α] {s₁ s₂ s₃ : Set α} :
      s₁ s₂s₂ s₃s₁ s₃
      theorem Cedar.Data.Set.subset_refl {α : Type u_1} [DecidableEq α] {s : Set α} :
      s s
      theorem Cedar.Data.Set.mem_subset_mem {α : Type u_1} [DecidableEq α] {a : α} {s₁ s₂ : Set α} :
      a s₁s₁ s₂a s₂
      theorem Cedar.Data.Set.subset_union {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] (s₁ s₂ : Set α) :
      s₁ s₁ s₂
      theorem Cedar.Data.Set.union_subset {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] {s₁ s₂ s₃ : Set α} :
      s₁ s₂ s₃ s₁ s₃ s₂ s₃
      theorem Cedar.Data.Set.union_subset_eq {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] {s₁ s₂ : Set α} :
      s₂.WellFormeds₁ s₂s₁ s₂ = s₂

      map #

      theorem Cedar.Data.Set.map_wf {β : Type u_1} {α : Type u_2} [LT β] [DecidableLT β] [StrictLT β] (f : αβ) (s : Set α) :
      theorem Cedar.Data.Set.map_id {α : Type u_1} [LT α] [DecidableLT α] (s : Set α) :
      s.WellFormedmap id s = s
      @[simp]
      theorem Cedar.Data.Set.mem_map {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] [StrictLT α] [LT β] [DecidableLT β] [StrictLT β] {b : β} {f : αβ} {s : Set α} :
      b map f s (a : α), a s f a = b

      Analogue of List.mem_map but for sets

      theorem Cedar.Data.Set.map_congr {β : Type u_1} {α : Type u_2} [LT β] [DecidableLT β] {f g : αβ} {s : Set α} :
      (∀ (a : α), a sf a = g a)map f s = map g s

      Analogue of List.map_congr, but for sets

      @[simp]
      theorem Cedar.Data.Set.isEmpty_map {α : Type u_1} {β : Type u_2} [DecidableEq α] [LT β] [DecidableLT β] [DecidableEq β] {f : αβ} {s : Set α} :
      @[simp]
      theorem Cedar.Data.Set.map_make {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] [StrictLT α] [LT β] [DecidableLT β] [StrictLT β] {f : αβ} {xs : List α} :
      map f (make xs) = make (List.map f xs)
      theorem Cedar.Data.Set.map_def {β : Type u_1} {α : Type u_2} [LT β] [DecidableLT β] (f : αβ) (s : Set α) :
      map f s = make (List.map f s.elts)

      filter and differences #

      theorem Cedar.Data.Set.filter_wf {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (p : αBool) (s : Set α) :
      @[simp]
      theorem Cedar.Data.Set.mem_filter {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] (p : αBool) (s : Set α) (e : α) :
      e filter p s e s p e = true
      theorem Cedar.Data.Set.difference_wf {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] (s₁ s₂ : Set α) :
      s₁.WellFormed(s₁.difference s₂).WellFormed
      @[simp]
      theorem Cedar.Data.Set.mem_difference {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] (s₁ s₂ : Set α) (e : α) :
      e s₁.difference s₂ e s₁ ¬e s₂
      theorem Cedar.Data.Set.difference_subset {α : Type u_1} [LT α] [DecidableLT α] [StrictLT α] [DecidableEq α] (s₁ s₂ : Set α) :
      s₁.difference s₂ s₁

      all and any #

      @[simp]
      theorem Cedar.Data.Set.all_eq_true {α : Type u_1} {f : αBool} {s : Set α} :
      all f s = true ∀ (x : α), x sf x = true

      Like List.all_eq_true, but for Set.all

      @[simp]
      theorem Cedar.Data.Set.all_eq_false {α : Type u_1} {f : αBool} {s : Set α} :
      all f s = false (x : α), x s ¬f x = true

      Like List.all_eq_false, but for Set.all

      @[simp]
      theorem Cedar.Data.Set.any_eq_true {α : Type u_1} {f : αBool} {s : Set α} :
      any f s = true (x : α), x s f x = true

      Like List.any_eq_true, but for Set.any

      @[simp]
      theorem Cedar.Data.Set.any_eq_false {α : Type u_1} {f : αBool} {s : Set α} :
      any f s = false ∀ (x : α), x s¬f x = true

      Like List.any_eq_false, but for Set.any

      map₁, all₁, and any₁ #

      @[simp]
      theorem Cedar.Data.Set.map₁_eq_map {α : Type u_1} {β : Type u_2} [LT α] [DecidableLT α] [LT β] [DecidableLT β] (f : αβ) (s : Set α) :
      (s.map₁ fun (x : { a : α // a s }) => match x with | elt, property => f elt) = map f s
      @[simp]
      theorem Cedar.Data.Set.all₁_eq_all {α : Type u_1} {s : Set α} {f : αBool} :
      (s.all₁ fun (x : { a : α // a s }) => match x with | elt, property => f elt) = all f s
      @[simp]
      theorem Cedar.Data.Set.any₁_eq_any {α : Type u_1} {s : Set α} {f : αBool} :
      (s.any₁ fun (x : { a : α // a s }) => match x with | elt, property => f elt) = any f s