File: Mathlib/Combinatorics/Colex.lean

full_name: Finset.Colex
code: /-- Type synonym of `Finset α` equipped with the colexicographic order rather than the inclusion
order. -/
@[ext]
structure Colex (α) :=
  /-- `toColex` is the "identity" function between `Finset α` and `Finset.Colex α`. -/
  toColex ::
  /-- `ofColex` is the "identity" function between `Finset.Colex α` and `Finset α`. -/
  (ofColex : Finset α)
goal: Type u_3

full_name: Finset.Colex.toColex
code: /-- Type synonym of `Finset α` equipped with the colexicographic order rather than the inclusion
order. -/
@[ext]
structure Colex (α) :=
  /-- `toColex` is the "identity" function between `Finset α` and `Finset.Colex α`. -/
  toColex ::
  /-- `ofColex` is the "identity" function between `Finset.Colex α` and `Finset α`. -/
  (ofColex : Finset α)
goal: Finset.Colex α

full_name: Finset.Colex.ofColex
code: /-- Type synonym of `Finset α` equipped with the colexicographic order rather than the inclusion
order. -/
@[ext]
structure Colex (α) :=
  /-- `toColex` is the "identity" function between `Finset α` and `Finset.Colex α`. -/
  toColex ::
  /-- `ofColex` is the "identity" function between `Finset.Colex α` and `Finset α`. -/
  (ofColex : Finset α)
goal: Finset α

full_name: Finset.instInhabitedColex
code: instance : Inhabited (Colex α) 
goal: Inhabited (Finset.Colex α)

full_name: Finset.toColex_ofColex
code: @[simp] lemma toColex_ofColex (s : Colex α) : toColex (ofColex s) = s 
goal: { ofColex := s.ofColex } = s

full_name: Finset.ofColex_toColex
code: lemma ofColex_toColex (s : Finset α) : ofColex (toColex s) = s 
goal: { ofColex := s }.ofColex = s

full_name: Finset.toColex_inj
code: lemma toColex_inj {s t : Finset α} : toColex s = toColex t ↔ s = t 
goal: { ofColex := s } = { ofColex := t } ↔ s = t

full_name: Finset.ofColex_inj
code: @[simp]
lemma ofColex_inj {s t : Colex α} : ofColex s = ofColex t ↔ s = t 
goal: s.ofColex = t.ofColex ↔ s = t

full_name: Finset.toColex_ne_toColex
code: lemma toColex_ne_toColex {s t : Finset α} : toColex s ≠ toColex t ↔ s ≠ t 
goal: { ofColex := s } ≠ { ofColex := t } ↔ s ≠ t

full_name: Finset.ofColex_ne_ofColex
code: lemma ofColex_ne_ofColex {s t : Colex α} : ofColex s ≠ ofColex t ↔ s ≠ t 
goal: s.ofColex ≠ t.ofColex ↔ s ≠ t

full_name: Finset.toColex_injective
code: lemma toColex_injective : Injective (toColex : Finset α → Colex α) 
goal: Function.Injective Finset.Colex.toColex

full_name: Finset.ofColex_injective
code: lemma ofColex_injective : Injective (ofColex : Colex α → Finset α) 
goal: Function.Injective Finset.Colex.ofColex

full_name: Finset.Colex.instLE
code: instance instLE : LE (Colex α) 
goal: LE (Finset.Colex α)

full_name: _private.Mathlib.Combinatorics.Colex.0.Finset.Colex.trans_aux
code: private lemma trans_aux (hst : toColex s ≤ toColex t) (htu : toColex t ≤ toColex u)
    (has : a ∈ s) (hat : a ∉ t) : ∃ b, b ∈ u ∧ b ∉ s ∧ a ≤ b 
goal: ∃ b ∈ u, b ∉ s ∧ a ≤ b

full_name: _private.Mathlib.Combinatorics.Colex.0.Finset.Colex.antisymm_aux
code: private lemma antisymm_aux (hst : toColex s ≤ toColex t) (hts : toColex t ≤ toColex s) : s ⊆ t 
goal: s ⊆ t

