Skip to content

Commit 50c79bf

Browse files
committed
chore(Algebra/Group): remove backward.privateInPublic
1 parent 89616f5 commit 50c79bf

3 files changed

Lines changed: 20 additions & 32 deletions

File tree

Mathlib/Algebra/Group/Defs.lean

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,13 +1213,10 @@ variable [Group G] {a b : G}
12131213
theorem inv_mul_cancel (a : G) : a⁻¹ * a = 1 :=
12141214
Group.inv_mul_cancel a
12151215

1216-
set_option backward.privateInPublic true in
12171216
@[to_additive]
12181217
private theorem inv_eq_of_mul (h : a * b = 1) : a⁻¹ = b :=
12191218
left_inv_eq_right_inv (inv_mul_cancel a) h
12201219

1221-
set_option backward.privateInPublic true in
1222-
set_option backward.privateInPublic.warn false in
12231220
@[to_additive (attr := simp)]
12241221
theorem mul_inv_cancel (a : G) : a * a⁻¹ = 1 := by
12251222
rw [← inv_mul_cancel a⁻¹, inv_eq_of_mul (inv_mul_cancel a)]
@@ -1251,14 +1248,13 @@ theorem inv_mul_cancel_right (a b : G) : a * b⁻¹ * b = a := by
12511248
theorem div_mul_cancel (a b : G) : a / b * b = a := by
12521249
rw [div_eq_mul_inv, inv_mul_cancel_right a b]
12531250

1254-
set_option backward.privateInPublic true in
1255-
set_option backward.privateInPublic.warn false in
12561251
@[to_additive]
1257-
instance (priority := 100) Group.toDivisionMonoid : DivisionMonoid G :=
1258-
{ inv_inv := fun a ↦ inv_eq_of_mul (inv_mul_cancel a)
1259-
mul_inv_rev :=
1260-
fun a b ↦ inv_eq_of_mul <| by rw [mul_assoc, mul_inv_cancel_left, mul_inv_cancel]
1261-
inv_eq_of_mul := fun _ _ ↦ inv_eq_of_mul }
1252+
instance (priority := 100) Group.toDivisionMonoid : DivisionMonoid G where
1253+
inv_inv a := by exact inv_eq_of_mul (inv_mul_cancel a)
1254+
mul_inv_rev a b := by
1255+
apply inv_eq_of_mul
1256+
rw [mul_assoc, mul_inv_cancel_left, mul_inv_cancel]
1257+
inv_eq_of_mul _ _ := by exact inv_eq_of_mul
12621258

12631259
-- see Note [lower instance priority]
12641260
@[to_additive]

Mathlib/Algebra/Group/Subsemigroup/Operations.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -551,17 +551,14 @@ theorem coe_srange (f : M →ₙ* N) : (f.srange : Set N) = Set.range f :=
551551
theorem mem_srange {f : M →ₙ* N} {y : N} : y ∈ f.srange ↔ ∃ x, f x = y :=
552552
Iff.rfl
553553

554-
set_option backward.privateInPublic true in
555554
@[to_additive]
556555
private theorem srange_mk_aux_mul {f : M → N} (hf : ∀ (x y : M), f (x * y) = f x * f y)
557556
{x y : N} (hx : x ∈ Set.range f) (hy : y ∈ Set.range f) :
558557
x * y ∈ Set.range f :=
559558
(srange ⟨f, hf⟩).mul_mem hx hy
560559

561-
set_option backward.privateInPublic true in
562-
set_option backward.privateInPublic.warn false in
563560
@[to_additive (attr := simp)] theorem srange_mk (f : M → N) (hf) :
564-
srange ⟨f, hf⟩ = ⟨Set.range f, srange_mk_aux_mul hf⟩ := rfl
561+
srange ⟨f, hf⟩ = ⟨Set.range f, by exact srange_mk_aux_mul hf⟩ := rfl
565562

566563
@[to_additive]
567564
theorem srange_eq_map (f : M →ₙ* N) : f.srange = (⊤ : Subsemigroup M).map f :=

Mathlib/Algebra/GroupWithZero/Basic.lean

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -353,28 +353,23 @@ theorem inv_mul_cancel_left₀ (h : a ≠ 0) (b : G₀) : a⁻¹ * (a * b) = b :
353353
_ = b := by simp [h]
354354

355355

356-
set_option backward.privateInPublic true in
357356
private theorem inv_eq_of_mul (h : a * b = 1) : a⁻¹ = b := by
358357
rw [← inv_mul_cancel_left₀ (left_ne_zero_of_mul_eq_one h) b, h, mul_one]
359358

360359
-- See note [lower instance priority]
361-
set_option backward.privateInPublic true in
362-
set_option backward.privateInPublic.warn false in
363-
instance (priority := 100) GroupWithZero.toDivisionMonoid : DivisionMonoid G₀ :=
364-
{ ‹GroupWithZero G₀› with
365-
inv := Inv.inv,
366-
inv_inv := fun a => by
367-
by_cases h : a = 0
368-
· simp [h]
369-
· exact left_inv_eq_right_inv (inv_mul_cancel₀ <| inv_ne_zero h) (inv_mul_cancel₀ h)
370-
mul_inv_rev := fun a b => by
371-
by_cases ha : a = 0
372-
· simp [ha]
373-
by_cases hb : b = 0
374-
· simp [hb]
375-
apply inv_eq_of_mul
376-
simp [mul_assoc, ha, hb],
377-
inv_eq_of_mul := fun _ _ => inv_eq_of_mul }
360+
instance (priority := 100) GroupWithZero.toDivisionMonoid : DivisionMonoid G₀ where
361+
inv_inv a := by
362+
by_cases h : a = 0
363+
· simp [h]
364+
· exact left_inv_eq_right_inv (inv_mul_cancel₀ <| inv_ne_zero h) (inv_mul_cancel₀ h)
365+
mul_inv_rev a b := by
366+
by_cases ha : a = 0
367+
· simp [ha]
368+
by_cases hb : b = 0
369+
· simp [hb]
370+
apply inv_eq_of_mul
371+
simp [mul_assoc, ha, hb]
372+
inv_eq_of_mul _ _ := by exact inv_eq_of_mul
378373

379374
-- see Note [lower instance priority]
380375
instance (priority := 10) : IsCancelMulZero G₀ where

0 commit comments

Comments
 (0)