Skip to content

Commit

Permalink
For p q : ℚ, succ-ℚ p * q = q + (p * q) (#1282)
Browse files Browse the repository at this point in the history
Factoring out a lemma from #1273 as threatened.
  • Loading branch information
lowasser authored Feb 6, 2025
1 parent 8440b84 commit 8662d37
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,32 @@ abstract
( sim-reduced-fraction-ℤ y)))
```

### `succ-ℚ p * q = q + (p * q)`

```agda
abstract
mul-left-succ-ℚ :
(p q : ℚ)
(succ-ℚ p *ℚ q) = q +ℚ (p *ℚ q)
mul-left-succ-ℚ p q =
equational-reasoning
succ-ℚ p *ℚ q
= (one-ℚ *ℚ q) +ℚ (p *ℚ q)
by right-distributive-mul-add-ℚ one-ℚ p q
= q +ℚ (p *ℚ q) by ap-add-ℚ (left-unit-law-mul-ℚ q) refl

mul-right-succ-ℚ :
(p q : ℚ)
(p *ℚ succ-ℚ q) = p +ℚ (p *ℚ q)
mul-right-succ-ℚ p q =
equational-reasoning
p *ℚ succ-ℚ q
= (p *ℚ one-ℚ) +ℚ (p *ℚ q)
by left-distributive-mul-add-ℚ p one-ℚ q
= p +ℚ (p *ℚ q)
by ap-add-ℚ (right-unit-law-mul-ℚ p) refl
```

## See also

- The multiplicative monoid structure on the rational numbers is defined in
Expand Down

0 comments on commit 8662d37

Please sign in to comment.