miscelleaneous

Random Lean experiments

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
-- https://cjquines.com/files/binaryoperations.pdf

import Mathlib

-- example (f : ℝ → ℝ → ℝ) (l r : ℝ) (h : ∀ x, f l x = f x r ∧ f l x = x) : l = r := by
--   have h₁ : f l r = l := by
--     specialize h l
--     grind
--   have h₂ : f l r = r := by
--     specialize h r
--     grind
--   grind

example {α} (f : α  α  α) (l r : α) (hl :  x, f l x = x) (hr :  x, f x r = x) : l = r := by
  have h₁ : f l r = l := by
    grind
  -- have h₂ : f l r = r := by
  --   grind
  grind

example {α} (f : α  α  α) (h :  x y z, f x z = y   z'  z, f x z'  y) :  g : α  α  α,  x y, f x (g x y) = g x (f x y)  f x (g x y) = y := by
  sorry

example {α} (f g : α  α  α) (i j : α) (hid :  x, f i x = x  f x i = x  g j x = x  g x j = x) (h :  x y z w, f (g x y) (g z w) = g (f x z) (f y w)) : f = g := by
  have h₁ (x : α) : f x j = x := by
    specialize h x j j i
    grind
  -- have h₁ (x : α) : f x j = x ∧ f j x = x ∧ g x i = x ∧ g i x = x := by
  --   constructor
  --   specialize h x j j i
  --   grind
  --   constructor
  --   specialize h j i x j
  --   grind
  --   constructor
  --   specialize h x i i j
  --   grind
  --   specialize h i x j i
  --   grind
  have h₂ : i = j := by
    specialize hid j
    grind
  have h₃ (x y : α) : f x y = g x y := by
    specialize h x i i y
    grind
  grind