full_name: Finset.Colex.instPartialOrder
code: instance instPartialOrder : PartialOrder (Colex α) 
goal: PartialOrder (Finset.Colex α)

full_name: Finset.Colex.le_def
code: lemma le_def {s t : Colex α} :
    s ≤ t ↔ ∀ ⦃a⦄, a ∈ ofColex s → a ∉ ofColex t → ∃ b, b ∈ ofColex t ∧ b ∉ ofColex s ∧ a ≤ b 
goal: s ≤ t ↔ ∀ ⦃a : α⦄, a ∈ s.ofColex → a ∉ t.ofColex → ∃ b ∈ t.ofColex, b ∉ s.ofColex ∧ a ≤ b

full_name: Finset.Colex.toColex_le_toColex
code: lemma toColex_le_toColex :
    toColex s ≤ toColex t ↔ ∀ ⦃a⦄, a ∈ s → a ∉ t → ∃ b, b ∈ t ∧ b ∉ s ∧ a ≤ b 
goal: { ofColex := s } ≤ { ofColex := t } ↔ ∀ ⦃a : α⦄, a ∈ s → a ∉ t → ∃ b ∈ t, b ∉ s ∧ a ≤ b

full_name: Finset.Colex.toColex_lt_toColex
code: lemma toColex_lt_toColex :
    toColex s < toColex t ↔ s ≠ t ∧ ∀ ⦃a⦄, a ∈ s → a ∉ t → ∃ b, b ∈ t ∧ b ∉ s ∧ a ≤ b 
goal: { ofColex := s } < { ofColex := t } ↔ s ≠ t ∧ ∀ ⦃a : α⦄, a ∈ s → a ∉ t → ∃ b ∈ t, b ∉ s ∧ a ≤ b

full_name: Finset.Colex.toColex_mono
code: /-- If `s ⊆ t`, then `s ≤ t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_mono : Monotone (toColex : Finset α → Colex α) 
goal: Monotone Finset.Colex.toColex

full_name: Finset.Colex.toColex_strictMono
code: /-- If `s ⊂ t`, then `s < t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_strictMono : StrictMono (toColex : Finset α → Colex α) 
goal: StrictMono Finset.Colex.toColex

full_name: Finset.Colex.toColex_le_toColex_of_subset
code: /-- If `s ⊆ t`, then `s ≤ t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_le_toColex_of_subset (h : s ⊆ t) : toColex s ≤ toColex t 
goal: { ofColex := s } ≤ { ofColex := t }

full_name: Finset.Colex.toColex_lt_toColex_of_ssubset
code: /-- If `s ⊂ t`, then `s < t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_lt_toColex_of_ssubset (h : s ⊂ t) : toColex s < toColex t 
goal: { ofColex := s } < { ofColex := t }

full_name: Finset.Colex.instOrderBot
code: instance instOrderBot : OrderBot (Colex α) 
goal: OrderBot (Finset.Colex α)

full_name: Finset.Colex.toColex_empty
code: @[simp] lemma toColex_empty : toColex (∅ : Finset α) = ⊥ 
goal: { ofColex := ∅ } = ⊥

full_name: Finset.Colex.ofColex_bot
code: @[simp] lemma ofColex_bot : ofColex (⊥ : Colex α) = ∅ 
goal: ⊥.ofColex = ∅

full_name: Finset.Colex.forall_le_mono
code: /-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_le_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b ≤ a) : ∀ b ∈ s, b ≤ a 
goal: b ∈ s → b ≤ a

full_name: Finset.Colex.forall_lt_mono
code: /-- If `s ≤ t` in colex, and all elements in `t` are small, then all elements in `s` are small. -/
lemma forall_lt_mono (hst : toColex s ≤ toColex t) (ht : ∀ b ∈ t, b < a) : ∀ b ∈ s, b < a 
goal: b ∈ s → b < a

full_name: Finset.Colex.toColex_le_singleton
code: /-- `s ≤ {a}` in colex iff all elements of `s` are strictly less than `a`, except possibly `a` in
which case `s = {a}`. -/
lemma toColex_le_singleton : toColex s ≤ toColex {a} ↔ ∀ b ∈ s, b ≤ a ∧ (a ∈ s → b = a) 
goal: { ofColex := s } ≤ { ofColex := {a} } ↔ ∀ b ∈ s, b ≤ a ∧ (a ∈ s → b = a)

