Set properties #
This file proves useful properties of canonical list-based sets defined in
Cedar.Data.Set.
Well-formed sets #
Equations
- s.WellFormed = (s = Cedar.Data.Set.make s.toList)
Instances For
theorem
Cedar.Data.Set.if_wellformed_then_exists_make
{α : Type u_1}
[LT α]
[DecidableLT α]
(s : Set α)
:
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 α}
:
empty #
Like List.not_mem_nil, lifted to Sets
@[simp]
isEmpty #
@[simp]
@[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 : α)
:
(singleton a).WellFormed
@[simp]
make #
theorem
Cedar.Data.Set.make_wf
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
(xs : List α)
:
(make xs).WellFormed
theorem
Cedar.Data.Set.make_elts
{α : Type u_1}
[LT α]
[DecidableLT α]
{s : Set α}
:
s.WellFormed → make s.elts = s
theorem
Cedar.Data.Set.elts_make_eqv
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
{xs : List α}
:
@[simp]
theorem
Cedar.Data.Set.make_eq_empty
{α : Type u_1}
[LT α]
[DecidableLT α]
[DecidableEq α]
{xs : List α}
:
theorem
Cedar.Data.Set.make_singleton_nonempty
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
(a : α)
:
def
Cedar.Data.Set.eq_means_eqv
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
{s₁ s₂ : Set α}
:
s₁.WellFormed → s₂.WellFormed → (s₁ = s₂ ↔ s₁.elts ≡ s₂.elts)
Equations
- ⋯ = ⋯
Instances For
inter and union #
theorem
Cedar.Data.Set.inter_def
{α : Type u_1}
[LT α]
[StrictLT α]
[DecidableLT α]
[DecidableEq α]
{s₁ s₂ : Set α}
:
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 α)
:
theorem
Cedar.Data.Set.intersects_def
{α : Type u_1}
[LT α]
[StrictLT α]
[DecidableLT α]
[DecidableEq α]
{s₁ s₂ : Set α}
:
theorem
Cedar.Data.Set.intersects_iff_exists
{α : Type u_1}
[LT α]
[StrictLT α]
[DecidableLT α]
[DecidableEq α]
{s₁ s₂ : Set α}
:
theorem
Cedar.Data.Set.union_wf
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
(s₁ s₂ : Set α)
:
(s₁ ∪ s₂).WellFormed
theorem
Cedar.Data.Set.union_comm
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
(s₁ s₂ : Set α)
:
theorem
Cedar.Data.Set.union_empty_right
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
{s : Set α}
:
s.WellFormed → s ∪ empty = s
theorem
Cedar.Data.Set.union_empty_left
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
{s : Set α}
:
s.WellFormed → empty ∪ s = s
theorem
Cedar.Data.Set.union_idempotent
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
{s : Set α}
:
s.WellFormed → s ∪ s = s
subset #
theorem
Cedar.Data.Set.elts_subset_then_subset
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
{xs ys : List α}
:
Like List.subset_def, but lifted to Sets
@[simp]
theorem
Cedar.Data.Set.subset_iff_eq
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
{s₁ s₂ : Set α}
:
s₁.WellFormed → s₂.WellFormed → (s₁ ⊆ s₂ ∧ s₂ ⊆ s₁ ↔ s₁ = s₂)
theorem
Cedar.Data.Set.subset_union
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
(s₁ s₂ : Set α)
:
theorem
Cedar.Data.Set.union_subset
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
{s₁ s₂ s₃ : Set α}
:
theorem
Cedar.Data.Set.union_subset_eq
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
{s₁ s₂ : Set α}
:
s₂.WellFormed → s₁ ⊆ s₂ → s₁ ∪ s₂ = s₂
theorem
Cedar.Data.Set.wellFormed_correct
{α : Type u_1}
[LT α]
[StrictLT α]
[DecidableLT α]
{s : Set α}
:
map #
theorem
Cedar.Data.Set.map_wf
{β : Type u_1}
{α : Type u_2}
[LT β]
[DecidableLT β]
[StrictLT β]
(f : α → β)
(s : Set α)
:
(map f s).WellFormed
theorem
Cedar.Data.Set.map_id
{α : Type u_1}
[LT α]
[DecidableLT α]
(s : Set α)
:
s.WellFormed → map id s = s
theorem
Cedar.Data.Set.map_congr
{β : Type u_1}
{α : Type u_2}
[LT β]
[DecidableLT β]
{f g : α → β}
{s : Set α}
:
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 α}
:
filter and differences #
theorem
Cedar.Data.Set.filter_wf
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
(p : α → Bool)
(s : Set α)
:
s.WellFormed → (filter p s).WellFormed
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 : α)
:
theorem
Cedar.Data.Set.difference_subset
{α : Type u_1}
[LT α]
[DecidableLT α]
[StrictLT α]
[DecidableEq α]
(s₁ s₂ : Set α)
: