Built with Alectryon. 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. Hover-Settings: Show types: Show goals:
-- import Batteries.Tactic.Rcases-- import Mathlib.Tactic.Cases-- import Mathlib.Tactic.UseimportMathlib.Logic.Basic
importMathlib.Tactic.Cases
importMathlib.Tactic.Use
-- https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/rcases.20vs.20cases-- ## Understanding `rintro` for 1 pattern-- using `rintro`example(p:Nat→Prop):(∃a,pa)→(∃b,pb)→(∃c,pc):=
Goalsaccomplished!🐙
p: ℕ→Prop a: ℕ ha: pa b: ℕ hb: pb
intro.intro
∃c,pc
Goalsaccomplished!🐙
-- break `rintro` into `intro`s and `obtain`sexample(p:Nat→Prop):(∃a,pa)→(∃b,pb)→(∃c,pc):=
Goalsaccomplished!🐙
p: ℕ→Prop h1: ∃a,pa
(∃b,pb)→∃c,pc
p: ℕ→Prop h1, h2: ∃b,pb
∃c,pc
p: ℕ→Prop h2: ∃b,pb a: ℕ ha: pa
intro
∃c,pc
p: ℕ→Prop a: ℕ ha: pa b: ℕ hb: pb
intro.intro
∃c,pc
Goalsaccomplished!🐙
-- rewrite `obtain` to `cases'`example(p:Nat→Prop):(∃a,pa)→(∃b,pb)→(∃c,pc):=
Goalsaccomplished!🐙
p: ℕ→Prop h1: ∃a,pa
(∃b,pb)→∃c,pc
p: ℕ→Prop h1, h2: ∃b,pb
∃c,pc
p: ℕ→Prop h2: ∃b,pb a: ℕ ha: pa
intro
∃c,pc
p: ℕ→Prop a✝: ℕ ha✝: pa✝ a: ℕ ha: pa
intro.intro
∃c,pc
Goalsaccomplished!🐙
-- ## Understanding `rintro` for 1+ patterns-- using `rintro`example(p:Nat→Nat→Prop):(∃a,(∃b,pab))→(∃c,(∃d,pcd)):=
Goalsaccomplished!🐙
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
intro.intro
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
h
∃d,pad
Goalsaccomplished!🐙
-- break `rintro` into `intro`s and `cases'`sexample(p:Nat→Nat→Prop):(∃a,(∃b,pab))→(∃c,(∃d,pcd)):=
Goalsaccomplished!🐙
p: ℕ→ℕ→Prop h: ∃ab,pab
∃cd,pcd
p: ℕ→ℕ→Prop a: ℕ ha: ∃b,pab
intro
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
intro.intro
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
h
∃d,pad
Goalsaccomplished!🐙
-- collapse `cases'`s into a single `rcases`example(p:Nat→Nat→Prop):(∃a,(∃b,pab))→(∃c,(∃d,pcd)):=
Goalsaccomplished!🐙
p: ℕ→ℕ→Prop h: ∃ab,pab
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
intro.intro
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
h
∃d,pad
Goalsaccomplished!🐙
-- rewrite `rcases` to `obtain` then look at `rintro` above againexample(p:Nat→Nat→Prop):(∃a,(∃b,pab))→(∃c,(∃d,pcd)):=
Goalsaccomplished!🐙
p: ℕ→ℕ→Prop h: ∃ab,pab
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
intro.intro
∃cd,pcd
p: ℕ→ℕ→Prop a, b: ℕ hb: pab
h
∃d,pad
Goalsaccomplished!🐙
namespace Foo
eq_or_ne.{u_1}{α:Sortu_1}(xy:α):x=y∨x≠y
eq_or_ne: ∀ {α : Sort u_1} (x y : α), x = y ∨ x ≠ y
eq_or_nevariable (
p: Prop
p
q: Prop
q
r: Prop
r:
Prop: Type
Prop)
example: ∀ (p q : Prop), p ∨ q → q ∨ p
example (
h: p ∨ q
h:
p: Prop
p∨
q: Prop
q):
q: Prop
q∨
p: Prop
p :=
Goalsaccomplished!🐙
p, q, r: Prop hp: p
inl
q∨p
p, q, r: Prop hq: q
q∨p
p, q, r: Prop hp: p
inl
q∨p
Goalsaccomplished!🐙
p, q, r: Prop hq: q
inr
q∨p
Goalsaccomplished!🐙
example: ∀ (p q : Prop), p ∧ q → q ∧ p
example (
h: p ∧ q
h:
p: Prop
p∧
q: Prop
q):
q: Prop
q∧
p: Prop
p :=
Goalsaccomplished!🐙
p, q, r: Prop hp: p hq: q
intro
q∧p
Goalsaccomplished!🐙
example: ∀ (p q r : Prop), (p ∨ q) ∧ r → r ∧ (q ∨ p)