Аналіз I, Додаток A.2

Вступ до висновків. Демонструє деякі базові тактики та синтаксис Lean.

example {X Y: Prop} (hX: X) : (X Y) Y := X:PropY:ProphX:XX Y Y All goals completed! 🐙example {X Y: Prop} (hX: ¬X) : X Y := X:PropY:ProphX:¬XX Y X:PropY:ProphX:¬XhX':XY All goals completed! 🐙example {X Y: Prop} (hXY: X Y) (hX: X) : Y := X:PropY:ProphXY:X YhX:XY All goals completed! 🐙example {X Y: Prop} (hXY: X Y) (hX: X) : Y := hXY hXexample {X Y: Prop} (hXY: X Y) (hY: ¬ Y) : ¬ X := X:PropY:ProphXY:X YhY:¬Y¬X X:PropY:ProphXY:X YhY:XY All goals completed! 🐙theorem example_A_2_1 (x:) : x = 2 x^2 = 4 := x:x = 2 x ^ 2 = 4 x:h:x = 2x ^ 2 = 4 x:h:x = 22 ^ 2 = 4 All goals completed! 🐙example : (2:) = 2 (2:)^2 = 4 := example_A_2_1 2example : (3:) = 2 (3:)^2 = 4 := example_A_2_1 3example : (-2:) = 2 (-2:)^2 = 4 := example_A_2_1 (-2)not_imp {a b : Prop} : ¬(a → b) ↔ a ∧ ¬b#check _root_.not_imp
not_imp {a b : Prop} : ¬(a → b) ↔ a ∧ ¬b
example : ¬ ((2+2=4) (4+4)=2) := ¬(2 + 2 = 4 4 + 4 = 2) 2 + 2 = 4 ¬4 + 4 = 2 2 + 2 = 4¬4 + 4 = 2 2 + 2 = 4 All goals completed! 🐙 All goals completed! 🐙example {X Y: Prop} : (X Y) (Y X) := X:PropY:PropX Y Y X All goals completed! 🐙example {X Y: Prop} : (X Y) ((¬X) ¬Y) := X:PropY:PropX Y (¬X) ¬Y X:PropY:PropX Y ¬Y ¬X; All goals completed! 🐙example {John_left_at_five John_here_now:Prop} (h1: John_left_at_five John_here_now) (h2: ¬ John_here_now) : ¬ John_left_at_five := John_left_at_five:PropJohn_here_now:Proph1:John_left_at_five John_here_nowh2:¬John_here_now¬John_left_at_five John_left_at_five:PropJohn_here_now:Proph1:John_left_at_five John_here_nowh2:John_left_at_fiveJohn_here_now All goals completed! 🐙example {Washington_capital_US:Prop} (h: Washington_capital_US) : (1+1=2) Washington_capital_US := Washington_capital_US:Proph:Washington_capital_US1 + 1 = 2 Washington_capital_US Washington_capital_US:Proph:Washington_capital_USh':1 + 1 = 2Washington_capital_US All goals completed! 🐙example {NYC_capital_US:Prop} : (2+2=3) NYC_capital_US := NYC_capital_US:Prop2 + 2 = 3 NYC_capital_US NYC_capital_US:Proph:2 + 2 = 3NYC_capital_US All goals completed! 🐙

Твердження A.2.2

