Theorem: CompositionAsSet.toComposition_boundaries
File: Mathlib/Combinatorics/Composition.lean

tactic: ext j
state_before: n : ℕ
c : CompositionAsSet n
⊢ Composition.boundaries (toComposition c) = c.boundaries

tactic: simp only [c.mem_boundaries_iff_exists_blocks_sum_take_eq, Composition.boundaries, Finset.mem_map]
state_before: case a
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
⊢ j ∈ Composition.boundaries (toComposition c) ↔ j ∈ c.boundaries

tactic: constructor
state_before: case a
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
⊢ (∃ a, a ∈ Finset.univ ∧ ↑(Composition.boundary (toComposition c)).toEmbedding a = j) ↔
    ∃ i, i < Finset.card c.boundaries ∧ sum (take i (blocks c)) = ↑j

tactic: rintro ⟨i, _, hi⟩
state_before: case a.mp
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
⊢ (∃ a, a ∈ Finset.univ ∧ ↑(Composition.boundary (toComposition c)).toEmbedding a = j) →
    ∃ i, i < Finset.card c.boundaries ∧ sum (take i (blocks c)) = ↑j

tactic: refine' ⟨i.1, _, _⟩
state_before: case a.mp.intro.intro
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : Fin (Composition.length (toComposition c) + 1)
left✝ : i ∈ Finset.univ
hi : ↑(Composition.boundary (toComposition c)).toEmbedding i = j
⊢ ∃ i, i < Finset.card c.boundaries ∧ sum (take i (blocks c)) = ↑j

tactic: simpa [c.card_boundaries_eq_succ_length] using i.2
state_before: case a.mp.intro.intro.refine'_1
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : Fin (Composition.length (toComposition c) + 1)
left✝ : i ∈ Finset.univ
hi : ↑(Composition.boundary (toComposition c)).toEmbedding i = j
⊢ ↑i < Finset.card c.boundaries

case a.mp.intro.intro.refine'_2
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : Fin (Composition.length (toComposition c) + 1)
left✝ : i ∈ Finset.univ
hi : ↑(Composition.boundary (toComposition c)).toEmbedding i = j
⊢ sum (take (↑i) (blocks c)) = ↑j

tactic: simp [Composition.boundary, Composition.sizeUpTo, ← hi]
state_before: case a.mp.intro.intro.refine'_2
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : Fin (Composition.length (toComposition c) + 1)
left✝ : i ∈ Finset.univ
hi : ↑(Composition.boundary (toComposition c)).toEmbedding i = j
⊢ sum (take (↑i) (blocks c)) = ↑j

tactic: rintro ⟨i, i_lt, hi⟩
state_before: case a.mpr
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
⊢ (∃ i, i < Finset.card c.boundaries ∧ sum (take i (blocks c)) = ↑j) →
    ∃ a, a ∈ Finset.univ ∧ ↑(Composition.boundary (toComposition c)).toEmbedding a = j

tactic: refine' ⟨i, by simp, _⟩
state_before: case a.mpr.intro.intro
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : ℕ
i_lt : i < Finset.card c.boundaries
hi : sum (take i (blocks c)) = ↑j
⊢ ∃ a, a ∈ Finset.univ ∧ ↑(Composition.boundary (toComposition c)).toEmbedding a = j

tactic: rw [c.card_boundaries_eq_succ_length] at i_lt
state_before: case a.mpr.intro.intro
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : ℕ
i_lt : i < Finset.card c.boundaries
hi : sum (take i (blocks c)) = ↑j
⊢ ↑(Composition.boundary (toComposition c)).toEmbedding ↑i = j

tactic: simp [Composition.boundary, Nat.mod_eq_of_lt i_lt, Composition.sizeUpTo, hi]
state_before: case a.mpr.intro.intro
n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : ℕ
i_lt : i < length c + 1
hi : sum (take i (blocks c)) = ↑j
⊢ ↑(Composition.boundary (toComposition c)).toEmbedding ↑i = j

tactic: simp
state_before: n : ℕ
c : CompositionAsSet n
j : Fin (n + 1)
i : ℕ
i_lt : i < Finset.card c.boundaries
hi : sum (take i (blocks c)) = ↑j
⊢ ↑i ∈ Finset.univ