lean2/tests/lean/run/blast_safe_log_issue2.lean

54 lines
2.3 KiB
Text
Raw Normal View History

import data.real
open real
namespace safe
definition pos (x : ) := x > 0
definition nzero (x : ) := x ≠ 0
constants (exp : )
constants (safe_log : Π (x : ), pos x → )
constants (safe_inv : Π (x : ), nzero x → )
notation `log`:max x:max := (@safe_log x (by grind))
notation [priority 100000] x:max ⁻¹ := (@safe_inv x (by grind))
definition sq (x : ) := x * x
notation a `²` := sq a
lemma nzero_of_pos [intro!] {x : } : pos x → nzero x := sorry
lemma pos_bit1 [intro!] {x : } : pos x → pos (: bit1 x :) := sorry
lemma pos_bit0 [intro!] {x : } : pos x → pos (: bit0 x :) := sorry
lemma pos_inv [forward] {x : } : pos x → (: pos (inv x) :) := sorry
lemma pos_1 [intro!] : pos (1:) := sorry
lemma pos_add [intro!] [forward] {x y : } : pos x → pos y → pos (: x + y :) := sorry
lemma pos_mul [intro!] [forward] {x y : } : pos x → pos y → pos (: x * y :) := sorry
lemma pos_sq [intro!] {x : } : pos x → pos (: sq x :) := sorry
lemma inv_pos [intro!] {x : } : pos x → pos (: x⁻¹ :) := sorry
lemma exp_pos [intro!] (x : ) : pos (: exp x :) := sorry
lemma log_mul [forward] : ∀ (x y : ), pos x → pos y → (: log (x * y) :) = (: log x + log y :) := sorry
lemma log_sq [forward] : ∀ (x : ), pos x → (: log (sq x) :) = (: 2 * log x :) := sorry
lemma log_inv [forward] : ∀ (x : ), pos x → (: log (x⁻¹) :) = (: - log x :) := sorry
lemma inv_mul [forward] : ∀ (x y : ), pos x → pos y → (: (x * y)⁻¹ :) = (: x⁻¹ * y⁻¹ :) := sorry
lemma exp_add [forward] : ∀ (x y : ), (: exp (x + y) :) = (: exp x * exp y :) := sorry
lemma pair_prod [forward] : ∀ (x y : ), (: sq x + 2 * x * y + sq y :) = sq (x + y) := sorry
lemma mul_two_sum [forward] : ∀ (x : ), (: 2 * x :) = (: x + x :) := sorry
lemma sub_def [forward] : ∀ (x y : ), (x - y) = x + -y := sorry
lemma mul_div_cancel [forward] : ∀ (x y : ), (y * x) / y = x := sorry
lemma div_neg [forward] : ∀ (x y : ), x / -y = - (x / y) := sorry
attribute right_distrib [forward]
attribute left_distrib [forward]
set_option blast.strategy "ematch"
example (x y z w : ) : pos x → pos y → pos z → pos w → x * y = w + exp z →
log ((w² + 2 * w * exp z + (exp z)²)) / -2 = log (x⁻¹) - log y :=
by blast
end safe