lean4-htt/tests/elab/3705.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

34 lines
1.3 KiB
Text

structure MonoidHom (M : Type _) (N : Type _) [Mul M] [Mul N] where
toFun : M → N
map_mul' : ∀ x y, toFun (x * y) = toFun x * toFun y
class CommMagma (G : Type _) extends Mul G where
mul_comm : ∀ a b : G, a * b = b * a
set_option quotPrecheck false
infixr:25 " →*' " => MonoidHom
instance [Mul M] [Mul N] : CoeFun (M →*' N) (fun _ => M → N) where
coe := MonoidHom.toFun
open CommMagma
-- -- this instance needed
instance MonoidHom.commMonoid [Mul M] [Mul N] :
CommMagma (M →*' N) where
mul := fun f g => { toFun := fun x => f x * g x, map_mul' := sorry }
mul_comm := sorry
example {M} [Mul M] [Mul G] [Pow G Int] :
let zpow : Int → (M →*' G) → (M →*' G) := fun n f => { toFun := fun x => f x ^ n, map_mul' := sorry }
∀ (n : Nat) (a : M →*' G), zpow (Int.ofNat (Nat.succ n)) a = a * zpow (Int.ofNat n) a := by
simp only [Int.ofNat_eq_coe] -- commenting out this line makes simp loop
simp (config := { failIfUnchanged := false }) only [mul_comm] -- should not produce: unexpected bound variable 2
sorry
theorem ex₂ {M} [Mul M] [Mul G] [Pow G Int] :
let zpow : Int → (M →*' G) → (M →*' G) := fun n f => { toFun := fun x => f x ^ n, map_mul' := sorry }
∀ (n : Nat) (a : M →*' G), zpow (Int.ofNat (Nat.succ n)) a = a * zpow (Int.ofNat n) a := by
simp only [mul_comm]
sorry