@@ -39,6 +39,7 @@ inductive FreeAddMagma (α : Type u) : Type u
39
39
| add : FreeAddMagma α → FreeAddMagma α → FreeAddMagma α
40
40
deriving DecidableEq
41
41
#align free_add_magma FreeAddMagma
42
+ compile_inductive% FreeAddMagma
42
43
43
44
/-- Free magma over a given alphabet. -/
44
45
@[to_additive]
@@ -47,6 +48,7 @@ inductive FreeMagma (α : Type u) : Type u
47
48
| mul : FreeMagma α → FreeMagma α → FreeMagma α
48
49
deriving DecidableEq
49
50
#align free_magma FreeMagma
51
+ compile_inductive% FreeMagma
50
52
51
53
namespace FreeMagma
52
54
@@ -75,8 +77,7 @@ attribute [nolint simpNF] FreeMagma.mul.injEq
75
77
/-- Recursor for `FreeMagma` using `x * y` instead of `FreeMagma.mul x y`. -/
76
78
@[to_additive (attr := elab_as_elim) "Recursor for `FreeAddMagma` using `x + y` instead of
77
79
`FreeAddMagma.add x y`." ]
78
- -- Porting note: added noncomputable
79
- noncomputable def recOnMul {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (of x))
80
+ def recOnMul {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (of x))
80
81
(ih2 : ∀ x y, C x → C y → C (x * y)) : C x :=
81
82
FreeMagma.recOn x ih1 ih2
82
83
#align free_magma.rec_on_mul FreeMagma.recOnMul
@@ -164,8 +165,7 @@ instance : Monad FreeMagma where
164
165
165
166
/-- Recursor on `FreeMagma` using `pure` instead of `of`. -/
166
167
@[to_additive (attr := elab_as_elim) "Recursor on `FreeAddMagma` using `pure` instead of `of`."]
167
- -- Porting note: added noncomputable
168
- protected noncomputable def recOnPure {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (pure x))
168
+ protected def recOnPure {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (pure x))
169
169
(ih2 : ∀ x y, C x → C y → C (x * y)) : C x :=
170
170
FreeMagma.recOnMul x ih1 ih2
171
171
#align free_magma.rec_on_pure FreeMagma.recOnPure
@@ -449,6 +449,7 @@ structure FreeAddSemigroup (α : Type u) where
449
449
/-- The tail of the element -/
450
450
tail : List α
451
451
#align free_add_semigroup FreeAddSemigroup
452
+ compile_inductive% FreeAddSemigroup
452
453
453
454
/-- Free semigroup over a given alphabet. -/
454
455
@[to_additive (attr := ext)]
@@ -458,6 +459,7 @@ structure FreeSemigroup (α : Type u) where
458
459
/-- The tail of the element -/
459
460
tail : List α
460
461
#align free_semigroup FreeSemigroup
462
+ compile_inductive% FreeSemigroup
461
463
462
464
namespace FreeSemigroup
463
465
@@ -505,8 +507,7 @@ instance [Inhabited α] : Inhabited (FreeSemigroup α) := ⟨of default⟩
505
507
506
508
/-- Recursor for free semigroup using `of` and `*`. -/
507
509
@[to_additive (attr := elab_as_elim) "Recursor for free additive semigroup using `of` and `+`."]
508
- -- Porting note: added noncomputable
509
- protected noncomputable def recOnMul {C : FreeSemigroup α → Sort l} (x) (ih1 : ∀ x, C (of x))
510
+ protected def recOnMul {C : FreeSemigroup α → Sort l} (x) (ih1 : ∀ x, C (of x))
510
511
(ih2 : ∀ x y, C (of x) → C y → C (of x * y)) : C x :=
511
512
FreeSemigroup.recOn x fun f s ↦
512
513
List.recOn s ih1 (fun hd tl ih f ↦ ih2 f ⟨hd, tl⟩ (ih1 f) (ih hd)) f
@@ -587,8 +588,7 @@ instance : Monad FreeSemigroup where
587
588
588
589
/-- Recursor that uses `pure` instead of `of`. -/
589
590
@[to_additive (attr := elab_as_elim) "Recursor that uses `pure` instead of `of`."]
590
- -- Porting note: added noncomputable
591
- noncomputable def recOnPure {C : FreeSemigroup α → Sort l} (x) (ih1 : ∀ x, C (pure x))
591
+ def recOnPure {C : FreeSemigroup α → Sort l} (x) (ih1 : ∀ x, C (pure x))
592
592
(ih2 : ∀ x y, C (pure x) → C y → C (pure x * y)) : C x :=
593
593
FreeSemigroup.recOnMul x ih1 ih2
594
594
#align free_semigroup.rec_on_pure FreeSemigroup.recOnPure
@@ -631,15 +631,13 @@ instance : LawfulMonad FreeSemigroup.{u} := LawfulMonad.mk'
631
631
632
632
/-- `FreeSemigroup` is traversable. -/
633
633
@[to_additive "`FreeAddSemigroup` is traversable."]
634
- -- Porting note: added noncomputable
635
- protected noncomputable def traverse {m : Type u → Type u} [Applicative m] {α β : Type u}
634
+ protected def traverse {m : Type u → Type u} [Applicative m] {α β : Type u}
636
635
(F : α → m β) (x : FreeSemigroup α) : m (FreeSemigroup β) :=
637
636
recOnPure x (fun x ↦ pure <$> F x) fun _x _y ihx ihy ↦ (· * ·) <$> ihx <*> ihy
638
637
#align free_semigroup.traverse FreeSemigroup.traverse
639
638
640
639
@[to_additive]
641
- -- Porting note: added noncomputable
642
- noncomputable instance : Traversable FreeSemigroup := ⟨@FreeSemigroup.traverse⟩
640
+ instance : Traversable FreeSemigroup := ⟨@FreeSemigroup.traverse⟩
643
641
644
642
variable {m : Type u → Type u} [Applicative m] (F : α → m β)
645
643
@@ -686,9 +684,8 @@ theorem mul_map_seq (x y : FreeSemigroup α) :
686
684
((· * ·) <$> x <*> y : Id (FreeSemigroup α)) = (x * y : FreeSemigroup α) := rfl
687
685
#align free_semigroup.mul_map_seq FreeSemigroup.mul_map_seq
688
686
689
- -- Porting note: Added noncomputable
690
687
@[to_additive]
691
- noncomputable instance : IsLawfulTraversable FreeSemigroup.{u} :=
688
+ instance : IsLawfulTraversable FreeSemigroup.{u} :=
692
689
{ instLawfulMonadFreeSemigroupInstMonadFreeSemigroup with
693
690
id_traverse := fun x ↦
694
691
FreeSemigroup.recOnMul x (fun x ↦ rfl) fun x y ih1 ih2 ↦ by
0 commit comments