full_name: Finset.Colex.toColex_lt_singleton
code: /-- `s < {a}` in colex iff all elements of `s` are strictly less than `a`. -/
lemma toColex_lt_singleton : toColex s < toColex {a} ↔ ∀ b ∈ s, b < a 
goal: { ofColex := s } < { ofColex := {a} } ↔ ∀ b ∈ s, b < a

full_name: Finset.Colex.singleton_le_toColex
code: /-- `{a} ≤ s` in colex iff `s` contains an element greated than or equal to `a`. -/
lemma singleton_le_toColex : (toColex {a} : Colex α) ≤ toColex s ↔ ∃ x ∈ s, a ≤ x 
goal: { ofColex := {a} } ≤ { ofColex := s } ↔ ∃ x ∈ s, a ≤ x

full_name: Finset.Colex.singleton_le_singleton
code: /-- Colex is an extension of the base order. -/
lemma singleton_le_singleton : (toColex {a} : Colex α) ≤ toColex {b} ↔ a ≤ b 
goal: { ofColex := {a} } ≤ { ofColex := {b} } ↔ a ≤ b

full_name: Finset.Colex.singleton_lt_singleton
code: /-- Colex is an extension of the base order. -/
lemma singleton_lt_singleton : (toColex {a} : Colex α) < toColex {b} ↔ a < b 
goal: { ofColex := {a} } < { ofColex := {b} } ↔ a < b

full_name: Finset.Colex.instDecidableEq
code: instance instDecidableEq : DecidableEq (Colex α) 
goal: DecidableEq (Finset.Colex α)

full_name: Finset.Colex.instDecidableLE
code: instance instDecidableLE [@DecidableRel α (· ≤ ·)] : @DecidableRel (Colex α) (· ≤ ·) 
goal: DecidableRel fun x x_1 => x ≤ x_1

full_name: Finset.Colex.instDecidableLT
code: instance instDecidableLT [@DecidableRel α (· ≤ ·)] : @DecidableRel (Colex α) (· < ·) 
goal: DecidableRel fun x x_1 => x < x_1

full_name: Finset.Colex.le_iff_sdiff_subset_lowerClosure
code: lemma le_iff_sdiff_subset_lowerClosure {s t : Colex α} :
    s ≤ t ↔ (ofColex s : Set α) \ ofColex t ⊆ lowerClosure (ofColex t \ ofColex s : Set α) 
goal: s ≤ t ↔ ↑s.ofColex \ ↑t.ofColex ⊆ ↑(lowerClosure (↑t.ofColex \ ↑s.ofColex))

full_name: Finset.Colex.toColex_sdiff_le_toColex_sdiff
code: /-- The colexigraphic order is insensitive to removing the same elements from both sets. -/
lemma toColex_sdiff_le_toColex_sdiff (hus : u ⊆ s) (hut : u ⊆ t) :
    toColex (s \ u) ≤ toColex (t \ u) ↔ toColex s ≤ toColex t 
goal: { ofColex := s \ u } ≤ { ofColex := t \ u } ↔ { ofColex := s } ≤ { ofColex := t }

full_name: Finset.Colex.toColex_sdiff_lt_toColex_sdiff
code: /-- The colexigraphic order is insensitive to removing the same elements from both sets. -/
lemma toColex_sdiff_lt_toColex_sdiff (hus : u ⊆ s) (hut : u ⊆ t) :
    toColex (s \ u) < toColex (t \ u) ↔ toColex s < toColex t 
goal: { ofColex := s \ u } < { ofColex := t \ u } ↔ { ofColex := s } < { ofColex := t }

full_name: Finset.Colex.toColex_sdiff_le_toColex_sdiff'
code: @[simp] lemma toColex_sdiff_le_toColex_sdiff' :
    toColex (s \ t) ≤ toColex (t \ s) ↔ toColex s ≤ toColex t 
goal: { ofColex := s \ t } ≤ { ofColex := t \ s } ↔ { ofColex := s } ≤ { ofColex := t }

