Skip to content

Commit a1b5332

Browse files
YaelDilliescallesonne
authored andcommitted
chore(Data/List): Do not depend on algebra (#11845)
Remove dependencies on algebra in the `Data.List` folder except for: * `Data.List.EditDistance`: Actually relies on algebra. Maybe should be moved? * `Data.List.Card`: Completely unused and redundant. * `Data.List.Cycle`: Relies on `Fintype`, which shouldn't rely on algebra but it's hard to fix right now. Maybe should be moved? * `Data.List.Func`: Completely unused and redundant. * `Data.List.Lex`: That's order theory. Could be moved. * `Data.List.Prime`. That's algebra. Should definitely be moved. * `Data.List.Sym`: Relies on `Multiset`, which shouldn't rely on algebra but it's hard to fix right now. Maybe should be moved? * `Data.List.ToFinsupp`: That's algebra. Should definitely be moved. As a consequence, move the big operators lemmas that were in there to `Algebra.BigOperators.List.Basic`. For the lemmas that were `Nat`-specific and not about auxiliary definitions, keep a version of them in the original file but stated using `Nat.sum`. Before ![pre_11845](https://github.com/leanprover-community/mathlib4/assets/14090593/5912261a-7c57-4231-a7d4-aed9ed7c8c79) After ![post_11845](https://github.com/leanprover-community/mathlib4/assets/14090593/c523c187-2f5a-4d65-ba88-ae489855039e)
1 parent e2eaebb commit a1b5332

11 files changed

Lines changed: 151 additions & 119 deletions

File tree

Mathlib/Algebra/BigOperators/List/Basic.lean

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import Mathlib.Algebra.Ring.Commute
77
import Mathlib.Data.Int.Basic
88
import Mathlib.Data.List.Dedup
99
import Mathlib.Data.List.ProdSigma
10+
import Mathlib.Data.List.Join
11+
import Mathlib.Data.List.Perm
1012
import Mathlib.Data.List.Range
1113
import Mathlib.Data.List.Rotate
1214
import Mathlib.Data.Nat.Basic
@@ -382,10 +384,26 @@ lemma prod_eq_pow_single [DecidableEq M] (a : M) (h : ∀ a', a' ≠ a → a'
382384
#align list.prod_eq_pow_single List.prod_eq_pow_single
383385
#align list.sum_eq_nsmul_single List.sum_eq_nsmul_single
384386

387+
/-- If elements of a list commute with each other, then their product does not
388+
depend on the order of elements. -/
389+
@[to_additive "If elements of a list additively commute with each other, then their sum does not
390+
depend on the order of elements."]
391+
lemma Perm.prod_eq' (h : l₁ ~ l₂) (hc : l₁.Pairwise Commute) : l₁.prod = l₂.prod := by
392+
refine h.foldl_eq' ?_ _
393+
apply Pairwise.forall_of_forall
394+
· intro x y h z
395+
exact (h z).symm
396+
· intros; rfl
397+
· apply hc.imp
398+
intro a b h z
399+
rw [mul_assoc z, mul_assoc z, h]
400+
#align list.perm.prod_eq' List.Perm.prod_eq'
401+
#align list.perm.sum_eq' List.Perm.sum_eq'
402+
385403
end Monoid
386404

387405
section CommMonoid
388-
variable [CommMonoid M] {a : M} {l : List M}
406+
variable [CommMonoid M] {a : M} {l l₁ l₂ : List M}
389407

390408
@[to_additive (attr := simp)]
391409
lemma prod_erase [DecidableEq M] (ha : a ∈ l) : a * (l.erase a).prod = l.prod :=
@@ -404,6 +422,14 @@ lemma prod_map_erase [DecidableEq α] (f : α → M) {a} :
404422
#align list.prod_map_erase List.prod_map_erase
405423
#align list.sum_map_erase List.sum_map_erase
406424

425+
@[to_additive] lemma Perm.prod_eq (h : Perm l₁ l₂) : prod l₁ = prod l₂ := h.fold_op_eq
426+
#align list.perm.prod_eq List.Perm.prod_eq
427+
#align list.perm.sum_eq List.Perm.sum_eq
428+
429+
@[to_additive] lemma prod_reverse (l : List M) : prod l.reverse = prod l := (reverse_perm l).prod_eq
430+
#align list.prod_reverse List.prod_reverse
431+
#align list.sum_reverse List.sum_reverse
432+
407433
@[to_additive]
408434
lemma prod_mul_prod_eq_prod_zipWith_mul_prod_drop :
409435
∀ l l' : List M,
@@ -707,4 +733,49 @@ lemma ranges_join (l : List ℕ) : l.ranges.join = range l.sum := by simp [range
707733
lemma mem_mem_ranges_iff_lt_sum (l : List ℕ) {n : ℕ} :
708734
(∃ s ∈ l.ranges, n ∈ s) ↔ n < l.sum := by simp [mem_mem_ranges_iff_lt_natSum]
709735

736+
@[simp]
737+
theorem length_join (L : List (List α)) : length (join L) = sum (map length L) := by
738+
induction L <;> [rfl; simp only [*, join, map, sum_cons, length_append]]
739+
#align list.length_join List.length_join
740+
741+
lemma countP_join (p : α → Bool) : ∀ L : List (List α), countP p L.join = (L.map (countP p)).sum
742+
| [] => rfl
743+
| a :: l => by rw [join, countP_append, map_cons, sum_cons, countP_join _ l]
744+
#align list.countp_join List.countP_join
745+
746+
lemma count_join [BEq α] (L : List (List α)) (a : α) : L.join.count a = (L.map (count a)).sum :=
747+
countP_join _ _
748+
#align list.count_join List.count_join
749+
750+
@[simp]
751+
theorem length_bind (l : List α) (f : α → List β) :
752+
length (List.bind l f) = sum (map (length ∘ f) l) := by rw [List.bind, length_join, map_map]
753+
#align list.length_bind List.length_bind
754+
755+
lemma countP_bind (p : β → Bool) (l : List α) (f : α → List β) :
756+
countP p (l.bind f) = sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join, map_map]
757+
758+
lemma count_bind [BEq β] (l : List α) (f : α → List β) (x : β) :
759+
count x (l.bind f) = sum (map (count x ∘ f) l) := countP_bind _ _ _
760+
#align list.count_bind List.count_bind
761+
762+
/-- In a join, taking the first elements up to an index which is the sum of the lengths of the
763+
first `i` sublists, is the same as taking the join of the first `i` sublists. -/
764+
lemma take_sum_join (L : List (List α)) (i : ℕ) :
765+
L.join.take ((L.map length).take i).sum = (L.take i).join := by simpa using take_sum_join' _ _
766+
#align list.take_sum_join List.take_sum_join
767+
768+
/-- In a join, dropping all the elements up to an index which is the sum of the lengths of the
769+
first `i` sublists, is the same as taking the join after dropping the first `i` sublists. -/
770+
lemma drop_sum_join (L : List (List α)) (i : ℕ) :
771+
L.join.drop ((L.map length).take i).sum = (L.drop i).join := by simpa using drop_sum_join' _ _
772+
#align list.drop_sum_join List.drop_sum_join
773+
774+
/-- In a join of sublists, taking the slice between the indices `A` and `B - 1` gives back the
775+
original sublist of index `i` if `A` is the sum of the lengths of sublists of index `< i`, and
776+
`B` is the sum of the lengths of sublists of index `≤ i`. -/
777+
lemma drop_take_succ_join_eq_get (L : List (List α)) (i : Fin L.length) :
778+
(L.join.take ((L.map length).take (i + 1)).sum).drop ((L.map length).take i).sum = get L i := by
779+
simpa using drop_take_succ_join_eq_get' _ _
780+
710781
end List

Mathlib/Data/List/DropRight.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yakov Pechersky
55
-/
66
import Mathlib.Data.List.Infix
7-
import Mathlib.Data.Nat.Order.Basic
87

98
#align_import data.list.rdrop from "leanprover-community/mathlib"@"26f081a2fb920140ed5bc5cc5344e84bcc7cb2b2"
109
/-!
@@ -32,6 +31,8 @@ another function that takes a `L : ℕ` and use `L - n`. Under a proof condition
3231
3332
-/
3433

34+
-- Make sure we don't import algebra
35+
assert_not_exists Monoid
3536

3637
variable {α : Type*} (p : α → Bool) (l : List α) (n : ℕ)
3738

Mathlib/Data/List/Join.lean

Lines changed: 42 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Sébastien Gouëzel, Floris van Doorn, Mario Carneiro, Martin Dvorak
55
-/
6-
import Mathlib.Algebra.BigOperators.List.Basic
6+
import Mathlib.Data.List.Basic
77

88
#align_import data.list.join from "leanprover-community/mathlib"@"18a5306c091183ac90884daa9373fa3b178e8607"
99

@@ -14,6 +14,8 @@ This file proves basic properties of `List.join`, which concatenates a list of l
1414
in `Init.Data.List.Basic`.
1515
-/
1616

17+
-- Make sure we don't import algebra
18+
assert_not_exists Monoid
1719

1820
variable {α β : Type*}
1921

@@ -64,31 +66,31 @@ theorem join_join (l : List (List (List α))) : l.join.join = (l.map join).join
6466
induction l <;> simp [*]
6567
#align list.join_join List.join_join
6668

67-
@[simp]
68-
theorem length_join (L : List (List α)) : length (join L) = sum (map length L) := by
69-
induction L <;> [rfl; simp only [*, join, map, sum_cons, length_append]]
70-
#align list.length_join List.length_join
69+
/-- See `List.length_join` for the corresponding statement using `List.sum`. -/
70+
lemma length_join' (L : List (List α)) : length (join L) = Nat.sum (map length L) := by
71+
induction L <;> [rfl; simp only [*, join, map, Nat.sum_cons, length_append]]
7172

72-
lemma countP_join (p : α → Bool) : ∀ L : List (List α), countP p L.join = (L.map (countP p)).sum
73+
/-- See `List.countP_join` for the corresponding statement using `List.sum`. -/
74+
lemma countP_join' (p : α → Bool) :
75+
∀ L : List (List α), countP p L.join = Nat.sum (L.map (countP p))
7376
| [] => rfl
74-
| a :: l => by rw [join, countP_append, map_cons, sum_cons, countP_join _ l]
75-
#align list.countp_join List.countP_join
77+
| a :: l => by rw [join, countP_append, map_cons, Nat.sum_cons, countP_join' _ l]
7678

77-
lemma count_join [BEq α] (L : List (List α)) (a : α) : L.join.count a = (L.map (count a)).sum :=
78-
countP_join _ _
79-
#align list.count_join List.count_join
79+
/-- See `List.count_join` for the corresponding statement using `List.sum`. -/
80+
lemma count_join' [BEq α] (L : List (List α)) (a : α) :
81+
L.join.count a = Nat.sum (L.map (count a)) := countP_join' _ _
8082

81-
@[simp]
82-
theorem length_bind (l : List α) (f : α → List β) :
83-
length (List.bind l f) = sum (map (length ∘ f) l) := by rw [List.bind, length_join, map_map]
84-
#align list.length_bind List.length_bind
83+
/-- See `List.length_bind` for the corresponding statement using `List.sum`. -/
84+
lemma length_bind' (l : List α) (f : α → List β) :
85+
length (l.bind f) = Nat.sum (map (length ∘ f) l) := by rw [List.bind, length_join', map_map]
8586

86-
lemma countP_bind (p : β → Bool) (l : List α) (f : α → List β) :
87-
countP p (l.bind f) = sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join, map_map]
87+
/-- See `List.countP_bind` for the corresponding statement using `List.sum`. -/
88+
lemma countP_bind' (p : β → Bool) (l : List α) (f : α → List β) :
89+
countP p (l.bind f) = Nat.sum (map (countP p ∘ f) l) := by rw [List.bind, countP_join', map_map]
8890

89-
lemma count_bind [BEq β] (l : List α) (f : α → List β) (x : β) :
90-
count x (l.bind f) = sum (map (count x ∘ f) l) := countP_bind _ _ _
91-
#align list.count_bind List.count_bind
91+
/-- See `List.count_bind` for the corresponding statement using `List.sum`. -/
92+
lemma count_bind' [BEq β] (l : List α) (f : α → List β) (x : β) :
93+
count x (l.bind f) = Nat.sum (map (count x ∘ f) l) := countP_bind' _ _ _
9294

9395
@[simp]
9496
theorem bind_eq_nil {l : List α} {f : α → List β} : List.bind l f = [] ↔ ∀ x ∈ l, f x = [] :=
@@ -97,22 +99,24 @@ theorem bind_eq_nil {l : List α} {f : α → List β} : List.bind l f = [] ↔
9799
#align list.bind_eq_nil List.bind_eq_nil
98100

99101
/-- In a join, taking the first elements up to an index which is the sum of the lengths of the
100-
first `i` sublists, is the same as taking the join of the first `i` sublists. -/
101-
theorem take_sum_join (L : List (List α)) (i : ℕ) :
102-
L.join.take ((L.map length).take i).sum = (L.take i).join := by
102+
first `i` sublists, is the same as taking the join of the first `i` sublists.
103+
104+
See `List.take_sum_join` for the corresponding statement using `List.sum`. -/
105+
theorem take_sum_join' (L : List (List α)) (i : ℕ) :
106+
L.join.take (Nat.sum ((L.map length).take i)) = (L.take i).join := by
103107
induction L generalizing i
104108
· simp
105109
· cases i <;> simp [take_append, *]
106-
#align list.take_sum_join List.take_sum_join
107110

108111
/-- In a join, dropping all the elements up to an index which is the sum of the lengths of the
109-
first `i` sublists, is the same as taking the join after dropping the first `i` sublists. -/
110-
theorem drop_sum_join (L : List (List α)) (i : ℕ) :
111-
L.join.drop ((L.map length).take i).sum = (L.drop i).join := by
112+
first `i` sublists, is the same as taking the join after dropping the first `i` sublists.
113+
114+
See `List.drop_sum_join` for the corresponding statement using `List.sum`. -/
115+
theorem drop_sum_join' (L : List (List α)) (i : ℕ) :
116+
L.join.drop (Nat.sum ((L.map length).take i)) = (L.drop i).join := by
112117
induction L generalizing i
113118
· simp
114119
· cases i <;> simp [drop_append, *]
115-
#align list.drop_sum_join List.drop_sum_join
116120

117121
/-- Taking only the first `i+1` elements in a list, and then dropping the first `i` ones, one is
118122
left with a list of length `1` made of the `i`-th element of the original list. -/
@@ -145,36 +149,19 @@ theorem drop_take_succ_eq_cons_nthLe (L : List α) {i : ℕ} (hi : i < L.length)
145149

146150
/-- In a join of sublists, taking the slice between the indices `A` and `B - 1` gives back the
147151
original sublist of index `i` if `A` is the sum of the lengths of sublists of index `< i`, and
148-
`B` is the sum of the lengths of sublists of index `≤ i`. -/
149-
theorem drop_take_succ_join_eq_get (L : List (List α)) (i : Fin L.length) :
150-
(L.join.take ((L.map length).take (i + 1)).sum).drop ((L.map length).take i).sum =
152+
`B` is the sum of the lengths of sublists of index `≤ i`.
153+
154+
See `List.drop_take_succ_join_eq_get` for the corresponding statement using `List.sum`. -/
155+
theorem drop_take_succ_join_eq_get' (L : List (List α)) (i : Fin L.length) :
156+
(L.join.take (Nat.sum ((L.map length).take (i + 1)))).drop (Nat.sum ((L.map length).take i)) =
151157
get L i := by
152158
have : (L.map length).take i = ((L.take (i + 1)).map length).take i := by
153-
simp [map_take, take_take]
154-
simp only [this, length_map, take_sum_join, drop_sum_join, drop_take_succ_eq_cons_get,
159+
simp [map_take, take_take, Nat.min_eq_left]
160+
simp only [this, length_map, take_sum_join', drop_sum_join', drop_take_succ_eq_cons_get,
155161
join, append_nil]
156162

157-
set_option linter.deprecated false in
158-
/-- In a join of sublists, taking the slice between the indices `A` and `B - 1` gives back the
159-
original sublist of index `i` if `A` is the sum of the lengths of sublists of index `< i`, and
160-
`B` is the sum of the lengths of sublists of index `≤ i`. -/
161-
@[deprecated drop_take_succ_join_eq_get]
162-
theorem drop_take_succ_join_eq_nthLe (L : List (List α)) {i : ℕ} (hi : i < L.length) :
163-
(L.join.take ((L.map length).take (i + 1)).sum).drop ((L.map length).take i).sum =
164-
nthLe L i hi := by
165-
have : (L.map length).take i = ((L.take (i + 1)).map length).take i := by
166-
simp [map_take, take_take]
167-
simp [take_sum_join, this, drop_sum_join, drop_take_succ_eq_cons_nthLe _ hi]
168-
#align list.drop_take_succ_join_eq_nth_le List.drop_take_succ_join_eq_nthLe
169-
170-
/-- Auxiliary lemma to control elements in a join. -/
171-
@[deprecated]
172-
theorem sum_take_map_length_lt1 (L : List (List α)) {i j : ℕ} (hi : i < L.length)
173-
(hj : j < (L.get ⟨i, hi⟩).length) :
174-
((L.map length).take i).sum + j < ((L.map length).take (i + 1)).sum := by
175-
simp [hi, sum_take_succ, hj]
176-
#align list.sum_take_map_length_lt1 List.sum_take_map_length_lt1
177-
163+
#noalign list.drop_take_succ_join_eq_nth_le
164+
#noalign list.sum_take_map_length_lt1
178165
#noalign list.sum_take_map_length_lt2
179166
#noalign list.nth_le_join
180167

@@ -188,7 +175,7 @@ theorem eq_iff_join_eq (L L' : List (List α)) :
188175
· have : length (map length L) = length (map length L') := by rw [length_eq]
189176
simpa using this
190177
· intro n h₁ h₂
191-
rw [← drop_take_succ_join_eq_get, ← drop_take_succ_join_eq_get, join_eq, length_eq]
178+
rw [← drop_take_succ_join_eq_get', ← drop_take_succ_join_eq_get', join_eq, length_eq]
192179
#align list.eq_iff_join_eq List.eq_iff_join_eq
193180

194181
theorem join_drop_length_sub_one {L : List (List α)} (h : L ≠ []) :

Mathlib/Data/List/Perm.lean

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ Authors: Leonardo de Moura, Jeremy Avigad, Mario Carneiro
55
-/
66
import Mathlib.Data.List.Count
77
import Mathlib.Data.List.Dedup
8-
import Mathlib.Data.List.Permutation
9-
import Mathlib.Data.List.Pairwise
108
import Mathlib.Data.List.InsertNth
119
import Mathlib.Data.List.Lattice
10+
import Mathlib.Data.List.Permutation
1211
import Mathlib.Data.Nat.Factorial.Basic
13-
import Mathlib.Data.List.Count
1412

1513
#align_import data.list.perm from "leanprover-community/mathlib"@"65a1391a0106c9204fe45bc73a039f056558cb83"
1614

@@ -25,6 +23,8 @@ another.
2523
The notation `~` is used for permutation equivalence.
2624
-/
2725

26+
-- Make sure we don't import algebra
27+
assert_not_exists Monoid
2828

2929
open Nat
3030

@@ -292,42 +292,6 @@ theorem Perm.fold_op_eq {l₁ l₂ : List α} {a : α} (h : l₁ ~ l₂) : (l₁
292292

293293
end
294294

295-
section CommMonoid
296-
297-
/-- If elements of a list commute with each other, then their product does not
298-
depend on the order of elements. -/
299-
@[to_additive
300-
"If elements of a list additively commute with each other, then their sum does not
301-
depend on the order of elements."]
302-
theorem Perm.prod_eq' [M : Monoid α] {l₁ l₂ : List α} (h : l₁ ~ l₂) (hc : l₁.Pairwise Commute) :
303-
l₁.prod = l₂.prod := by
304-
refine h.foldl_eq' ?_ _
305-
apply Pairwise.forall_of_forall
306-
· intro x y h z
307-
exact (h z).symm
308-
· intros; rfl
309-
· apply hc.imp
310-
intro a b h z
311-
rw [mul_assoc z, mul_assoc z, h]
312-
#align list.perm.prod_eq' List.Perm.prod_eq'
313-
#align list.perm.sum_eq' List.Perm.sum_eq'
314-
315-
variable [CommMonoid α]
316-
317-
@[to_additive]
318-
theorem Perm.prod_eq {l₁ l₂ : List α} (h : Perm l₁ l₂) : prod l₁ = prod l₂ :=
319-
h.fold_op_eq
320-
#align list.perm.prod_eq List.Perm.prod_eq
321-
#align list.perm.sum_eq List.Perm.sum_eq
322-
323-
@[to_additive]
324-
theorem prod_reverse (l : List α) : prod l.reverse = prod l :=
325-
(reverse_perm l).prod_eq
326-
#align list.prod_reverse List.prod_reverse
327-
#align list.sum_reverse List.sum_reverse
328-
329-
end CommMonoid
330-
331295
#align list.perm_inv_core List.perm_inv_core
332296

333297
#align list.perm.cons_inv List.Perm.cons_inv
@@ -669,12 +633,12 @@ theorem length_permutationsAux :
669633
refine' permutationsAux.rec (by simp) _
670634
intro t ts is IH1 IH2
671635
have IH2 : length (permutationsAux is nil) + 1 = is.length ! := by simpa using IH2
672-
simp? [Nat.factorial, Nat.add_succ, mul_comm] at IH1 says
673-
simp only [factorial, add_eq, add_zero, mul_comm] at IH1
636+
simp? [Nat.factorial, Nat.add_succ, Nat.mul_comm] at IH1 says
637+
simp only [factorial, add_eq, Nat.add_zero, Nat.mul_comm] at IH1
674638
rw [permutationsAux_cons,
675639
length_foldr_permutationsAux2' _ _ _ _ _ fun l m => (perm_of_mem_permutations m).length_eq,
676-
permutations, length, length, IH2, Nat.succ_add, Nat.factorial_succ, mul_comm (_ + 1),
677-
← Nat.succ_eq_add_one, ← IH1, add_comm (_ * _), add_assoc, Nat.mul_succ, mul_comm]
640+
permutations, length, length, IH2, Nat.succ_add, Nat.factorial_succ, Nat.mul_comm (_ + 1),
641+
← Nat.succ_eq_add_one, ← IH1, Nat.add_comm (_ * _), Nat.add_assoc, Nat.mul_succ, Nat.mul_comm]
678642
#align list.length_permutations_aux List.length_permutationsAux
679643

680644
theorem length_permutations (l : List α) : length (permutations l) = (length l)! :=
@@ -800,7 +764,7 @@ theorem nthLe_permutations'Aux (s : List α) (x : α) (n : ℕ)
800764
(hn : n < length (permutations'Aux x s)) :
801765
(permutations'Aux x s).nthLe n hn = s.insertNth n x := by
802766
induction' s with y s IH generalizing n
803-
· simp only [length, zero_add, Nat.lt_one_iff] at hn
767+
· simp only [length, Nat.zero_add, Nat.lt_one_iff] at hn
804768
simp [hn]
805769
· cases n
806770
· simp [nthLe]
@@ -817,7 +781,7 @@ theorem count_permutations'Aux_self [DecidableEq α] (l : List α) (x : α) :
817781
simpa [takeWhile, Nat.succ_inj', DecEq_eq] using IH _
818782
· rw [takeWhile]
819783
simp only [mem_map, cons.injEq, Ne.symm hx, false_and, and_false, exists_false,
820-
not_false_iff, count_eq_zero_of_not_mem, zero_add, hx, decide_False, length_nil]
784+
not_false_iff, count_eq_zero_of_not_mem, Nat.zero_add, hx, decide_False, length_nil]
821785
#align list.count_permutations'_aux_self List.count_permutations'Aux_self
822786

823787
@[simp]
@@ -883,7 +847,7 @@ theorem nodup_permutations'Aux_iff {s : List α} {x : α} : Nodup (permutations'
883847
rw [nthLe_insertNth_add_succ]
884848
convert nthLe_insertNth_add_succ s x k m.succ (by simpa using hn) using 2
885849
· simp [Nat.add_succ, Nat.succ_add]
886-
· simp [add_left_comm, add_comm]
850+
· simp [Nat.add_left_comm, Nat.add_comm]
887851
· simpa [Nat.succ_add] using hn
888852
#align list.nodup_permutations'_aux_iff List.nodup_permutations'Aux_iff
889853

0 commit comments

Comments
 (0)