-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha(be)_eq_c(df).lean
68 lines (58 loc) · 1.6 KB
/
a(be)_eq_c(df).lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
-- a(be)_eq_c(df).lean
-- Si ab = cd y e = f, entonces a(be) = c(df).
-- José A. Alonso Jiménez <https://jaalonso.github.io>
-- Sevilla, 14-julio-2023
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Demostrar que si a, b, c, d, e y f son números reales tales que
-- a * b = c * d y
-- e = f,
-- entonces
-- a * (b * e) = c * (d * f)
-- ---------------------------------------------------------------------
-- Demostración en leguaje natural
-- ===============================
-- Por la siguiente cadena de igualdades
-- a(be)
-- = a(bf) [por la segunda hipótesis]
-- = (ab)f [por la asociativa]
-- = (cd)f [por la primera hipótesis]
-- = c(df) [por la asociativa]
-- Demostraciones en Lean4
-- =======================
import Mathlib.Tactic
import Mathlib.Data.Real.Basic
-- 1ª demostración
example
(a b c d e f : ℝ)
(h1 : a * b = c * d)
(h2 : e = f)
: a * (b * e) = c * (d * f) :=
calc
a * (b * e)
= a * (b * f) := by rw [h2]
_ = (a * b) * f := by rw [←mul_assoc]
_ = (c * d) * f := by rw [h1]
_ = c * (d * f) := by rw [mul_assoc]
-- 2ª demostración
example
(a b c d e f : ℝ)
(h1 : a * b = c * d)
(h2 : e = f)
: a * (b * e) = c * (d * f) :=
by
rw [h2]
rw [←mul_assoc]
rw [h1]
rw [mul_assoc]
-- 3ª demostración
example
(a b c d e f : ℝ)
(h1 : a * b = c * d)
(h2 : e = f)
: a * (b * e) = c * (d * f) :=
by
simp [*, ←mul_assoc]
-- Lemas usados
-- ============
-- #check (mul_assoc : ∀ (a b c : ℝ), (a * b) * c = a * (b * c))