File: Mathlib/SetTheory/Lists.lean

full_name: Lists'.cons'
code: /-- Prelists, helper type to define `Lists`. `Lists' α false` are the "atoms", a copy of `α`.
`Lists' α true` are the "proper" ZFA prelists, inductively defined from the empty ZFA prelist and
from appending a ZFA prelist to a proper ZFA prelist. It is made so that you can't append anything
to an atom while having only one appending function for appending both atoms and proper ZFC prelists
to a proper ZFA prelist. -/
inductive Lists'.{u} (α : Type u) : Bool → Type u
  | atom : α → Lists' α false
  | nil : Lists' α true
  | cons' {b} : Lists' α b → Lists' α true → Lists' α true
  deriving DecidableEq
goal: Lists' α b → Lists' α true → Lists' α true

full_name: Lists'.atom
code: /-- Prelists, helper type to define `Lists`. `Lists' α false` are the "atoms", a copy of `α`.
`Lists' α true` are the "proper" ZFA prelists, inductively defined from the empty ZFA prelist and
from appending a ZFA prelist to a proper ZFA prelist. It is made so that you can't append anything
to an atom while having only one appending function for appending both atoms and proper ZFC prelists
to a proper ZFA prelist. -/
inductive Lists'.{u} (α : Type u) : Bool → Type u
  | atom : α → Lists' α false
  | nil : Lists' α true
  | cons' {b} : Lists' α b → Lists' α true → Lists' α true
  deriving DecidableEq
goal: α → Lists' α false

full_name: Lists'.nil
code: /-- Prelists, helper type to define `Lists`. `Lists' α false` are the "atoms", a copy of `α`.
`Lists' α true` are the "proper" ZFA prelists, inductively defined from the empty ZFA prelist and
from appending a ZFA prelist to a proper ZFA prelist. It is made so that you can't append anything
to an atom while having only one appending function for appending both atoms and proper ZFC prelists
to a proper ZFA prelist. -/
inductive Lists'.{u} (α : Type u) : Bool → Type u
  | atom : α → Lists' α false
  | nil : Lists' α true
  | cons' {b} : Lists' α b → Lists' α true → Lists' α true
  deriving DecidableEq
goal: Lists' α true

full_name: Lists
code: /-- Hereditarily finite list, aka ZFA list. A ZFA list is either an "atom" (`b = false`),
corresponding to an element of `α`, or a "proper" ZFA list, inductively defined from the empty ZFA
list and from appending a ZFA list to a proper ZFA list. -/
def Lists (α : Type*) 
goal: Type u_2