full_name: Finset.Colex.toColex_sdiff_lt_toColex_sdiff'
code: @[simp] lemma toColex_sdiff_lt_toColex_sdiff' :
 toColex (s \ t) < toColex (t \ s) ↔ toColex s < toColex t 
goal: { ofColex := s \ t } < { ofColex := t \ s } ↔ { ofColex := s } < { ofColex := t }

full_name: Finset.Colex.cons_le_cons
code: @[simp] lemma cons_le_cons (ha hb) : toColex (s.cons a ha) ≤ toColex (s.cons b hb) ↔ a ≤ b 
goal: { ofColex := Finset.cons a s ha } ≤ { ofColex := Finset.cons b s hb } ↔ a ≤ b

full_name: Finset.Colex.cons_lt_cons
code: @[simp] lemma cons_lt_cons (ha hb) : toColex (s.cons a ha) < toColex (s.cons b hb) ↔ a < b 
goal: { ofColex := Finset.cons a s ha } < { ofColex := Finset.cons b s hb } ↔ a < b

full_name: Finset.Colex.insert_le_insert
code: lemma insert_le_insert (ha : a ∉ s) (hb : b ∉ s) :
    toColex (insert a s) ≤ toColex (insert b s) ↔ a ≤ b 
goal: { ofColex := insert a s } ≤ { ofColex := insert b s } ↔ a ≤ b

full_name: Finset.Colex.insert_lt_insert
code: lemma insert_lt_insert (ha : a ∉ s) (hb : b ∉ s) :
    toColex (insert a s) < toColex (insert b s) ↔ a < b 
goal: { ofColex := insert a s } < { ofColex := insert b s } ↔ a < b

full_name: Finset.Colex.erase_le_erase
code: lemma erase_le_erase (ha : a ∈ s) (hb : b ∈ s) :
    toColex (s.erase a) ≤ toColex (s.erase b) ↔ b ≤ a 
goal: { ofColex := s.erase a } ≤ { ofColex := s.erase b } ↔ b ≤ a

full_name: Finset.Colex.erase_lt_erase
code: lemma erase_lt_erase (ha : a ∈ s) (hb : b ∈ s) :
    toColex (s.erase a) < toColex (s.erase b) ↔ b < a 
goal: { ofColex := s.erase a } < { ofColex := s.erase b } ↔ b < a

full_name: Finset.Colex.instLinearOrder
code: instance instLinearOrder : LinearOrder (Colex α) 
goal: LinearOrder (Finset.Colex α)

full_name: _private.Mathlib.Combinatorics.Colex.0.Finset.Colex.max_mem_aux
code: private lemma max_mem_aux {s t : Colex α} (hst : s ≠ t) : (ofColex s ∆ ofColex t).Nonempty 
goal: (symmDiff s.ofColex t.ofColex).Nonempty

full_name: Finset.Colex.toColex_lt_toColex_iff_exists_forall_lt
code: lemma toColex_lt_toColex_iff_exists_forall_lt :
    toColex s < toColex t ↔ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a 
goal: { ofColex := s } < { ofColex := t } ↔ ∃ a ∈ t, a ∉ s ∧ ∀ b ∈ s, b ∉ t → b < a

full_name: Finset.Colex.lt_iff_exists_forall_lt
code: lemma lt_iff_exists_forall_lt {s t : Colex α} :
    s < t ↔ ∃ a ∈ ofColex t, a ∉ ofColex s ∧ ∀ b ∈ ofColex s, b ∉ ofColex t → b < a 
goal: s < t ↔ ∃ a ∈ t.ofColex, a ∉ s.ofColex ∧ ∀ b ∈ s.ofColex, b ∉ t.ofColex → b < a

full_name: Finset.Colex.toColex_le_toColex_iff_max'_mem
code: lemma toColex_le_toColex_iff_max'_mem :
    toColex s ≤ toColex t ↔ ∀ hst : s ≠ t, (s ∆ t).max' (symmDiff_nonempty.2 hst) ∈ t 
goal: { ofColex := s } ≤ { ofColex := t } ↔ ∀ (hst : s ≠ t), (symmDiff s t).max' ⋯ ∈ t

