Skip to content

Commit

Permalink
refactor(combinatorics/partition): add nat namespace (#9672)
Browse files Browse the repository at this point in the history
`partition` is now `nat.partition`
  • Loading branch information
YaelDillies committed Oct 12, 2021
1 parent 2e72f35 commit fd7da4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/combinatorics/partition.lean
Expand Up @@ -42,9 +42,11 @@ Partition

variables {α : Type*}

open multiset nat
open multiset
open_locale big_operators

namespace nat

/-- A partition of `n` is a multiset of positive integers summing to `n`. -/
@[ext, derive decidable_eq] structure partition (n : ℕ) :=
(parts : multiset ℕ)
Expand Down Expand Up @@ -129,3 +131,4 @@ finset.univ.filter (λ c, c.parts.nodup)
def odd_distincts (n : ℕ) : finset (partition n) := odds n ∩ distincts n

end partition
end nat
6 changes: 3 additions & 3 deletions src/group_theory/perm/cycle_type.lean
Expand Up @@ -13,7 +13,7 @@ import tactic.linarith
/-!
# Cycle Types
In this file we define the cycle type of a partition.
In this file we define the cycle type of a permutation.
## Main definitions
Expand Down Expand Up @@ -488,7 +488,7 @@ section partition
variables [decidable_eq α]

/-- The partition corresponding to a permutation -/
def partition (σ : perm α) : partition (fintype.card α) :=
def partition (σ : perm α) : (fintype.card α).partition :=
{ parts := σ.cycle_type + repeat 1 (fintype.card α - σ.support.card),
parts_pos := λ n hn,
begin
Expand Down Expand Up @@ -516,7 +516,7 @@ lemma partition_eq_of_is_conj {σ τ : perm α} :
begin
rw [is_conj_iff_cycle_type_eq],
refine ⟨λ h, _, λ h, _⟩,
{ rw [partition.ext_iff, parts_partition, parts_partition,
{ rw [nat.partition.ext_iff, parts_partition, parts_partition,
← sum_cycle_type, ← sum_cycle_type, h] },
{ rw [← filter_parts_partition_eq_cycle_type, ← filter_parts_partition_eq_cycle_type, h] }
end
Expand Down

0 comments on commit fd7da4e

Please sign in to comment.