@@ -26,7 +26,7 @@ well as the expected implementations of tropical addition and tropical multiplic
26
26
* `Tropical R`: The type synonym of the tropical interpretation of `R`.
27
27
If `[LinearOrder R]`, then addition on `R` is via `min`.
28
28
* `Semiring (Tropical R)`: A `LinearOrderedAddCommMonoidWithTop R`
29
- induces a `Semiring (Tropical R)`. If one solely has `[LinearOrderedAddComm<onoid R]`,
29
+ induces a `Semiring (Tropical R)`. If one solely has `[LinearOrderedAddCommMonoid R]`,
30
30
then the "tropicalization of `R`" would be `Tropical (WithTop R)`.
31
31
32
32
## Implementation notes
@@ -61,7 +61,7 @@ variable {R}
61
61
62
62
namespace Tropical
63
63
64
- /-- Reinterpret `x : R` as an element of `tropical R`.
64
+ /-- Reinterpret `x : R` as an element of `Tropical R`.
65
65
See `Tropical.tropEquiv` for the equivalence.
66
66
-/
67
67
--@[ pp_nodot ] Porting note: not implemented in Lean4
@@ -105,13 +105,13 @@ theorem untrop_trop (x : R) : untrop (trop x) = x :=
105
105
--Porting note: New attribute seems to fix things
106
106
attribute [irreducible] Tropical
107
107
108
- theorem left_inverse_trop : Function.LeftInverse (trop : R → Tropical R) untrop :=
108
+ theorem leftInverse_trop : Function.LeftInverse (trop : R → Tropical R) untrop :=
109
109
trop_untrop
110
- #align tropical.left_inverse_trop Tropical.left_inverse_trop
110
+ #align tropical.left_inverse_trop Tropical.leftInverse_trop
111
111
112
- theorem right_inverse_trop : Function.RightInverse (trop : R → Tropical R) untrop :=
112
+ theorem rightInverse_trop : Function.RightInverse (trop : R → Tropical R) untrop :=
113
113
untrop_trop
114
- #align tropical.right_inverse_trop Tropical.right_inverse_trop
114
+ #align tropical.right_inverse_trop Tropical.rightInverse_trop
115
115
116
116
/-- Reinterpret `x : R` as an element of `Tropical R`.
117
117
See `Tropical.tropOrderIso` for the order-preserving equivalence. -/
@@ -177,10 +177,10 @@ theorem untrop_le_iff [LE R] {x y : Tropical R} : untrop x ≤ untrop y ↔ x
177
177
Iff.rfl
178
178
#align tropical.untrop_le_iff Tropical.untrop_le_iff
179
179
180
- instance decidableLe [LE R] [DecidableRel ((· ≤ ·) : R → R → Prop )] :
180
+ instance decidableLE [LE R] [DecidableRel ((· ≤ ·) : R → R → Prop )] :
181
181
DecidableRel ((· ≤ ·) : Tropical R → Tropical R → Prop ) := fun x y =>
182
182
‹DecidableRel (· ≤ ·)› (untrop x) (untrop y)
183
- #align tropical.decidable_le Tropical.decidableLe
183
+ #align tropical.decidable_le Tropical.decidableLE
184
184
185
185
instance [LT R] : LT (Tropical R) where lt x y := untrop x < untrop y
186
186
@@ -189,10 +189,10 @@ theorem untrop_lt_iff [LT R] {x y : Tropical R} : untrop x < untrop y ↔ x < y
189
189
Iff.rfl
190
190
#align tropical.untrop_lt_iff Tropical.untrop_lt_iff
191
191
192
- instance decidableLt [LT R] [DecidableRel ((· < ·) : R → R → Prop )] :
192
+ instance decidableLT [LT R] [DecidableRel ((· < ·) : R → R → Prop )] :
193
193
DecidableRel ((· < ·) : Tropical R → Tropical R → Prop ) := fun x y =>
194
194
‹DecidableRel (· < ·)› (untrop x) (untrop y)
195
- #align tropical.decidable_lt Tropical.decidableLt
195
+ #align tropical.decidable_lt Tropical.decidableLT
196
196
197
197
instance [Preorder R] : Preorder (Tropical R) :=
198
198
{ instLETropical, instLTTropical with
@@ -206,14 +206,14 @@ def tropOrderIso [Preorder R] : R ≃o Tropical R :=
206
206
#align tropical.trop_order_iso Tropical.tropOrderIso
207
207
208
208
@[simp]
209
- theorem trop_order_iso_coe_fn [Preorder R] : (tropOrderIso : R → Tropical R) = trop :=
209
+ theorem tropOrderIso_coe_fn [Preorder R] : (tropOrderIso : R → Tropical R) = trop :=
210
210
rfl
211
- #align tropical.trop_order_iso_coe_fn Tropical.trop_order_iso_coe_fn
211
+ #align tropical.trop_order_iso_coe_fn Tropical.tropOrderIso_coe_fn
212
212
213
213
@[simp]
214
- theorem trop_order_iso_symm_coe_fn [Preorder R] : (tropOrderIso.symm : Tropical R → R) = untrop :=
214
+ theorem tropOrderIso_symm_coe_fn [Preorder R] : (tropOrderIso.symm : Tropical R → R) = untrop :=
215
215
rfl
216
- #align tropical.trop_order_iso_symm_coe_fn Tropical.trop_order_iso_symm_coe_fn
216
+ #align tropical.trop_order_iso_symm_coe_fn Tropical.tropOrderIso_symm_coe_fn
217
217
218
218
theorem trop_monotone [Preorder R] : Monotone (trop : R → Tropical R) := fun _ _ => id
219
219
#align tropical.trop_monotone Tropical.trop_monotone
@@ -264,8 +264,7 @@ variable [LinearOrder R]
264
264
instance : Add (Tropical R) :=
265
265
⟨fun x y => trop (min (untrop x) (untrop y))⟩
266
266
267
- instance : AddCommSemigroup (Tropical
268
- R) where
267
+ instance : AddCommSemigroup (Tropical R) where
269
268
add := (· + ·)
270
269
add_assoc _ _ _ := untrop_injective (min_assoc _ _ _)
271
270
add_comm _ _ := untrop_injective (min_comm _ _)
@@ -292,7 +291,7 @@ theorem trop_add_def (x y : Tropical R) : x + y = trop (min (untrop x) (untrop y
292
291
instance : LinearOrder (Tropical R) :=
293
292
{ instPartialOrderTropical with
294
293
le_total := fun a b => le_total (untrop a) (untrop b)
295
- decidable_le := Tropical.decidableLe
294
+ decidable_le := Tropical.decidableLE
296
295
max := fun a b => trop (max (untrop a) (untrop b))
297
296
max_def := fun a b => untrop_injective (by simp [max_def]; split_ifs <;> simp)
298
297
min := (· + ·)
@@ -436,8 +435,7 @@ theorem untrop_div [Sub R] (x y : Tropical R) : untrop (x / y) = untrop x - untr
436
435
rfl
437
436
#align tropical.untrop_div Tropical.untrop_div
438
437
439
- instance [AddSemigroup R] :
440
- Semigroup (Tropical R) where
438
+ instance [AddSemigroup R] : Semigroup (Tropical R) where
441
439
mul := (· * ·)
442
440
mul_assoc _ _ _ := untrop_injective (add_assoc _ _ _)
443
441
@@ -457,8 +455,7 @@ theorem trop_smul {α : Type _} [SMul α R] (x : R) (n : α) : trop (n • x) =
457
455
rfl
458
456
#align tropical.trop_smul Tropical.trop_smul
459
457
460
- instance [AddZeroClass R] : MulOneClass
461
- (Tropical R) where
458
+ instance [AddZeroClass R] : MulOneClass (Tropical R) where
462
459
one := 1
463
460
mul := (· * ·)
464
461
one_mul _ := untrop_injective <| zero_add _
0 commit comments