Built with Alectryon, running Lean3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+πŸ–±οΈ to focus. On Mac, use ⌘ instead of Ctrl.
/- To compile:
     alectryon corner_cases.lean3 -o corner_cases.lean3.html
       # Lean β†’ HTML; produces β€˜corner_cases.lean3.html’ -/

example : true := 

true
trivial --- asda end example : true :=

true

true
exact by trivial, done end example : true :=

true
exact by { skip, by_contra, apply h, exact trivial }, skip end
1 : β„•
1 + 1 + 1 : β„•
theorem t0 : true -> true :=

true β†’ true

true β†’ true
αΎ°: true

true
exact true.intro } theorem t1 : true -> true :=

true β†’ true
-- ⊒ true β†’ true
αΎ°: true

true
-- ᾰ : true ⊒ true exact true.intro end -- theorem x : "a" = 1. theorem t2 : true -> true -> true :=

true β†’ true β†’ true
αΎ°, αΎ°_1: true

true
sorry end theorem t3 : true -> true -> true :=

true β†’ true β†’ true
exact by { repeat { intro }, assumption } end theorem t4 : true -> true -> true :=

true β†’ true β†’ true

true β†’ true β†’ true
αΎ°, αΎ°_1: true

true
admit } example : true :=

true
exact true.intro example : true :=

true
trivial example (a b c : β„•) (H1 : a = b + 1) (H2 : b = c) : a = c + 1 := calc a = b + 1 :
a, b, c: β„•
H1: a = b + 1
H2: b = c

a = b + 1
exact H1 ... = c + 1 :
a, b, c: β„•
H1: a = b + 1
H2: b = c

b + 1 = c + 1
rw [ by exact H2 ] example (a b c : β„•) : a * (b * c) = a * (c * b) :=
a, b, c: β„•

a * (b * c) = a * (c * b)
conv begin -- | a * (b * c) = a * (c * b) to_lhs, -- | a * (b * c) congr, -- 2 goals : | a and | b * c skip, -- | b * c rw nat.mul_comm -- | c * b end end example : true :=

true

true
/- Second skip not executed -/

true
trivial end example (n : β„•) : n = n :=
n: β„•

n = n
n: β„•

n = n

nat.zero
0 = 0
n_n: β„•
n_ih: n_n = n_n
n_n.succ = n_n.succ
n_n: β„•
n_ih: n_n = n_n

nat.succ
n_n.succ = n_n.succ
simp } example (n : β„•) : n = n :=
n: β„•

n = n

nat.zero
0 = 0
n_n: β„•
n_ih: n_n = n_n
n_n.succ = n_n.succ
n_n: β„•
n_ih: n_n = n_n

nat.succ
n_n.succ = n_n.succ
simp end example (n : β„•) : n = n :=
n: β„•

n = n
induction n ; simp -- grouped as (((skip ; skip) ; induction n) ; skip) ; simp example (n : β„•) : n = n :=
n: β„•

n = n
skip ; skip ; induction n ; skip ; simp example (n : β„•) : n = n :=
n: β„•

n = n

nat.zero
0 = 0
n_n: β„•
n_ih: n_n = n_n
n_n.succ = n_n.succ

nat.zero
0 = 0
simp }, simp end example : βˆ€ (n a : β„•), n = n :=

βˆ€ (n : β„•), β„• β†’ n = n
n, a: β„•

n = n
simp end example : true :=

true

true
try { trivial } end example (p q r : Prop) : p ∧ (q ∨ r) β†’ (p ∧ q) ∨ (p ∧ r) :=
p, q, r: Prop

p ∧ (q ∨ r) β†’ p ∧ q ∨ p ∧ r
p, q, r: Prop
h: p ∧ (q ∨ r)

p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hqr: q ∨ r

p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hqr: q ∨ r

p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hq: q

or.inl
p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hr: r
p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hq: q

or.inl
p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hq: q

p ∧ q
p, q, r: Prop
hp: p
hq: q
hpq: p ∧ q

p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hq: q
hpq: p ∧ q

p ∧ q
exact hpq },
p, q, r: Prop
hp: p
hr: r

p ∧ r
p, q, r: Prop
hp: p
hr: r
hpr: p ∧ r

p ∧ q ∨ p ∧ r
p, q, r: Prop
hp: p
hr: r
hpr: p ∧ r

p ∧ r
exact hpr end example (p q r : Prop) (hp : p) (hq : q) (hr : r) : p ∧ q ∧ r :=
p, q, r: Prop
hp: p
hq: q
hr: r

p ∧ q ∧ r
p, q, r: Prop
hp: p
hq: q
hr: r

p
p, q, r: Prop
hp: p
hq: q
hr: r
q ∧ r
p, q, r: Prop
hp: p
hq: q
hr: r

p
p, q, r: Prop
hp: p
hq: q
hr: r
q
p, q, r: Prop
hp: p
hq: q
hr: r
r
all_goals { assumption } end example (p q r : Prop) (hp : p) (hq : q) (hr : r) : p ∧ q ∧ r :=
p, q, r: Prop
hp: p
hq: q
hr: r

p ∧ q ∧ r
repeat { all_goals { split <|> assumption } } end example :true :=

true

true
skip; trivial end example (n m k : β„•) (h1 : n = m) (h2 : m = k): (n = k) :=
n, m, k: β„•
h1: n = m
h2: m = k

n = k
rw [show n = m, by assumption, show m = k, by assumption] end theorem sub_le_sub_left {n m : β„•} (k) (h : n ≀ m) : k - m ≀ k - n :=
n, m, k: β„•
h: n ≀ m

k - m ≀ k - n
induction h; [refl, exact le_trans (nat.pred_le _) h_ih] end example : true :=

true

true
try { trivial } } example : true :=

true

true
try begin trivial end end -- grouped as done <|> (done <|> trivial) example : true :=

true
done <|> done <|> trivial -- unexecuted tactic at end example : true :=

true

true
trivial ; done } -- special notation example (n : nat) : true :=
n: β„•

true
induction n ; [skip, skip]; [trivial, trivial] example : true :=

true

true
trivial, -- trailing comma end -- trailing comma example : true :=

true

true
skip ; trivial, } example : true :=

true

true
{ skip ; [skip, skip] } <|> trivial} example : true :=

true

true
{{{{ skip ; [skip, skip] }}}} <|> trivial} -- { } block with no executed children -- there is no first goal to focus on example : true :=

true
{ trivial , { skip, skip } } <|> trivial end -- trailing comma example : true :=

true

true
skip ; trivial, } end example : true :=

true

true
{ skip ; [skip, skip] } <|> trivial} end example : true :=

true

true
{{{{ skip ; [skip, skip] }}}} <|> trivial} end