Skip to content

Commit 721b21c

Browse files
committed
chore(Algebra/ModEq): split file (leanprover-community#34003)
Minor modifications to the lemmas linking it to `Nat.ModEq` and `Int.ModEq` to make the proofs work, otherwise copy+paste+add stub module docs.
1 parent 986dfcf commit 721b21c

File tree

10 files changed

+505
-437
lines changed

10 files changed

+505
-437
lines changed

Mathlib.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ public import Mathlib.Algebra.Field.Equiv
296296
public import Mathlib.Algebra.Field.GeomSum
297297
public import Mathlib.Algebra.Field.IsField
298298
public import Mathlib.Algebra.Field.MinimalAxioms
299+
public import Mathlib.Algebra.Field.ModEq
299300
public import Mathlib.Algebra.Field.NegOnePow
300301
public import Mathlib.Algebra.Field.Opposite
301302
public import Mathlib.Algebra.Field.Periodic
@@ -391,6 +392,7 @@ public import Mathlib.Algebra.Group.Irreducible.Defs
391392
public import Mathlib.Algebra.Group.Irreducible.Indecomposable
392393
public import Mathlib.Algebra.Group.Irreducible.Lemmas
393394
public import Mathlib.Algebra.Group.MinimalAxioms
395+
public import Mathlib.Algebra.Group.ModEq
394396
public import Mathlib.Algebra.Group.Nat.Defs
395397
public import Mathlib.Algebra.Group.Nat.Even
396398
public import Mathlib.Algebra.Group.Nat.Hom
@@ -4426,6 +4428,7 @@ public import Mathlib.GroupTheory.PushoutI
44264428
public import Mathlib.GroupTheory.QuotientGroup.Basic
44274429
public import Mathlib.GroupTheory.QuotientGroup.Defs
44284430
public import Mathlib.GroupTheory.QuotientGroup.Finite
4431+
public import Mathlib.GroupTheory.QuotientGroup.ModEq
44294432
public import Mathlib.GroupTheory.Rank
44304433
public import Mathlib.GroupTheory.RegularWreathProduct
44314434
public import Mathlib.GroupTheory.Schreier

Mathlib/Algebra/Field/ModEq.lean

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/-
2+
Copyright (c) 2023 Yaël Dillies. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yaël Dillies
5+
-/
6+
module
7+
8+
public import Mathlib.Algebra.Group.ModEq
9+
public import Mathlib.Algebra.Field.Basic
10+
public import Mathlib.Tactic.MinImports
11+
12+
/-!
13+
# Congruence modulo multiples of an element in a (semi)field
14+
15+
In this file we prove a few theorems about the congruence relation `_ ≡ _ [PMOD _]`
16+
in a division semiring or a semifield.
17+
-/
18+
19+
public section
20+
21+
namespace AddCommGroup
22+
23+
section DivisionSemiring
24+
variable {K : Type*} [DivisionSemiring K] {a b c p : K}
25+
26+
@[simp] lemma div_modEq_div (hc : c ≠ 0) : a / c ≡ b / c [PMOD p] ↔ a ≡ b [PMOD (p * c)] := by
27+
simp [modEq_iff_nsmul, add_div' _ _ _ hc, div_left_inj' hc, mul_assoc]
28+
29+
@[simp] lemma mul_modEq_mul_right (hc : c ≠ 0) : a * c ≡ b * c [PMOD p] ↔ a ≡ b [PMOD (p / c)] := by
30+
rw [div_eq_mul_inv, ← div_modEq_div (inv_ne_zero hc), div_inv_eq_mul, div_inv_eq_mul]
31+
32+
end DivisionSemiring
33+
34+
section Semifield
35+
variable {K : Type*} [Semifield K] {a b c p : K}
36+
37+
@[simp] lemma mul_modEq_mul_left (hc : c ≠ 0) : c * a ≡ c * b [PMOD p] ↔ a ≡ b [PMOD (p / c)] := by
38+
simp [mul_comm c, hc]
39+
40+
end Semifield
41+
end AddCommGroup

0 commit comments

Comments
 (0)