informal
stringclasses 1
value | formal
stringlengths 41
427k
|
---|---|
and_left_comm ** a b c : Prop ⊢ a ∧ b ∧ c ↔ b ∧ a ∧ c ** rw [← and_assoc, ← and_assoc, @and_comm a b] ** Qed |
|
and_right_comm ** a b c : Prop ⊢ (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b ** simp only [and_left_comm, and_comm] ** Qed |
|
and_rotate ** a b c : Prop ⊢ a ∧ b ∧ c ↔ b ∧ c ∧ a ** simp only [and_left_comm, and_comm] ** Qed |
|
and_and_and_comm ** a b c d : Prop ⊢ (a ∧ b) ∧ c ∧ d ↔ (a ∧ c) ∧ b ∧ d ** rw [← and_assoc, @and_right_comm a, and_assoc] ** Qed |
|
and_and_left ** a b c : Prop ⊢ a ∧ b ∧ c ↔ (a ∧ b) ∧ a ∧ c ** rw [and_and_and_comm, and_self] ** Qed |
|
and_and_right ** a b c : Prop ⊢ (a ∧ b) ∧ c ↔ (a ∧ c) ∧ b ∧ c ** rw [and_and_and_comm, and_self] ** Qed |
|
iff_self_and ** p q : Prop ⊢ (p ↔ p ∧ q) ↔ p → q ** rw [@Iff.comm p, and_iff_left_iff_imp] ** Qed |
|
iff_and_self ** p q : Prop ⊢ (p ↔ q ∧ p) ↔ p → q ** rw [and_comm, iff_self_and] ** Qed |
|
and_congr_right_iff ** a b c : Prop h : a ∧ b ↔ a ∧ c ha : a ⊢ b ↔ c ** simp [ha] at h ** a b c : Prop ha : a h : b ↔ c ⊢ b ↔ c ** exact h ** Qed |
|
and_congr_left_iff ** a c b : Prop ⊢ (a ∧ c ↔ b ∧ c) ↔ c → (a ↔ b) ** simp only [and_comm, ← and_congr_right_iff] ** Qed |
|
or_left_comm ** a b c : Prop ⊢ a ∨ b ∨ c ↔ b ∨ a ∨ c ** rw [← or_assoc, ← or_assoc, @or_comm a b] ** Qed |
|
or_right_comm ** a b c : Prop ⊢ (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b ** rw [or_assoc, or_assoc, @or_comm b] ** Qed |
|
or_or_or_comm ** a b c d : Prop ⊢ (a ∨ b) ∨ c ∨ d ↔ (a ∨ c) ∨ b ∨ d ** rw [← or_assoc, @or_right_comm a, or_assoc] ** Qed |
|
or_or_distrib_left ** a b c : Prop ⊢ a ∨ b ∨ c ↔ (a ∨ b) ∨ a ∨ c ** rw [or_or_or_comm, or_self] ** Qed |
|
or_or_distrib_right ** a b c : Prop ⊢ (a ∨ b) ∨ c ↔ (a ∨ c) ∨ b ∨ c ** rw [or_or_or_comm, or_self] ** Qed |
|
or_rotate ** a b c : Prop ⊢ a ∨ b ∨ c ↔ b ∨ c ∨ a ** simp only [or_left_comm, Or.comm] ** Qed |
|
or_iff_right_iff_imp ** a b : Prop ⊢ (a ∨ b ↔ b) ↔ a → b ** rw [or_comm, or_iff_left_iff_imp] ** Qed |
|
or_and_right ** a b c : Prop ⊢ (a ∨ b) ∧ c ↔ a ∧ c ∨ b ∧ c ** simp [and_comm, and_or_left] ** Qed |
|
and_or_right ** a b c : Prop ⊢ a ∧ b ∨ c ↔ (a ∨ c) ∧ (b ∨ c) ** simp [or_comm, or_and_left] ** Qed |
|
forall_eq' ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∀ (a : α), a' = a → p a) ↔ p a' ** simp [@eq_comm _ a'] ** Qed |
|
exists_eq_right ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ ∀ (a : α), p a ∧ a = a' ↔ a = a' ∧ p a ** exact fun a => And.comm ** Qed |
|
exists_and_right ** α : Sort u_1 p q : α → Prop b : Prop ⊢ (∃ x, p x ∧ b) ↔ (∃ x, p x) ∧ b ** simp [And.comm] ** Qed |
|
exists_eq_left' ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, a' = a ∧ p a) ↔ p a' ** simp [@eq_comm _ a'] ** Qed |
|
forall_eq_or_imp ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∀ (a : α), a = a' ∨ q a → p a) ↔ p a' ∧ ∀ (a : α), q a → p a ** simp only [or_imp, forall_and, forall_eq] ** Qed |
|
exists_eq_or_imp ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, (a = a' ∨ q a) ∧ p a) ↔ p a' ∨ ∃ a, q a ∧ p a ** simp only [or_and_right, exists_or, exists_eq_left] ** Qed |
|
exists_eq_right_right ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, p a ∧ b ∧ a = a') ↔ p a' ∧ b ** simp [← and_assoc] ** Qed |
|
exists_eq_right_right' ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, p a ∧ b ∧ a' = a) ↔ p a' ∧ b ** (conv in _=_ => rw [eq_comm]) ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, p a ∧ b ∧ a = a') ↔ p a' ∧ b ** simp ** α : Sort u_1 p q : α → Prop b : Prop a' : α ⊢ (∃ a, p a ∧ b ∧ a' = a) ↔ p a' ∧ b ** conv in _=_ => rw [eq_comm] ** Qed |
|
forall_apply_eq_imp_iff ** α : Sort ?u.16067 p✝ q : α → Prop b : Prop β : Sort u_1 f : α → β p : β → Prop ⊢ (∀ (b : β) (a : α), f a = b → p b) ↔ ∀ (a : α), p (f a) ** simp [forall_comm] ** Qed |
|
forall_eq_apply_imp_iff ** α : Sort ?u.16514 p✝ q : α → Prop b : Prop β : Sort u_1 f : α → β p : β → Prop ⊢ (∀ (b : β) (a : α), b = f a → p b) ↔ ∀ (a : α), p (f a) ** simp [forall_comm] ** Qed |
|
decide_eq_true_iff ** p : Prop inst✝ : Decidable p ⊢ decide p = true ↔ p ** simp ** Qed |
|
decide_eq_decide ** p q : Prop inst✝¹ : Decidable p inst✝ : Decidable q h : decide p = decide q ⊢ p ↔ q ** rw [← decide_eq_true_iff p, h, decide_eq_true_iff] ** p q : Prop inst✝¹ : Decidable p inst✝ : Decidable q h : p ↔ q ⊢ decide p = decide q ** simp [h] ** Qed |
|
Decidable.imp_or ** a b c : Prop inst✝ : Decidable a ⊢ a → b ∨ c ↔ (a → b) ∨ (a → c) ** by_cases a <;> simp_all ** Qed |
|
Decidable.imp_or' ** b : Prop a : Sort u_1 c : Prop inst✝ : Decidable b h : b ⊢ a → b ∨ c ↔ (a → b) ∨ (a → c) ** simp [h] ** b : Prop a : Sort u_1 c : Prop inst✝ : Decidable b h : ¬b ⊢ a → b ∨ c ↔ (a → b) ∨ (a → c) ** rw [eq_false h, false_or] ** b : Prop a : Sort u_1 c : Prop inst✝ : Decidable b h : ¬b ⊢ a → c ↔ (a → False) ∨ (a → c) ** exact (or_iff_right_of_imp fun hx x => (hx x).elim).symm ** Qed |
|
Decidable.not_iff_comm ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (¬a ↔ b) ↔ (¬b ↔ a) ** rw [@iff_def (¬a), @iff_def (¬b)] ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (¬a → b) ∧ (b → ¬a) ↔ (¬b → a) ∧ (a → ¬b) ** exact and_congr not_imp_comm imp_not_comm ** Qed |
|
Decidable.not_iff ** b a : Prop inst✝ : Decidable b ⊢ ¬(a ↔ b) ↔ (¬a ↔ b) ** by_cases h : b <;> simp [h, iff_true, iff_false] ** Qed |
|
Decidable.iff_not_comm ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (a ↔ ¬b) ↔ (b ↔ ¬a) ** rw [@iff_def a, @iff_def b] ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (a → ¬b) ∧ (¬b → a) ↔ (b → ¬a) ∧ (¬a → b) ** exact and_congr imp_not_comm not_imp_comm ** Qed |
|
Decidable.iff_iff_not_or_and_or_not ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (a ↔ b) ↔ (¬a ∨ b) ∧ (a ∨ ¬b) ** rw [iff_iff_implies_and_implies a b] ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ (a → b) ∧ (b → a) ↔ (¬a ∨ b) ∧ (a ∨ ¬b) ** simp only [imp_iff_not_or, Or.comm] ** Qed |
|
Decidable.or_iff_not_and_not ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ a ∨ b ↔ ¬(¬a ∧ ¬b) ** rw [← not_or, not_not] ** Qed |
|
Decidable.and_iff_not_or_not ** a b : Prop inst✝¹ : Decidable a inst✝ : Decidable b ⊢ a ∧ b ↔ ¬(¬a ∨ ¬b) ** rw [← not_and, not_not] ** Qed |
|
Decidable.and_or_imp ** a b c : Prop inst✝ : Decidable a ha : a ⊢ a ∧ b ∨ (a → c) ↔ a → b ∨ c ** simp only [ha, true_and, true_imp_iff] ** a b c : Prop inst✝ : Decidable a ha : ¬a ⊢ a ∧ b ∨ (a → c) ↔ a → b ∨ c ** simp only [ha, false_or, false_and, false_imp_iff] ** Qed |
|
Decidable.or_congr_left' ** c a b : Prop inst✝ : Decidable c h : ¬c → (a ↔ b) ⊢ a ∨ c ↔ b ∨ c ** rw [or_iff_not_imp_right, or_iff_not_imp_right] ** c a b : Prop inst✝ : Decidable c h : ¬c → (a ↔ b) ⊢ ¬c → a ↔ ¬c → b ** exact imp_congr_right h ** Qed |
|
Decidable.or_congr_right' ** a b c : Prop inst✝ : Decidable a h : ¬a → (b ↔ c) ⊢ a ∨ b ↔ a ∨ c ** rw [or_iff_not_imp_left, or_iff_not_imp_left] ** a b c : Prop inst✝ : Decidable a h : ¬a → (b ↔ c) ⊢ ¬a → b ↔ ¬a → c ** exact imp_congr_right h ** Qed |
|
Decidable.not_exists_not ** α : Sort u_1 p : α → Prop inst✝ : (x : α) → Decidable (p x) ⊢ (¬∃ x, ¬p x) ↔ ∀ (x : α), p x ** simp only [not_exists, Decidable.not_not] ** Qed |
|
Classical.forall_or_exists_not ** α : Sort u_1 P : α → Prop ⊢ (∀ (a : α), P a) ∨ ∃ a, ¬P a ** rw [← not_forall] ** α : Sort u_1 P : α → Prop ⊢ (∀ (a : α), P a) ∨ ¬∀ (x : α), P x ** exact em _ ** Qed |
|
Classical.exists_or_forall_not ** α : Sort u_1 P : α → Prop ⊢ (∃ a, P a) ∨ ∀ (a : α), ¬P a ** rw [← not_exists] ** α : Sort u_1 P : α → Prop ⊢ (∃ a, P a) ∨ ¬∃ x, P x ** exact em _ ** Qed |
|
proof_irrel_heq ** p q : Prop hp : p hq : q ⊢ HEq hp hq ** cases propext (iff_of_true hp hq) ** case refl p : Prop hp hq : p ⊢ HEq hp hq ** rfl ** Qed |
|
eq_rec_constant ** α : Sort u_1 a a' : α β : Sort u_2 y : β h : a = a' ⊢ h ▸ y = y ** cases h ** case refl α : Sort u_1 a : α β : Sort u_2 y : β ⊢ (_ : a = a) ▸ y = y ** rfl ** Qed |
|
congrArg₂ ** α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β → γ x x' : α y y' : β hx : x = x' hy : y = y' ⊢ f x y = f x' y' ** subst hx hy ** α : Sort u_1 β : Sort u_2 γ : Sort u_3 f : α → β → γ x : α y : β ⊢ f x y = f x y ** rfl ** Qed |
|
ite_id ** c : Prop inst✝ : Decidable c α : Sort u_1 t : α ⊢ (if c then t else t) = t ** split <;> rfl ** Qed |
|
apply_dite ** α : Sort u_1 β : Sort u_2 f : α → β P : Prop inst✝ : Decidable P x : P → α y : ¬P → α ⊢ f (dite P x y) = if h : P then f (x h) else f (y h) ** by_cases h : P <;> simp [h] ** Qed |
|
dite_not ** α : Sort u_1 P : Prop inst✝ : Decidable P x : ¬P → α y : ¬¬P → α ⊢ dite (¬P) x y = dite P (fun h => y (_ : ¬¬P)) x ** by_cases h : P <;> simp [h] ** Qed |
|
Bool.eq_iff_iff ** a b : Bool ⊢ a = b ↔ (a = true ↔ b = true) ** cases b <;> simp ** Qed |
|
Acc.ndrec_eq_ndrecC ** ⊢ @ndrec = @Acc.ndrecC ** funext α r motive intro a t ** case h.h.h.h.h.h α : Sort u_1 r : α → α → Prop motive : α → Sort u_2 intro : (x : α) → (∀ (y : α), r y x → Acc r y) → ((y : α) → r y x → motive y) → motive x a : α t : Acc r a ⊢ ndrec intro t = Acc.ndrecC intro t ** rw [Acc.ndrec, rec_eq_recC, Acc.ndrecC] ** Qed |
|
Acc.ndrecOn_eq_ndrecOnC ** ⊢ @ndrecOn = @Acc.ndrecOnC ** funext α r motive intro a t ** case h.h.h.h.h.h α : Sort u_1 r : α → α → Prop motive : α → Sort u_2 intro : α a : Acc r intro t : (x : α) → (∀ (y : α), r y x → Acc r y) → ((y : α) → r y x → motive y) → motive x ⊢ ndrecOn a t = Acc.ndrecOnC a t ** rw [Acc.ndrecOn, rec_eq_recC, Acc.ndrecOnC] ** Qed |
|
WellFounded.fixF_eq_fixFC ** ⊢ @fixF = @WellFounded.fixFC ** funext α r C F x a ** case h.h.h.h.h.h α : Sort u_1 r : α → α → Prop C : α → Sort u_2 F : (x : α) → ((y : α) → r y x → C y) → C x x : α a : Acc r x ⊢ fixF F x a = WellFounded.fixFC F x a ** rw [fixF, Acc.rec_eq_recC, fixFC] ** Qed |
|
String.csize_eq ** c : Char ⊢ csize c = 1 ∨ csize c = 2 ∨ csize c = 3 ∨ csize c = 4 ** simp only [csize, Char.utf8Size] ** c : Char ⊢ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 then UInt32.ofNatCore 1 Char.utf8Size.proof_2 else if c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 then UInt32.ofNatCore 2 Char.utf8Size.proof_4 else if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 then UInt32.ofNatCore 1 Char.utf8Size.proof_2 else if c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 then UInt32.ofNatCore 2 Char.utf8Size.proof_4 else if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 then UInt32.ofNatCore 1 Char.utf8Size.proof_2 else if c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 then UInt32.ofNatCore 2 Char.utf8Size.proof_4 else if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 then UInt32.ofNatCore 1 Char.utf8Size.proof_2 else if c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 then UInt32.ofNatCore 2 Char.utf8Size.proof_4 else if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** repeat (first | split | (solve | simp)) ** case inr.inr.inr c : Char h✝² : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 ⊢ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** (first | split | (solve | simp)) ** case inr.inr.inr c : Char h✝² : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 ⊢ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** first | split | (solve | simp) ** case inr.inr c : Char h✝¹ : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 ⊢ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (if c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** split ** case inr.inr.inr c : Char h✝² : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 ⊢ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** (solve | simp) ** case inr.inr.inr c : Char h✝² : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 ⊢ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** solve | simp ** case inr.inr.inr c : Char h✝² : ¬c.val ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 h✝¹ : ¬c.val ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 h✝ : ¬c.val ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 ⊢ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 1 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 2 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 3 ∨ UInt32.toNat (UInt32.ofNatCore 4 Char.utf8Size.proof_7) = 4 ** simp ** Qed |
|
String.csize_pos ** c : Char ⊢ 0 < csize c ** rcases csize_eq c with _|_|_|_ <;> simp_all ** Qed |
|
String.csize_le_4 ** c : Char ⊢ csize c ≤ 4 ** rcases csize_eq c with _|_|_|_ <;> simp_all ** Qed |
|
Std.Range.numElems_stop_le_start ** start stop step : Nat h : { start := start, stop := stop, step := step }.stop ≤ { start := start, stop := stop, step := step }.start ⊢ numElems { start := start, stop := stop, step := step } = 0 ** simp [numElems] ** start stop step : Nat h : { start := start, stop := stop, step := step }.stop ≤ { start := start, stop := stop, step := step }.start ⊢ (if step = 0 then if stop ≤ start then 0 else stop else (stop - start + step - 1) / step) = 0 ** split <;> simp_all ** case inr start stop step : Nat h : stop ≤ start h✝ : ¬step = 0 ⊢ (stop - start + step - 1) / step = 0 ** apply Nat.div_eq_of_lt ** case inr.h₀ start stop step : Nat h : stop ≤ start h✝ : ¬step = 0 ⊢ stop - start + step - 1 < step ** simp [Nat.sub_eq_zero_of_le h] ** case inr.h₀ start stop step : Nat h : stop ≤ start h✝ : ¬step = 0 ⊢ step - 1 < step ** exact Nat.pred_lt ‹_› ** Qed |
|
Std.Range.numElems_step_1 ** start stop : Nat ⊢ numElems { start := start, stop := stop, step := 1 } = stop - start ** simp [numElems] ** Qed |
|
Std.Range.numElems_le_iff ** start stop step i : Nat hstep : 0 < step ⊢ (stop - start + step - 1) / step ≤ i ↔ stop - start + step - 1 < step * i + step ** rw [← Nat.lt_succ (n := i), Nat.div_lt_iff_lt_mul hstep, Nat.mul_comm, ← Nat.mul_succ] ** start stop step i : Nat hstep : 0 < step ⊢ stop - start + step - 1 < step * i + step ↔ stop - start + step - 1 < step * i + 1 + (step - 1) ** rw [Nat.add_right_comm, Nat.add_assoc, Nat.sub_add_cancel hstep] ** start stop step i : Nat hstep : 0 < step ⊢ stop - start + step - 1 < step * i + 1 + (step - 1) ↔ stop ≤ start + step * i ** rw [Nat.add_sub_assoc hstep, Nat.add_lt_add_iff_right, Nat.lt_succ,
Nat.sub_le_iff_le_add'] ** Qed |
|
Std.Range.mem_range'_elems ** x : Nat r : Range h : x ∈ List.range' r.start (numElems r) r.step ⊢ x ∈ r ** obtain ⟨i, h', rfl⟩ := List.mem_range'.1 h ** case intro.intro r : Range i : Nat h' : i < numElems r h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step ⊢ r.start + r.step * i ∈ r ** refine ⟨Nat.le_add_right .., ?_⟩ ** case intro.intro r : Range i : Nat h' : i < numElems r h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step ⊢ r.start + r.step * i < r.stop ** unfold numElems at h' ** case intro.intro r : Range i : Nat h' : i < if r.step = 0 then if r.stop ≤ r.start then 0 else r.stop else (r.stop - r.start + r.step - 1) / r.step h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step ⊢ r.start + r.step * i < r.stop ** split at h' ** case intro.intro.inl r : Range i : Nat h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step h✝ : r.step = 0 h' : i < if r.stop ≤ r.start then 0 else r.stop ⊢ r.start + r.step * i < r.stop ** split at h' <;> [cases h'; simp_all] ** case intro.intro.inr r : Range i : Nat h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step h✝ : ¬r.step = 0 h' : i < (r.stop - r.start + r.step - 1) / r.step ⊢ r.start + r.step * i < r.stop ** next step0 =>
refine Nat.not_le.1 fun h =>
Nat.not_le.2 h' <| (numElems_le_iff (Nat.pos_of_ne_zero step0)).2 h ** r : Range i : Nat h : r.start + r.step * i ∈ List.range' r.start (numElems r) r.step step0 : ¬r.step = 0 h' : i < (r.stop - r.start + r.step - 1) / r.step ⊢ r.start + r.step * i < r.stop ** refine Nat.not_le.1 fun h =>
Nat.not_le.2 h' <| (numElems_le_iff (Nat.pos_of_ne_zero step0)).2 h ** Qed |
|
Option.some_inj ** α : Type u_1 a b : α ⊢ some a = some b ↔ a = b ** simp ** Qed |
|
Std.PairingHeapImp.Heap.noSibling_merge ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α ⊢ NoSibling (merge le s₁ s₂) ** unfold merge ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α ⊢ NoSibling (match s₁, s₂ with | nil, nil => nil | nil, node a₂ c₂ sibling => node a₂ c₂ nil | node a₁ c₁ sibling, nil => node a₁ c₁ nil | node a₁ c₁ sibling, node a₂ c₂ sibling_1 => if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) nil) ** (split <;> try split) <;> constructor ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α ⊢ NoSibling (match s₁, s₂ with | nil, nil => nil | nil, node a₂ c₂ sibling => node a₂ c₂ nil | node a₁ c₁ sibling, nil => node a₁ c₁ nil | node a₁ c₁ sibling, node a₂ c₂ sibling_1 => if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) nil) ** split <;> try split ** case h_4 α : Type u_1 le : α → α → Bool x✝¹ x✝ : Heap α a₁✝ : α c₁✝ sibling✝¹ : Heap α a₂✝ : α c₂✝ sibling✝ : Heap α ⊢ NoSibling (if le a₁✝ a₂✝ = true then node a₁✝ (node a₂✝ c₂✝ c₁✝) nil else node a₂✝ (node a₁✝ c₁✝ c₂✝) nil) ** split ** Qed |
|
Std.PairingHeapImp.Heap.noSibling_combine ** α : Type u_1 le : α → α → Bool s : Heap α ⊢ NoSibling (combine le s) ** unfold combine ** α : Type u_1 le : α → α → Bool s : Heap α ⊢ NoSibling (match s with | h₁@h_1:(node a child h₂@h:(node a_1 child_1 s)) => merge le (merge le h₁ h₂) (combine le s) | h => h) ** split ** case h_1 α : Type u_1 le : α → α → Bool x✝ : Heap α a✝¹ : α child✝¹ : Heap α a✝ : α child✝ s✝ : Heap α ⊢ NoSibling (merge le (merge le (node a✝¹ child✝¹ (node a✝ child✝ s✝)) (node a✝ child✝ s✝)) (combine le s✝)) ** exact noSibling_merge _ _ _ ** case h_2 α : Type u_1 le : α → α → Bool s x✝¹ : Heap α x✝ : ∀ (a : α) (child : Heap α) (a_1 : α) (child_1 s_1 : Heap α), s = node a child (node a_1 child_1 s_1) → False ⊢ NoSibling s ** match s with
| nil | node _ _ nil => constructor
| node _ _ (node _ _ s) => rename_i h; exact (h _ _ _ _ _ rfl).elim ** α : Type u_1 le : α → α → Bool s x✝¹ : Heap α a✝ : α child✝ : Heap α x✝ : ∀ (a : α) (child : Heap α) (a_1 : α) (child_1 s : Heap α), node a✝ child✝ nil = node a child (node a_1 child_1 s) → False ⊢ NoSibling (node a✝ child✝ nil) ** constructor ** α : Type u_1 le : α → α → Bool s✝ x✝¹ : Heap α a✝¹ : α child✝¹ : Heap α a✝ : α child✝ s : Heap α x✝ : ∀ (a : α) (child : Heap α) (a_1 : α) (child_1 s_1 : Heap α), node a✝¹ child✝¹ (node a✝ child✝ s) = node a child (node a_1 child_1 s_1) → False ⊢ NoSibling (node a✝¹ child✝¹ (node a✝ child✝ s)) ** rename_i h ** α : Type u_1 le : α → α → Bool s✝ x✝ : Heap α a✝¹ : α child✝¹ : Heap α a✝ : α child✝ s : Heap α h : ∀ (a : α) (child : Heap α) (a_1 : α) (child_1 s_1 : Heap α), node a✝¹ child✝¹ (node a✝ child✝ s) = node a child (node a_1 child_1 s_1) → False ⊢ NoSibling (node a✝¹ child✝¹ (node a✝ child✝ s)) ** exact (h _ _ _ _ _ rfl).elim ** Qed |
|
Std.PairingHeapImp.Heap.noSibling_deleteMin ** α : Type u_1 le : α → α → Bool a : α s' s : Heap α eq : deleteMin le s = some (a, s') ⊢ NoSibling s' ** cases s with cases eq | node a c => exact noSibling_combine _ _ ** case node.refl α : Type u_1 le : α → α → Bool a : α c sibling✝ : Heap α ⊢ NoSibling (combine le c) ** exact noSibling_combine _ _ ** Qed |
|
Std.PairingHeapImp.Heap.size_merge_node ** α : Type u_1 le : α → α → Bool a₁ : α c₁ s₁ : Heap α a₂ : α c₂ s₂ : Heap α ⊢ size (merge le (node a₁ c₁ s₁) (node a₂ c₂ s₂)) = size c₁ + size c₂ + 2 ** unfold merge ** α : Type u_1 le : α → α → Bool a₁ : α c₁ s₁ : Heap α a₂ : α c₂ s₂ : Heap α ⊢ size (match node a₁ c₁ s₁, node a₂ c₂ s₂ with | nil, nil => nil | nil, node a₂ c₂ sibling => node a₂ c₂ nil | node a₁ c₁ sibling, nil => node a₁ c₁ nil | node a₁ c₁ sibling, node a₂ c₂ sibling_1 => if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) nil) = size c₁ + size c₂ + 2 ** dsimp ** α : Type u_1 le : α → α → Bool a₁ : α c₁ s₁ : Heap α a₂ : α c₂ s₂ : Heap α ⊢ size (if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) nil) = size c₁ + size c₂ + 2 ** split <;> simp_arith [size] ** Qed |
|
Std.PairingHeapImp.Heap.size_merge ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α h₁ : NoSibling s₁ h₂ : NoSibling s₂ ⊢ size (merge le s₁ s₂) = size s₁ + size s₂ ** match h₁, h₂ with
| .nil, .nil | .nil, .node _ _ | .node _ _, .nil => simp [size]
| .node _ _, .node _ _ => unfold merge; dsimp; split <;> simp_arith [size] ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α h₁ : NoSibling s₁ h₂ : NoSibling s₂ a✝ : α c✝ : Heap α ⊢ size (merge le (node a✝ c✝ nil) nil) = size (node a✝ c✝ nil) + size nil ** simp [size] ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α h₁ : NoSibling s₁ h₂ : NoSibling s₂ a✝¹ : α c✝¹ : Heap α a✝ : α c✝ : Heap α ⊢ size (merge le (node a✝¹ c✝¹ nil) (node a✝ c✝ nil)) = size (node a✝¹ c✝¹ nil) + size (node a✝ c✝ nil) ** unfold merge ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α h₁ : NoSibling s₁ h₂ : NoSibling s₂ a✝¹ : α c✝¹ : Heap α a✝ : α c✝ : Heap α ⊢ size (match node a✝¹ c✝¹ nil, node a✝ c✝ nil with | nil, nil => nil | nil, node a₂ c₂ sibling => node a₂ c₂ nil | node a₁ c₁ sibling, nil => node a₁ c₁ nil | node a₁ c₁ sibling, node a₂ c₂ sibling_1 => if le a₁ a₂ = true then node a₁ (node a₂ c₂ c₁) nil else node a₂ (node a₁ c₁ c₂) nil) = size (node a✝¹ c✝¹ nil) + size (node a✝ c✝ nil) ** dsimp ** α : Type u_1 le : α → α → Bool s₁ s₂ : Heap α h₁ : NoSibling s₁ h₂ : NoSibling s₂ a✝¹ : α c✝¹ : Heap α a✝ : α c✝ : Heap α ⊢ size (if le a✝¹ a✝ = true then node a✝¹ (node a✝ c✝ c✝¹) nil else node a✝ (node a✝¹ c✝¹ c✝) nil) = size (node a✝¹ c✝¹ nil) + size (node a✝ c✝ nil) ** split <;> simp_arith [size] ** Qed |
|
Std.PairingHeapImp.Heap.size_deleteMin_lt ** α : Type u_1 le : α → α → Bool a : α s' s : Heap α eq : deleteMin le s = some (a, s') ⊢ size s' < size s ** cases s with cases eq | node a c => simp_arith [size_combine, size] ** case node.refl α : Type u_1 le : α → α → Bool a : α c sibling✝ : Heap α ⊢ size (combine le c) < size (node a c sibling✝) ** simp_arith [size_combine, size] ** Qed |
|
Std.PairingHeapImp.Heap.WF.merge_node ** α✝ : Type u_1 le : α✝ → α✝ → Bool a₁ : α✝ c₁ : Heap α✝ a₂ : α✝ c₂ s₁ s₂ : Heap α✝ h₁ : NodeWF le a₁ c₁ h₂ : NodeWF le a₂ c₂ ⊢ WF le (merge le (Heap.node a₁ c₁ s₁) (Heap.node a₂ c₂ s₂)) ** unfold merge ** α✝ : Type u_1 le : α✝ → α✝ → Bool a₁ : α✝ c₁ : Heap α✝ a₂ : α✝ c₂ s₁ s₂ : Heap α✝ h₁ : NodeWF le a₁ c₁ h₂ : NodeWF le a₂ c₂ ⊢ WF le (match Heap.node a₁ c₁ s₁, Heap.node a₂ c₂ s₂ with | Heap.nil, Heap.nil => Heap.nil | Heap.nil, Heap.node a₂ c₂ sibling => Heap.node a₂ c₂ Heap.nil | Heap.node a₁ c₁ sibling, Heap.nil => Heap.node a₁ c₁ Heap.nil | Heap.node a₁ c₁ sibling, Heap.node a₂ c₂ sibling_1 => if le a₁ a₂ = true then Heap.node a₁ (Heap.node a₂ c₂ c₁) Heap.nil else Heap.node a₂ (Heap.node a₁ c₁ c₂) Heap.nil) ** dsimp ** α✝ : Type u_1 le : α✝ → α✝ → Bool a₁ : α✝ c₁ : Heap α✝ a₂ : α✝ c₂ s₁ s₂ : Heap α✝ h₁ : NodeWF le a₁ c₁ h₂ : NodeWF le a₂ c₂ ⊢ WF le (if le a₁ a₂ = true then Heap.node a₁ (Heap.node a₂ c₂ c₁) Heap.nil else Heap.node a₂ (Heap.node a₁ c₁ c₂) Heap.nil) ** split <;> rename_i h ** case inl α✝ : Type u_1 le : α✝ → α✝ → Bool a₁ : α✝ c₁ : Heap α✝ a₂ : α✝ c₂ s₁ s₂ : Heap α✝ h₁ : NodeWF le a₁ c₁ h₂ : NodeWF le a₂ c₂ h : le a₁ a₂ = true ⊢ WF le (Heap.node a₁ (Heap.node a₂ c₂ c₁) Heap.nil) ** exact node ⟨fun [_] => h, h₂, h₁⟩ ** case inr α✝ : Type u_1 le : α✝ → α✝ → Bool a₁ : α✝ c₁ : Heap α✝ a₂ : α✝ c₂ s₁ s₂ : Heap α✝ h₁ : NodeWF le a₁ c₁ h₂ : NodeWF le a₂ c₂ h : ¬le a₁ a₂ = true ⊢ WF le (Heap.node a₂ (Heap.node a₁ c₁ c₂) Heap.nil) ** exact node ⟨fun [_] => TotalBLE.total.resolve_left h, h₁, h₂⟩ ** Qed |
|
Std.PairingHeapImp.Heap.WF.tail? ** α : Type u_1 s : Heap α le : α → α → Bool tl : Heap α hwf : WF le s ⊢ Heap.tail? le s = some tl → WF le tl ** simp only [Heap.tail?] ** α : Type u_1 s : Heap α le : α → α → Bool tl : Heap α hwf : WF le s ⊢ Option.map (fun x => x.snd) (Heap.deleteMin le s) = some tl → WF le tl ** intro eq ** α : Type u_1 s : Heap α le : α → α → Bool tl : Heap α hwf : WF le s eq : Option.map (fun x => x.snd) (Heap.deleteMin le s) = some tl ⊢ WF le tl ** match eq₂ : s.deleteMin le, eq with
| some (a, tl), rfl => exact hwf.deleteMin eq₂ ** α : Type u_1 s : Heap α le : α → α → Bool tl✝ : Heap α hwf : WF le s eq : Option.map (fun x => x.snd) (Heap.deleteMin le s) = some tl✝ a : α tl : Heap α eq₂ : Heap.deleteMin le s = some (a, tl) ⊢ WF le ((fun x => x.snd) (a, tl)) ** exact hwf.deleteMin eq₂ ** Qed |
|
Std.PairingHeapImp.Heap.WF.tail ** α : Type u_1 s : Heap α le : α → α → Bool hwf : WF le s ⊢ WF le (Heap.tail le s) ** simp only [Heap.tail] ** α : Type u_1 s : Heap α le : α → α → Bool hwf : WF le s ⊢ WF le (Option.getD (Heap.tail? le s) Heap.nil) ** match eq : s.tail? le with
| none => exact Heap.WF.nil
| some tl => exact hwf.tail? eq ** α : Type u_1 s : Heap α le : α → α → Bool hwf : WF le s eq : Heap.tail? le s = none ⊢ WF le (Option.getD none Heap.nil) ** exact Heap.WF.nil ** α : Type u_1 s : Heap α le : α → α → Bool hwf : WF le s tl : Heap α eq : Heap.tail? le s = some tl ⊢ WF le (Option.getD (some tl) Heap.nil) ** exact hwf.tail? eq ** Qed |
|
Option.getD_of_ne_none ** α : Type u_1 x : Option α hx : x ≠ none y : α ⊢ some (getD x y) = x ** cases x ** case none α : Type u_1 y : α hx : none ≠ none ⊢ some (getD none y) = none case some α : Type u_1 y val✝ : α hx : some val✝ ≠ none ⊢ some (getD (some val✝) y) = some val✝ ** {contradiction} ** case some α : Type u_1 y val✝ : α hx : some val✝ ≠ none ⊢ some (getD (some val✝) y) = some val✝ ** rw [getD_some] ** Qed |
|
Option.eq_none_iff_forall_not_mem ** α✝ : Type u_1 o : Option α✝ e : o = none a : α✝ h : a ∈ o ⊢ False ** rw [e] at h ** α✝ : Type u_1 o : Option α✝ e : o = none a : α✝ h : a ∈ none ⊢ False ** (cases h) ** α✝ : Type u_1 o : Option α✝ e : o = none a : α✝ h : a ∈ none ⊢ False ** cases h ** α✝ : Type u_1 o : Option α✝ h : ∀ (a : α✝), ¬a ∈ o ⊢ ∀ (a : α✝), a ∈ o ↔ a ∈ none ** simp ** α✝ : Type u_1 o : Option α✝ h : ∀ (a : α✝), ¬a ∈ o ⊢ ∀ (a : α✝), ¬o = some a ** exact h ** Qed |
|
Option.isSome_iff_exists ** α✝ : Type u_1 x : Option α✝ ⊢ isSome x = true ↔ ∃ a, x = some a ** cases x <;> simp [isSome] ** Qed |
|
Option.not_isSome ** α✝ : Type u_1 a : Option α✝ ⊢ isSome a = false ↔ isNone a = true ** cases a <;> simp ** Qed |
|
Option.eq_some_iff_get_eq ** α✝ : Type u_1 o : Option α✝ a : α✝ ⊢ o = some a ↔ ∃ h, get o h = a ** cases o <;> simp ** case none α✝ : Type u_1 a : α✝ ⊢ ∀ (x : false = true), ¬get none x = a ** intro. ** Qed |
|
Option.not_isSome_iff_eq_none ** α✝ : Type u_1 o : Option α✝ ⊢ ¬isSome o = true ↔ o = none ** cases o <;> simp ** Qed |
|
Option.ne_none_iff_isSome ** α✝ : Type u_1 o : Option α✝ ⊢ o ≠ none ↔ isSome o = true ** cases o <;> simp ** Qed |
|
Option.ne_none_iff_exists ** α✝ : Type u_1 o : Option α✝ ⊢ o ≠ none ↔ ∃ x, some x = o ** cases o <;> simp ** Qed |
|
Option.bex_ne_none ** α : Type u_1 p : Option α → Prop x✝ : ∃ x x_1, p x x : Option α hx : x ≠ none hp : p x ⊢ p (some (get x (_ : isSome x = true))) ** rwa [some_get] ** Qed |
|
Option.ball_ne_none ** α : Type u_1 p : Option α → Prop h : ∀ (x : α), p (some x) x : Option α hx : x ≠ none ⊢ p x ** have := h <| x.get <| ne_none_iff_isSome.1 hx ** α : Type u_1 p : Option α → Prop h : ∀ (x : α), p (some x) x : Option α hx : x ≠ none this : p (some (get x (_ : isSome x = true))) ⊢ p x ** simp [some_get] at this ⊢ ** α : Type u_1 p : Option α → Prop h : ∀ (x : α), p (some x) x : Option α hx : x ≠ none this : p x ⊢ p x ** exact this ** Qed |
|
Option.bind_some ** α : Type u_1 x : Option α ⊢ Option.bind x some = x ** cases x <;> rfl ** Qed |
|
Option.bind_eq_some ** α✝¹ : Type u_1 b : α✝¹ α✝ : Type u_2 x : Option α✝ f : α✝ → Option α✝¹ ⊢ Option.bind x f = some b ↔ ∃ a, x = some a ∧ f a = some b ** cases x <;> simp ** Qed |
|
Option.bind_eq_none ** α : Type u_1 β : Type u_2 o : Option α f : α → Option β ⊢ Option.bind o f = none ↔ ∀ (b : β) (a : α), a ∈ o → ¬b ∈ f a ** simp only [eq_none_iff_forall_not_mem, not_exists, not_and, mem_def, bind_eq_some] ** Qed |
|
Option.bind_comm ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β → Option γ a : Option α b : Option β ⊢ (Option.bind a fun x => Option.bind b (f x)) = Option.bind b fun y => Option.bind a fun x => f x y ** cases a <;> cases b <;> rfl ** Qed |
|
Option.bind_assoc ** α : Type u_1 β : Type u_2 γ : Type u_3 x : Option α f : α → Option β g : β → Option γ ⊢ Option.bind (Option.bind x f) g = Option.bind x fun y => Option.bind (f y) g ** cases x <;> rfl ** Qed |
|
Option.join_eq_some ** α✝ : Type u_1 a : α✝ x : Option (Option α✝) ⊢ join x = some a ↔ x = some (some a) ** simp ** Qed |
|
Option.join_ne_none ** α✝ : Type u_1 x : Option (Option α✝) ⊢ join x ≠ none ↔ ∃ z, x = some (some z) ** simp only [ne_none_iff_exists', join_eq_some, iff_self] ** Qed |
|
Option.join_eq_none ** α✝ : Type u_1 o : Option (Option α✝) val✝ : α✝ ⊢ join (some (some val✝)) = none ↔ some (some val✝) = none ∨ some (some val✝) = some none ** simp ** Qed |
|
Option.map_eq_some' ** α✝¹ : Type u_1 b : α✝¹ α✝ : Type u_2 x : Option α✝ f : α✝ → α✝¹ ⊢ Option.map f x = some b ↔ ∃ a, x = some a ∧ f a = b ** cases x <;> simp ** Qed |
|
Option.map_eq_none' ** α✝¹ : Type u_1 x : Option α✝¹ α✝ : Type u_2 f : α✝¹ → α✝ ⊢ Option.map f x = none ↔ x = none ** cases x <;> simp only [map_none', map_some', eq_self_iff_true] ** Qed |
|
Option.map_eq_bind ** α : Type u_1 α✝ : Type u_2 f : α → α✝ x : Option α ⊢ Option.map f x = Option.bind x (some ∘ f) ** cases x <;> simp [Option.bind] ** Qed |
|
Option.map_congr ** α : Type u_1 α✝ : Type u_2 f g : α → α✝ x : Option α h : ∀ (a : α), a ∈ x → f a = g a ⊢ Option.map f x = Option.map g x ** cases x <;> simp only [map_none', map_some', h, mem_def] ** Qed |
|
Option.map_comp_map ** α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β g : β → γ ⊢ Option.map g ∘ Option.map f = Option.map (g ∘ f) ** funext x ** case h α : Type u_1 β : Type u_2 γ : Type u_3 f : α → β g : β → γ x : Option α ⊢ (Option.map g ∘ Option.map f) x = Option.map (g ∘ f) x ** simp ** Qed |
|
Option.bind_map_comm ** α : Type u_1 β : Type u_2 x : Option (Option α) f : α → β ⊢ Option.bind x (Option.map f) = Option.bind (Option.map (Option.map f) x) id ** cases x <;> simp ** Qed |
|
Option.join_map_eq_map_join ** α : Type u_1 β : Type u_2 f : α → β x : Option (Option α) ⊢ join (Option.map (Option.map f) x) = Option.map f (join x) ** cases x <;> simp ** Qed |
|
Option.join_join ** α : Type u_1 x : Option (Option (Option α)) ⊢ join (join x) = join (Option.map join x) ** cases x <;> simp ** Qed |
|
Option.orElse_none ** α : Type u_1 x : Option α ⊢ (HOrElse.hOrElse x fun x => none) = x ** cases x <;> rfl ** Qed |
|
Option.map_orElse ** α : Type u_1 α✝ : Type u_2 f : α → α✝ x y : Option α ⊢ Option.map f (HOrElse.hOrElse x fun x => y) = HOrElse.hOrElse (Option.map f x) fun x => Option.map f y ** cases x <;> simp ** Qed |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
- Downloads last month
- 19