full_name: Finset.Colex.le_iff_max'_mem
code: lemma le_iff_max'_mem {s t : Colex α} :
    s ≤ t ↔ ∀ h : s ≠ t, (ofColex s ∆ ofColex t).max' (max_mem_aux h) ∈ ofColex t 
goal: s ≤ t ↔ ∀ (h : s ≠ t), (symmDiff s.ofColex t.ofColex).max' ⋯ ∈ t.ofColex

full_name: Finset.Colex.toColex_lt_toColex_iff_max'_mem
code: lemma toColex_lt_toColex_iff_max'_mem :
    toColex s < toColex t ↔ ∃ hst : s ≠ t, (s ∆ t).max' (symmDiff_nonempty.2 hst) ∈ t 
goal: { ofColex := s } < { ofColex := t } ↔ ∃ (hst : s ≠ t), (symmDiff s t).max' ⋯ ∈ t

full_name: Finset.Colex.lt_iff_max'_mem
code: lemma lt_iff_max'_mem {s t : Colex α} :
    s < t ↔ ∃ h : s ≠ t, (ofColex s ∆ ofColex t).max' (max_mem_aux h) ∈ ofColex t 
goal: s < t ↔ ∃ (h : s ≠ t), (symmDiff s.ofColex t.ofColex).max' ⋯ ∈ t.ofColex

full_name: Finset.Colex.lt_iff_exists_filter_lt
code: lemma lt_iff_exists_filter_lt :
    toColex s < toColex t ↔ ∃ w ∈ t \ s, s.filter (w < ·) = t.filter (w < ·) 
goal: { ofColex := s } < { ofColex := t } ↔ ∃ w ∈ t \ s, Finset.filter (fun x => w < x) s = Finset.filter (fun x => w < x) t