example : ((2+2:)=5) (4=(10-4:)) := 2 + 2 = 5 4 = 10 - 4 h:2 + 2 = 54 = 10 - 4 have : (4 + 4:) = 10 := 2 + 2 = 5 4 = 10 - 4 h:2 * (2 + 2) = 2 * 54 + 4 = 10 All goals completed! 🐙 rwa [eq_sub_iff_add_eqh:2 + 2 = 5this:4 = 10 - 44 = 10 - 4 at this

Теорема A.2.4

theorem theorem_A_2_4 (n:) : Even (n * (n+1)) := n:Even (n * (n + 1)) n:this:Even n Odd nEven (n * (n + 1)) n:heven:Even nEven (n * (n + 1))n:hodd:Odd nEven (n * (n + 1)) n:heven:Even nEven (n * (n + 1)) All goals completed! 🐙 n:hodd:Odd nthis:Even (n + 1)Even (n * (n + 1)) All goals completed! 🐙

Наслідок A.2.5

example : let n: := (253+142)*123-(423+198)^342+538-213 Even (n * (n+1)) := theorem_A_2_4 _
example : x:, x = 2 x^2 = 4 := (x : ), x = 2 x ^ 2 = 4 x:h:x = 2x ^ 2 = 4 x:h:x = 22 ^ 2 = 4 All goals completed! 🐙example : ¬ x:, x^2 = 4 x = 2 := ¬ (x : ), x ^ 2 = 4 x = 2 x, x ^ 2 = 4 ¬x = 2 (-2) ^ 2 = 4 ¬-2 = 2 All goals completed! 🐙example {X Y : Prop} : (X Y) = ((X Y) (Y X)) := X:PropY:Prop(X Y) = ((X Y) (Y X)) X:PropY:Prop(X Y) (X Y) (Y X); All goals completed! 🐙example (x:) : x = 2 2*x = 4 := x:x = 2 2 * x = 4 x:x = 2 2 * x = 4x:2 * x = 4 x = 2 x:x = 2 2 * x = 4 x:h:x = 22 * x = 4 All goals completed! 🐙 x:h:2 * x = 4x = 2 All goals completed! 🐙example {X Y :Prop} : (X Y) = (X = Y) := X:PropY:Prop(X Y) = (X = Y) All goals completed! 🐙example : (3 = 2) (6 = 4) := 3 = 2 6 = 4 All goals completed! 🐙example : (X Y:Prop), (X Y) (Y X) := X Y, (X Y) (Y X) x: := -2 X Y, (X Y) (Y X) x: := -2(x = 2 x ^ 2 = 4) (x ^ 2 = 4 x = 2) All goals completed! 🐙theorem contrapositive {X Y: Prop} (hXY: X Y) : ¬ Y ¬ X := X:PropY:ProphXY:X Y¬Y ¬X X:PropY:ProphXY:X YhY:¬Y¬X X:PropY:ProphXY:X YhY:¬YhX:XFalse X:PropY:ProphXY:X YhY:¬YhX:Xthis:YFalse All goals completed! 🐙theorem imp_example (x:) : (x = 2) (x^2 = 4) := x:x = 2 x ^ 2 = 4 x:h:x = 2x ^ 2 = 4 x:h:x = 22 ^ 2 = 4 All goals completed! 🐙theorem imp_contrapositive (x:) : (x^2 4) (x 2) := x:x ^ 2 4 x 2 All goals completed! 🐙

Твердження A.2.6

example {x:} (h:x>0) (hsin: Real.sin x = 1) : x Real.pi / 2 := x:h:x > 0hsin:Real.sin x = 1x Real.pi / 2 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2False have h1 : Real.sin 0 < Real.sin x := x:h:x > 0hsin:Real.sin x = 1x Real.pi / 2 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2-(Real.pi / 2) 0x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2x Real.pi / 2 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2-(Real.pi / 2) 0 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2this:Real.pi > 0-(Real.pi / 2) 0 All goals completed! 🐙 All goals completed! 🐙 have h2 : Real.sin x < Real.sin (Real.pi / 2) := x:h:x > 0hsin:Real.sin x = 1x Real.pi / 2 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2h1:Real.sin 0 < Real.sin x-(Real.pi / 2) xx:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2h1:Real.sin 0 < Real.sin xReal.pi / 2 Real.pi / 2 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2h1:Real.sin 0 < Real.sin x-(Real.pi / 2) x All goals completed! 🐙 All goals completed! 🐙 x:h:x > 0hsin:Real.sin x = 1h':x < Real.pi / 2h1:0 < Real.sin xh2:Real.sin x < 1False All goals completed! 🐙