Skip to content

Commit 81db5a3

Browse files
authored
Add divisibility properties of exponentials (#2940)
* Add divisibility of exponentials * Make inequality irrelevant * Simplify m∣n⇒m^o∣n^o definition by reusing ^-distribʳ-* * Fiddling with variable names
1 parent 76e7589 commit 81db5a3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ Additions to existing modules
259259
map : P ⊆ Q → All P xs → All Q xs
260260
```
261261

262+
* In `Data.Nat.Divisiblity`:
263+
```agad
264+
m∣n⇒m^o∣n^o : ∀ o → m ∣ n → m ^ o ∣ n ^ o
265+
n≤o⇒m^n∣m^o : ∀ m → .(n ≤ o) → m ^ n ∣ m ^ o
266+
```
267+
262268
* In `Data.Nat.Logarithm`
263269
```agda
264270
2^⌊log₂n⌋≤n : ∀ n .{{ _ : NonZero n }} → 2 ^ ⌊log₂ n ⌋ ≤ n

src/Data/Nat/Divisibility.agda

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,16 @@ m*n∣⇒n∣ m n rewrite *-comm m n = m*n∣⇒m∣ n m
257257
(p + q) * d ∎
258258
where open ∣-Reasoning
259259

260+
------------------------------------------------------------------------
261+
-- Properties of _∣_ and _^_
262+
263+
m∣n⇒m^o∣n^o : {m n} o m ∣ n m ^ o ∣ n ^ o
264+
m∣n⇒m^o∣n^o o (divides-refl m/n) = divides (m/n ^ o) (^-distribʳ-* o m/n _)
265+
266+
n≤o⇒m^n∣m^o : m {n o} .(n ≤ o) m ^ n ∣ m ^ o
267+
n≤o⇒m^n∣m^o m {zero} 0≤o = 1∣ _
268+
n≤o⇒m^n∣m^o m {suc _} {suc _} sn≤so = *-monoʳ-∣ m (n≤o⇒m^n∣m^o m (s≤s⁻¹ sn≤so))
269+
260270
------------------------------------------------------------------------
261271
-- Properties of _∣_ and _/_
262272

0 commit comments

Comments
 (0)