full_name: Finset.Colex.erase_le_erase_min'
code: /-- If `s ≤ t` in colex and `s.card ≤ t.card`, then `s \ {a} ≤ t \ {min t}` for any `a ∈ s`. -/
lemma erase_le_erase_min' (hst : toColex s ≤ toColex t) (hcard : s.card ≤ t.card) (ha : a ∈ s) :
    toColex (s.erase a) ≤
      toColex (t.erase <| min' t <| card_pos.1 <| (card_pos.2 ⟨a, ha⟩).trans_le hcard) 
goal: { ofColex := s.erase a } ≤ { ofColex := t.erase (t.min' ⋯) }

full_name: Finset.Colex.toColex_image_le_toColex_image
code: /-- Strictly monotone functions preserve the colex ordering. -/
lemma toColex_image_le_toColex_image (hf : StrictMono f) :
    toColex (s.image f) ≤ toColex (t.image f) ↔ toColex s ≤ toColex t 
goal: { ofColex := Finset.image f s } ≤ { ofColex := Finset.image f t } ↔ { ofColex := s } ≤ { ofColex := t }

full_name: Finset.Colex.toColex_image_lt_toColex_image
code: /-- Strictly monotone functions preserve the colex ordering. -/
lemma toColex_image_lt_toColex_image (hf : StrictMono f) :
    toColex (s.image f) < toColex (t.image f) ↔ toColex s < toColex t 
goal: { ofColex := Finset.image f s } < { ofColex := Finset.image f t } ↔ { ofColex := s } < { ofColex := t }

full_name: Finset.Colex.toColex_image_ofColex_strictMono
code: lemma toColex_image_ofColex_strictMono (hf : StrictMono f) :
    StrictMono fun s ↦ toColex <| image f <| ofColex s 
goal: StrictMono fun s => { ofColex := Finset.image f s.ofColex }

full_name: Finset.Colex.instBoundedOrder
code: instance instBoundedOrder : BoundedOrder (Colex α) 
goal: BoundedOrder (Finset.Colex α)

full_name: Finset.Colex.toColex_univ
code: @[simp] lemma toColex_univ [Fintype α] : toColex (univ : Finset α) = ⊤ 
goal: { ofColex := Finset.univ } = ⊤

full_name: Finset.Colex.ofColex_top
code: @[simp] lemma ofColex_top [Fintype α] : ofColex (⊤ : Colex α) = univ 
goal: ⊤.ofColex = Finset.univ

full_name: Finset.Colex.IsInitSeg
code: /-- `𝒜` is an initial segment of the colexigraphic order on sets of `r`, and that if `t` is below
`s` in colex where `t` has size `r` and `s` is in `𝒜`, then `t` is also in `𝒜`. In effect, `𝒜` is
downwards closed with respect to colex among sets of size `r`. -/
def IsInitSeg (𝒜 : Finset (Finset α)) (r : ℕ) : Prop 
goal: Prop

full_name: Finset.Colex.isInitSeg_empty
code: @[simp] lemma isInitSeg_empty : IsInitSeg (∅ : Finset (Finset α)) r 
goal: Finset.Colex.IsInitSeg ∅ r

full_name: Finset.Colex.IsInitSeg.total
code: /-- Initial segments are nested in some way. In particular, if they're the same size they're equal.
-/
lemma IsInitSeg.total (h₁ : IsInitSeg 𝒜₁ r) (h₂ : IsInitSeg 𝒜₂ r) : 𝒜₁ ⊆ 𝒜₂ ∨ 𝒜₂ ⊆ 𝒜₁ 
goal: 𝒜₁ ⊆ 𝒜₂ ∨ 𝒜₂ ⊆ 𝒜₁

full_name: Finset.Colex.initSeg
code: /-- The initial segment of the colexicographic order on sets with `s.card` elements and ending at
`s`. -/
def initSeg (s : Finset α) : Finset (Finset α) 
goal: Finset (Finset α)

full_name: Finset.Colex.mem_initSeg
code: @[simp]
lemma mem_initSeg : t ∈ initSeg s ↔ s.card = t.card ∧ toColex t ≤ toColex s 
goal: t ∈ Finset.Colex.initSeg s ↔ s.card = t.card ∧ { ofColex := t } ≤ { ofColex := s }

full_name: Finset.Colex.mem_initSeg_self
code: lemma mem_initSeg_self : s ∈ initSeg s 
goal: s ∈ Finset.Colex.initSeg s

full_name: Finset.Colex.initSeg_nonempty
code: @[simp] lemma initSeg_nonempty : (initSeg s).Nonempty 
goal: (Finset.Colex.initSeg s).Nonempty

full_name: Finset.Colex.isInitSeg_initSeg
code: lemma isInitSeg_initSeg : IsInitSeg (initSeg s) s.card 
goal: Finset.Colex.IsInitSeg (Finset.Colex.initSeg s) s.card

full_name: Finset.Colex.IsInitSeg.exists_initSeg
code: lemma IsInitSeg.exists_initSeg (h𝒜 : IsInitSeg 𝒜 r) (h𝒜₀ : 𝒜.Nonempty) :
    ∃ s : Finset α, s.card = r ∧ 𝒜 = initSeg s 
goal: ∃ s, s.card = r ∧ 𝒜 = Finset.Colex.initSeg s

full_name: Finset.Colex.isInitSeg_iff_exists_initSeg
code: /-- Being a nonempty initial segment of colex is equivalent to being an `initSeg`. -/
lemma isInitSeg_iff_exists_initSeg :
    IsInitSeg 𝒜 r ∧ 𝒜.Nonempty ↔ ∃ s : Finset α, s.card = r ∧ 𝒜 = initSeg s 
goal: Finset.Colex.IsInitSeg 𝒜 r ∧ 𝒜.Nonempty ↔ ∃ s, s.card = r ∧ 𝒜 = Finset.Colex.initSeg s

full_name: Finset.geomSum_ofColex_strictMono
code: lemma geomSum_ofColex_strictMono (hn : 2 ≤ n) : StrictMono fun s ↦ ∑ k ∈ ofColex s, n ^ k 
goal: StrictMono fun s => ∑ k ∈ s.ofColex, n ^ k

full_name: Finset.geomSum_le_geomSum_iff_toColex_le_toColex
code: /-- For finsets of naturals, the colexicographic order is equivalent to the order induced by the
`n`-ary expansion. -/
lemma geomSum_le_geomSum_iff_toColex_le_toColex (hn : 2 ≤ n) :
    ∑ k ∈ s, n ^ k ≤ ∑ k ∈ t, n ^ k ↔ toColex s ≤ toColex t 
goal: ∑ k ∈ s, n ^ k ≤ ∑ k ∈ t, n ^ k ↔ { ofColex := s } ≤ { ofColex := t }

full_name: Finset.geomSum_lt_geomSum_iff_toColex_lt_toColex
code: /-- For finsets of naturals, the colexicographic order is equivalent to the order induced by the
`n`-ary expansion. -/
lemma geomSum_lt_geomSum_iff_toColex_lt_toColex (hn : 2 ≤ n) :
    ∑ i ∈ s, n ^ i < ∑ i ∈ t, n ^ i ↔ toColex s < toColex t 
goal: ∑ i ∈ s, n ^ i < ∑ i ∈ t, n ^ i ↔ { ofColex := s } < { ofColex := t }

full_name: Finset.geomSum_injective
code: theorem geomSum_injective {n : ℕ} (hn : 2 ≤ n) :
    Function.Injective (fun s : Finset ℕ ↦ ∑ i in s, n ^ i) 
goal: Function.Injective fun s => ∑ i ∈ s, n ^ i

full_name: Finset.lt_geomSum_of_mem
code: theorem lt_geomSum_of_mem {a : ℕ} (hn : 2 ≤ n) (hi : a ∈ s) : a < ∑ i in s, n ^ i 
goal: a < ∑ i ∈ s, n ^ i

full_name: Finset.toFinset_bitIndices_twoPowSum
code: @[simp] theorem toFinset_bitIndices_twoPowSum (s : Finset ℕ) :
    (∑ i in s, 2 ^ i).bitIndices.toFinset = s 
goal: (∑ i ∈ s, 2 ^ i).bitIndices.toFinset = s

full_name: Finset.twoPowSum_toFinset_bitIndices
code: @[simp] theorem twoPowSum_toFinset_bitIndices (n : ℕ) :
    ∑ i in n.bitIndices.toFinset, 2 ^ i = n 
goal: ∑ i ∈ n.bitIndices.toFinset, 2 ^ i = n

full_name: Finset.equivBitIndices
code: /-- The equivalence between `ℕ` and `Finset ℕ` that maps `∑ i in s, 2^i` to `s`. -/
@[simps] def equivBitIndices : ℕ ≃ Finset ℕ 
goal: ℕ ≃ Finset ℕ

full_name: Finset.equivBitIndices_apply
code: /-- The equivalence between `ℕ` and `Finset ℕ` that maps `∑ i in s, 2^i` to `s`. -/
@[simps] def equivBitIndices : ℕ ≃ Finset ℕ 
goal: Finset.equivBitIndices n = n.bitIndices.toFinset

full_name: Finset.equivBitIndices_symm_apply
code: /-- The equivalence between `ℕ` and `Finset ℕ` that maps `∑ i in s, 2^i` to `s`. -/
@[simps] def equivBitIndices : ℕ ≃ Finset ℕ 
goal: Finset.equivBitIndices.symm s = ∑ i ∈ s, 2 ^ i

full_name: Finset.orderIsoColex
code: /-- The equivalence `Nat.equivBitIndices` enumerates `Finset ℕ` in colexicographic order. -/
@[simps] def orderIsoColex : ℕ ≃o Colex ℕ 
goal: ℕ ≃o Finset.Colex ℕ

full_name: Finset.orderIsoColex_apply_ofColex
code: /-- The equivalence `Nat.equivBitIndices` enumerates `Finset ℕ` in colexicographic order. -/
@[simps] def orderIsoColex : ℕ ≃o Colex ℕ 
goal: (Finset.orderIsoColex n).ofColex = Finset.equivBitIndices n

full_name: Finset.orderIsoColex_symm_apply
code: /-- The equivalence `Nat.equivBitIndices` enumerates `Finset ℕ` in colexicographic order. -/
@[simps] def orderIsoColex : ℕ ≃o Colex ℕ 
goal: (RelIso.symm Finset.orderIsoColex) s = Finset.equivBitIndices.symm s.ofColex