|
| 1 | +/- |
| 2 | +Copyright (c) 2024 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 | +import Mathlib.Algebra.Order.Module.Defs |
| 7 | +import Mathlib.Data.Rat.Cast.Order |
| 8 | + |
| 9 | +/-! |
| 10 | +# Monotonicity of the action by rational numbers |
| 11 | +-/ |
| 12 | + |
| 13 | +variable {α : Type*} |
| 14 | + |
| 15 | +section LinearOrderedAddCommGroup |
| 16 | +variable [LinearOrderedAddCommGroup α] |
| 17 | + |
| 18 | +@[simp] lemma abs_nnqsmul [DistribMulAction ℚ≥0 α] [PosSMulMono ℚ≥0 α] (q : ℚ≥0) (a : α) : |
| 19 | + |q • a| = q • |a| := by |
| 20 | + obtain ha | ha := le_total a 0 <;> |
| 21 | + simp [*, abs_of_nonneg, abs_of_nonpos, smul_nonneg, smul_nonpos_of_nonneg_of_nonpos] |
| 22 | + |
| 23 | +@[simp] lemma abs_qsmul [Module ℚ α] [PosSMulMono ℚ α] (q : ℚ) (a : α) : |
| 24 | + |q • a| = |q| • |a| := by |
| 25 | + obtain ha | ha := le_total a 0 <;> obtain hq | hq := le_total q 0 <;> |
| 26 | + simp [*, abs_of_nonneg, abs_of_nonpos, smul_nonneg, smul_nonpos_of_nonneg_of_nonpos, |
| 27 | + smul_nonpos_of_nonpos_of_nonneg, smul_nonneg_of_nonpos_of_nonpos] |
| 28 | + |
| 29 | +end LinearOrderedAddCommGroup |
| 30 | + |
| 31 | +section LinearOrderedSemifield |
| 32 | +variable [LinearOrderedSemifield α] |
| 33 | + |
| 34 | +instance LinearOrderedSemifield.toPosSMulStrictMono_rat : PosSMulStrictMono ℚ≥0 α where |
| 35 | + elim q hq a b hab := by |
| 36 | + rw [NNRat.smul_def, NNRat.smul_def]; exact mul_lt_mul_of_pos_left hab $ NNRat.cast_pos.2 hq |
| 37 | + |
| 38 | +end LinearOrderedSemifield |
| 39 | + |
| 40 | +section LinearOrderedField |
| 41 | +variable [LinearOrderedField α] |
| 42 | + |
| 43 | +instance LinearOrderedField.toPosSMulStrictMono_rat : PosSMulStrictMono ℚ α where |
| 44 | + elim q hq a b hab := by |
| 45 | + rw [Rat.smul_def, Rat.smul_def]; exact mul_lt_mul_of_pos_left hab $ Rat.cast_pos.2 hq |
| 46 | + |
| 47 | +end LinearOrderedField |
0 commit comments