full_name: Lists'.instInhabited
code: instance [Inhabited α] : ∀ b, Inhabited (Lists' α b)
  
goal: Inhabited (Lists' α b)

full_name: Lists'.cons
code: /-- Appending a ZFA list to a proper ZFA prelist. -/
def cons : Lists α → Lists' α true → Lists' α true
  
goal: Lists α → Lists' α true → Lists' α true

full_name: Lists'.toList
code: /-- Converts a ZFA prelist to a `List` of ZFA lists. Atoms are sent to `[]`. -/
@[simp]
def toList : ∀ {b}, Lists' α b → List (Lists α)
  
goal: Lists' α b → List (Lists α)

full_name: Lists'.toList_cons
code: @[simp]
theorem toList_cons (a : Lists α) (l) : toList (cons a l) = a :: l.toList 
goal: (Lists'.cons a l).toList = a :: l.toList

full_name: Lists'.ofList
code: /-- Converts a `List` of ZFA lists to a proper ZFA prelist. -/
@[simp]
def ofList : List (Lists α) → Lists' α true
  
goal: List (Lists α) → Lists' α true

full_name: Lists'.to_ofList
code: @[simp]
theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l 
goal: (Lists'.ofList l).toList = l

full_name: Lists'.of_toList
code: @[simp]
theorem of_toList : ∀ l : Lists' α true, ofList (toList l) = l 
goal: Lists'.ofList l.toList = l

full_name: «_aux_Mathlib_SetTheory_Lists___macroRules_term_~__1»
code: local infixl:50 " ~ " => Lists.Equiv
goal: Lean.Macro

full_name: _aux_Mathlib_SetTheory_Lists___unexpand_Lists_Equiv_1
code: local infixl:50 " ~ " => Lists.Equiv
goal: Lean.PrettyPrinter.Unexpander

full_name: Lists'.instHasSubsetTrue
code: instance : HasSubset (Lists' α true) 
goal: HasSubset (Lists' α true)

full_name: Lists'.instMembershipLists
code: /-- ZFA prelist membership. A ZFA list is in a ZFA prelist if some element of this ZFA prelist is
equivalent as a ZFA list to this ZFA list. -/
instance {b} : Membership (Lists α) (Lists' α b) 
goal: Membership (Lists α) (Lists' α b)

full_name: Lists'.mem_def
code: theorem mem_def {b a} {l : Lists' α b} : a ∈ l ↔ ∃ a' ∈ l.toList, a ~ a' 
goal: a ∈ l ↔ ∃ a' ∈ l.toList, a ~ a'

full_name: Lists'.mem_cons
code: @[simp]
theorem mem_cons {a y l} : a ∈ @cons α y l ↔ a ~ y ∨ a ∈ l 
goal: a ∈ Lists'.cons y l ↔ a ~ y ∨ a ∈ l

full_name: Lists'.cons_subset
code: theorem cons_subset {a} {l₁ l₂ : Lists' α true} : Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂ 
goal: Lists'.cons a l₁ ⊆ l₂ ↔ a ∈ l₂ ∧ l₁ ⊆ l₂

full_name: Lists'.ofList_subset
code: theorem ofList_subset {l₁ l₂ : List (Lists α)} (h : l₁ ⊆ l₂) :
    Lists'.ofList l₁ ⊆ Lists'.ofList l₂ 
goal: Lists'.ofList l₁ ⊆ Lists'.ofList l₂

full_name: Lists'.Subset.refl
code: @[refl]
theorem Subset.refl {l : Lists' α true} : l ⊆ l 
goal: l ⊆ l

full_name: Lists'.subset_nil
code: theorem subset_nil {l : Lists' α true} : l ⊆ Lists'.nil → l = Lists'.nil 
goal: l ⊆ Lists'.nil → l = Lists'.nil

full_name: Lists'.mem_of_subset'
code: theorem mem_of_subset' {a} : ∀ {l₁ l₂ : Lists' α true} (_ : l₁ ⊆ l₂) (_ : a ∈ l₁.toList), a ∈ l₂
  
goal: l₁ ⊆ l₂ → a ∈ l₁.toList → a ∈ l₂

full_name: Lists'.subset_def
code: theorem subset_def {l₁ l₂ : Lists' α true} : l₁ ⊆ l₂ ↔ ∀ a ∈ l₁.toList, a ∈ l₂ 
goal: l₁ ⊆ l₂ ↔ ∀ a ∈ l₁.toList, a ∈ l₂

full_name: Lists.atom
code: /-- Sends `a : α` to the corresponding atom in `Lists α`. -/
@[match_pattern]
def atom (a : α) : Lists α 
goal: Lists α

full_name: Lists.of'
code: /-- Converts a proper ZFA prelist to a ZFA list. -/
@[match_pattern]
def of' (l : Lists' α true) : Lists α 
goal: Lists α

full_name: Lists.toList
code: /-- Converts a ZFA list to a `List` of ZFA lists. Atoms are sent to `[]`. -/
@[simp]
def toList : Lists α → List (Lists α)
  
goal: Lists α → List (Lists α)

full_name: Lists.IsList
code: /-- Predicate stating that a ZFA list is proper. -/
def IsList (l : Lists α) : Prop 
goal: Prop

full_name: Lists.ofList
code: /-- Converts a `List` of ZFA lists to a ZFA list. -/
def ofList (l : List (Lists α)) : Lists α 
goal: Lists α

full_name: Lists.isList_toList
code: theorem isList_toList (l : List (Lists α)) : IsList (ofList l) 
goal: (Lists.ofList l).IsList

full_name: Lists.to_ofList
code: theorem to_ofList (l : List (Lists α)) : toList (ofList l) = l 
goal: (Lists.ofList l).toList = l

full_name: Lists.of_toList
code: theorem of_toList : ∀ {l : Lists α}, IsList l → ofList (toList l) = l
  
goal: l.IsList → Lists.ofList l.toList = l

full_name: Lists.instInhabited
code: instance : Inhabited (Lists α) 
goal: Inhabited (Lists α)

full_name: Lists.instDecidableEq
code: instance [DecidableEq α] : DecidableEq (Lists α) 
goal: DecidableEq (Lists α)

full_name: Lists.instSizeOf
code: instance [SizeOf α] : SizeOf (Lists α) 
goal: SizeOf (Lists α)

full_name: Lists.inductionMut
code: /-- A recursion principle for pairs of ZFA lists and proper ZFA prelists. -/
def inductionMut (C : Lists α → Sort*) (D : Lists' α true → Sort*)
    (C0 : ∀ a, C (atom a)) (C1 : ∀ l, D l → C (of' l))
    (D0 : D Lists'.nil) (D1 : ∀ a l, C a → D l → D (Lists'.cons a l)) :
    PProd (∀ l, C l) (∀ l, D l) 
goal: PProd ((l : Lists α) → C l) ((l : Lists' α true) → D l)

full_name: Lists.mem
code: /-- Membership of ZFA list. A ZFA list belongs to a proper ZFA list if it belongs to the latter as a
proper ZFA prelist. An atom has no members. -/
def mem (a : Lists α) : Lists α → Prop
  
goal: Lists α → Prop

full_name: Lists.instMembership
code: instance : Membership (Lists α) (Lists α) 
goal: Membership (Lists α) (Lists α)

full_name: Lists.isList_of_mem
code: theorem isList_of_mem {a : Lists α} : ∀ {l : Lists α}, a ∈ l → IsList l
  
goal: a ∈ l → l.IsList

full_name: Lists.Equiv.antisymm_iff
code: theorem Equiv.antisymm_iff {l₁ l₂ : Lists' α true} : of' l₁ ~ of' l₂ ↔ l₁ ⊆ l₂ ∧ l₂ ⊆ l₁ 
goal: Lists.of' l₁ ~ Lists.of' l₂ ↔ l₁ ⊆ l₂ ∧ l₂ ⊆ l₁

full_name: Lists.equiv_atom
code: theorem equiv_atom {a} {l : Lists α} : atom a ~ l ↔ atom a = l 
goal: Lists.atom a ~ l ↔ Lists.atom a = l

full_name: Lists.Equiv.symm
code: @[symm]
theorem Equiv.symm {l₁ l₂ : Lists α} (h : l₁ ~ l₂) : l₂ ~ l₁ 
goal: l₂ ~ l₁

full_name: Lists.Equiv.trans
code: theorem Equiv.trans : ∀ {l₁ l₂ l₃ : Lists α}, l₁ ~ l₂ → l₂ ~ l₃ → l₁ ~ l₃ 
goal: l₁ ~ l₂ → l₂ ~ l₃ → l₁ ~ l₃

full_name: Lists.instSetoidLists
code: instance instSetoidLists : Setoid (Lists α) 
goal: Setoid (Lists α)

full_name: Lists.Equiv.decidableMeas
code: /-- Auxiliary function to prove termination of decidability checking -/
@[simp, deprecated (since := "2023-06-24")]
def Equiv.decidableMeas :
    ((Σ' _l₁ : Lists α, Lists α) ⊕'
        ((Σ' _l₁ : Lists' α true, Lists' α true) ⊕' (Σ' _a : Lists α, Lists' α true))) →
      ℕ
  
goal: (_ : Lists α) ×' Lists α ⊕' (_ : Lists' α true) ×' Lists' α true ⊕' (_ : Lists α) ×' Lists' α true → ℕ

full_name: Lists.sizeof_pos
code: theorem sizeof_pos {b} (l : Lists' α b) : 0 < SizeOf.sizeOf l 
goal: 0 < sizeOf l

full_name: Lists.lt_sizeof_cons'
code: theorem lt_sizeof_cons' {b} (a : Lists' α b) (l) :
    SizeOf.sizeOf (⟨b, a⟩ : Lists α) < SizeOf.sizeOf (Lists'.cons' a l) 
goal: sizeOf ⟨b, a⟩ < sizeOf (a.cons' l)

full_name: Lists'.mem_equiv_left
code: theorem mem_equiv_left {l : Lists' α true} : ∀ {a a'}, a ~ a' → (a ∈ l ↔ a' ∈ l) 
goal: a ~ a' → (a ∈ l ↔ a' ∈ l)

full_name: Lists'.mem_of_subset
code: theorem mem_of_subset {a} {l₁ l₂ : Lists' α true} (s : l₁ ⊆ l₂) : a ∈ l₁ → a ∈ l₂
  
goal: a ∈ l₁ → a ∈ l₂

full_name: Lists'.Subset.trans
code: theorem Subset.trans {l₁ l₂ l₃ : Lists' α true} (h₁ : l₁ ⊆ l₂) (h₂ : l₂ ⊆ l₃) : l₁ ⊆ l₃ 
goal: l₁ ⊆ l₃

full_name: Finsets
code: /-- `Finsets` are defined via equivalence classes of `Lists` -/
def Finsets (α : Type*) 
goal: Type u_2

full_name: Finsets.instEmptyCollection
code: instance : EmptyCollection (Finsets α) 
goal: EmptyCollection (Finsets α)

full_name: Finsets.instInhabited
code: instance : Inhabited (Finsets α) 
goal: Inhabited (Finsets α)

full_name: Finsets.instDecidableEq
code: instance [DecidableEq α] : DecidableEq (Finsets α) 
goal: DecidableEq (Finsets α)