Dataset Viewer
Auto-converted to Parquet Duplicate
type
stringlengths
1
123k
tactic
stringlengths
1
8.8k
removals
listlengths
0
28
name
stringlengths
1
85
kind
stringclasses
2 values
goal
stringlengths
7
160k
∀ (val : ℕ) (property : 0 < val), (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property - b) : ℕ) = (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property) : ℕ) - 1 - (↑b : ℕ) + 1
cases a
[ "a" ]
mk
goal
a b : ℕ+ ⊢ (↑(a - b) : ℕ) = (↑a : ℕ) - 1 - (↑b : ℕ) + 1
∀ (val_1 : ℕ) (property_1 : 0 < val_1), (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property - Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val_1 property_1) : ℕ) = (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property) : ℕ) - 1 - (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val_1 property_1) : ℕ) + 1
cases b
[ "b" ]
mk
goal
b : ℕ+ val : ℕ property : 0 < val ⊢ (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property - b) : ℕ) = (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property) : ℕ) - 1 - (↑b : ℕ) + 1
(if val_1 < val then val - val_1 else 1) = val - 1 - val_1 + 1
simp only [PNat.mk_coe, _root_.PNat.sub_coe, ← _root_.PNat.coe_lt_coe]
[]
mk
goal
val : ℕ property : 0 < val val_1 : ℕ property_1 : 0 < val_1 ⊢ (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property - Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val_1 property_1) : ℕ) = (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val property) : ℕ) - 1 - (↑(Subtype.mk (p := fun (n : ℕ) ↦ 0 < n) val_1 property_1) : ...
val_1 < val → val - val_1 = val - 1 - val_1 + 1
split_ifs
[]
pos
goal
val : ℕ property : 0 < val val_1 : ℕ property_1 : 0 < val_1 ⊢ (if val_1 < val then val - val_1 else 1) = val - 1 - val_1 + 1
¬val_1 < val → 1 = val - 1 - val_1 + 1
split_ifs
[]
neg
goal
val : ℕ property : 0 < val val_1 : ℕ property_1 : 0 < val_1 pos : val_1 < val → val - val_1 = val - 1 - val_1 + 1 ⊢ (if val_1 < val then val - val_1 else 1) = val - 1 - val_1 + 1
a = a' ∧ b = b' → p
rwa [Nat.pair_eq_pair, and_imp]
[]
rwa
goal
p : Prop a b a' b' : ℕ h : a = a' → b = b' → p ⊢ Nat.pair a b = Nat.pair a' b' → p
(f + g).coeff n = f.coeff n + g.coeff n
subst ‹_› ‹_›
[ "a", "b", "h_add_left", "h_add_right" ]
subst
goal
R : Type u_1 inst : Semiring R n : ℕ a b : R f g : R[X] h_add_left : f.coeff n = a h_add_right : g.coeff n = b ⊢ (f + g).coeff n = a + b
∀ (h : d = df + dg), (f * g).coeff d = a * b
split_ifs with h
[]
pos
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d ⊢ (f * g).coeff d = if d = df + dg then a * b else 0
∀ (h : ¬d = df + dg), (f * g).coeff d = 0
split_ifs with h
[]
neg
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d pos : ∀ (h : d = df + dg), (f * g).coeff d = a * b ⊢ (f * g).coeff d = if d = df + dg then a * b else 0
∀ (ddf : df + dg ≤ df + dg), (f * g).coeff (df + dg) = f.coeff df * g.coeff dg
subst h_mul_left h_mul_right h
[ "d", "a", "b", "h_mul_left", "h_mul_right", "ddf", "h" ]
pos
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d h : d = df + dg ⊢ (f * g).coeff d = a * b
(f * g).natDegree < d
apply coeff_eq_zero_of_natDegree_lt
[]
neg
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d h : ¬d = df + dg ⊢ (f * g).coeff d = 0
(f * g).natDegree ≤ df + dg
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ddf ?_)
[]
apply
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d h : ¬d = df + dg ⊢ (f * g).natDegree < d
df + dg ≠ d
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ddf ?_)
[]
apply₁
goal
R : Type u_1 inst : Semiring R d df dg : ℕ a b : R f g : R[X] h_mul_left_1 : f.natDegree ≤ df h_mul_right_1 : g.natDegree ≤ dg h_mul_left : f.coeff df = a h_mul_right : g.coeff dg = b ddf : df + dg ≤ d h : ¬d = df + dg apply : (f * g).natDegree ≤ df + dg ⊢ (f * g).natDegree < d
∀ (h : o = m * n), (p ^ m).coeff o = a ^ m
split_ifs with h
[]
pos
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a ⊢ (p ^ m).coeff o = if o = m * n then a ^ m else 0
∀ (h : ¬o = m * n), (p ^ m).coeff o = 0
split_ifs with h
[]
neg
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a pos : ∀ (h : o = m * n), (p ^ m).coeff o = a ^ m ⊢ (p ^ m).coeff o = if o = m * n then a ^ m else 0
∀ (h_exp : m * n ≤ m * n), (p ^ m).coeff (m * n) = p.coeff n ^ m
subst h h_pow_bas
[ "o", "a", "h_exp", "h_pow_bas", "h" ]
pos
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a h : o = m * n ⊢ (p ^ m).coeff o = a ^ m
(p ^ m).natDegree < o
apply coeff_eq_zero_of_natDegree_lt
[]
neg
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a h : ¬o = m * n ⊢ (p ^ m).coeff o = 0
(p ^ m).natDegree ≤ m * n
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ‹_› ?_)
[]
apply
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a h : ¬o = m * n ⊢ (p ^ m).natDegree < o
m * n ≠ o
apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ‹_› ?_)
[]
apply₁
goal
R : Type u_1 inst : Semiring R m n o : ℕ a : R p : R[X] h_pow : p.natDegree ≤ n h_exp : m * n ≤ o h_pow_bas : p.coeff n = a h : ¬o = m * n apply : (p ^ m).natDegree ≤ m * n ⊢ (p ^ m).natDegree < o
∀ (coeff_ne_zero : p.coeff o ≠ 0) (h_natDeg_le : p.natDegree ≤ o), p.natDegree = o
subst coeff_eq deg_eq_deg coeff_eq_deg
[ "deg", "m", "c", "h_natDeg_le", "coeff_eq", "coeff_ne_zero", "deg_eq_deg", "coeff_eq_deg" ]
subst
goal
R : Type u_1 inst : Semiring R deg m o : ℕ c : R p : R[X] h_natDeg_le : p.natDegree ≤ m coeff_eq : p.coeff o = c coeff_ne_zero : c ≠ 0 deg_eq_deg : m = deg coeff_eq_deg : o = deg ⊢ p.natDegree = deg
∀ (coeff_ne_zero : p.coeff (WithBot.unbotD 0 m) ≠ 0), p.degree = m
subst coeff_eq coeff_eq_deg deg_eq_deg
[ "deg", "o", "c", "coeff_eq", "coeff_ne_zero", "deg_eq_deg", "coeff_eq_deg" ]
subst
goal
R : Type u_1 inst : Semiring R deg m o : WithBot ℕ c : R p : R[X] h_deg_le : p.degree ≤ m coeff_eq : p.coeff (WithBot.unbotD 0 deg) = c coeff_ne_zero : c ≠ 0 deg_eq_deg : m = deg coeff_eq_deg : o = deg ⊢ p.degree = deg
∀ (h_deg_le : p.degree ≤ ⊥) (coeff_ne_zero : p.coeff (WithBot.unbotD 0 ⊥) ≠ 0), p.degree = ⊥
rcases eq_or_ne m ⊥ with rfl | hh
[ "m", "h_deg_le", "coeff_ne_zero" ]
inl
goal
R : Type u_1 inst : Semiring R m : WithBot ℕ p : R[X] h_deg_le : p.degree ≤ m coeff_ne_zero : p.coeff (WithBot.unbotD 0 m) ≠ 0 ⊢ p.degree = m
∀ (hh : m ≠ ⊥), p.degree = m
rcases eq_or_ne m ⊥ with rfl | hh
[]
inr
goal
R : Type u_1 inst : Semiring R m : WithBot ℕ p : R[X] h_deg_le : p.degree ≤ m coeff_ne_zero : p.coeff (WithBot.unbotD 0 m) ≠ 0 inl : ∀ (h_deg_le : p.degree ≤ ⊥) (coeff_ne_zero : p.coeff (WithBot.unbotD 0 ⊥) ≠ 0), p.degree = ⊥ ⊢ p.degree = m
∀ (m : ℕ) (h_deg_le : p.degree ≤ (↑m : WithBot ℕ)) (coeff_ne_zero : p.coeff (WithBot.unbotD 0 (↑m : WithBot ℕ)) ≠ 0) (hh : (↑m : WithBot ℕ) ≠ ⊥), p.degree = (↑m : WithBot ℕ)
obtain ⟨m, rfl⟩ := WithBot.ne_bot_iff_exists.mp hh
[ "m", "h_deg_le", "coeff_ne_zero", "hh" ]
inr
goal
R : Type u_1 inst : Semiring R m : WithBot ℕ p : R[X] h_deg_le : p.degree ≤ m coeff_ne_zero : p.coeff (WithBot.unbotD 0 m) ≠ 0 hh : m ≠ ⊥ ⊢ p.degree = m
(f - g).coeff n = f.coeff n - g.coeff n
subst hf hg
[ "a", "b", "hf", "hg" ]
subst
goal
R : Type u_1 inst : Ring R n : ℕ a b : R f g : R[X] hf : f.coeff n = a hg : g.coeff n = b ⊢ (f - g).coeff n = a - b
LT.lt (α := ℤ) 0 (↑n : ℤ)
have := natCast_pos.2 <| Nat.le_of_ble_eq_true hn
[]
this
hypothesis
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p ⊢ 0 ≤ (a % (↑n : ℤ)).toNat ∧ (a % (↑n : ℤ)).toNat < n ∧ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
0 ≤ a % (↑n : ℤ)
have nonneg := emod_nonneg a <| Int.ne_of_gt this
[]
nonneg
hypothesis
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) ⊢ 0 ≤ (a % (↑n : ℤ)).toNat ∧ (a % (↑n : ℤ)).toNat < n ∧ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
(a % (↑n : ℤ)).toNat < n
refine ⟨Nat.zero_le _, ?_, ?_⟩
[]
refine_1
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) ⊢ 0 ≤ (a % (↑n : ℤ)).toNat ∧ (a % (↑n : ℤ)).toNat < n ∧ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
refine ⟨Nat.zero_le _, ?_, ?_⟩
[]
refine_2
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) refine_1 : (a % (↑n : ℤ)).toNat < n ⊢ 0 ≤ (a % (↑n : ℤ)).toNat ∧ (a % (↑n : ℤ)).toNat < n ∧ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
a % (↑n : ℤ) < (↑n : ℤ)
rw [Int.toNat_lt nonneg]
[]
refine_1
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) ⊢ (a % (↑n : ℤ)).toNat < n
a % (↑n : ℤ) = HMod.hMod (α := ℤ) (↑(a % (↑n : ℤ)).toNat : ℤ) (↑n : ℤ)
rw [Int.ModEq, Int.toNat_of_nonneg nonneg, emod_emod]
[]
refine_2
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) ⊢ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
a % (↑n : ℤ) = a % (↑n : ℤ) % (↑n : ℤ)
rw [Int.ModEq, Int.toNat_of_nonneg nonneg, emod_emod]
[]
refine_2₁
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) refine_2 : a % (↑n : ℤ) = HMod.hMod (α := ℤ) (↑(a % (↑n : ℤ)).toNat : ℤ) (↑n : ℤ) ⊢ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
a % (↑n : ℤ) = a % (↑n : ℤ)
rw [Int.ModEq, Int.toNat_of_nonneg nonneg, emod_emod]
[]
refine_2₂
goal
p : Sort u_1 a : ℤ n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p this : LT.lt (α := ℤ) 0 (↑n : ℤ) nonneg : 0 ≤ a % (↑n : ℤ) refine_2 : a % (↑n : ℤ) = HMod.hMod (α := ℤ) (↑(a % (↑n : ℤ)).toNat : ℤ) (↑n : ℤ) refine_2₁ : a % (↑n : ℤ) = a % (↑n : ℤ) % (↑n : ℤ) ⊢ a ≡ (↑(a % (↑n : ℤ)).toNat : ℤ) [ZMOD (↑n : ℤ)]
a % n < n
refine ⟨Nat.zero_le _, ?_, ?_⟩
[]
refine_1
goal
p : Sort u_1 a n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p ⊢ 0 ≤ a % n ∧ a % n < n ∧ a ≡ a % n [MOD n]
a ≡ a % n [MOD n]
refine ⟨Nat.zero_le _, ?_, ?_⟩
[]
refine_2
goal
p : Sort u_1 a n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p refine_1 : a % n < n ⊢ 0 ≤ a % n ∧ a % n < n ∧ a ≡ a % n [MOD n]
a % n = a % n % n
rw [Nat.ModEq, Nat.mod_mod]
[]
refine_2
goal
p : Sort u_1 a n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p ⊢ a ≡ a % n [MOD n]
a % n = a % n
rw [Nat.ModEq, Nat.mod_mod]
[]
refine_2₁
goal
p : Sort u_1 a n : ℕ hn : Nat.ble 1 n = true H : OnModCases n a 0 p refine_2 : a % n = a % n % n ⊢ a ≡ a % n [MOD n]
∀ (x : β) (hx : condβα (coeβα x, y).fst) (hy : condδγ (coeβα x, y).snd), ∃ (y_1 : β × δ), map coeβα coeδγ y_1 = (coeβα x, y)
rcases CanLift.prf (β := β) x hx with ⟨x, rfl⟩
[ "x", "hx", "hy" ]
rcases
goal
α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 coeβα : β → α condβα : α → Prop coeδγ : δ → γ condδγ : γ → Prop inst : CanLift α β coeβα condβα inst_1 : CanLift γ δ coeδγ condδγ x : α y : γ hx : condβα (x, y).fst hy : condδγ (x, y).snd ⊢ ∃ (y_1 : β × δ), map coeβα coeδγ y_1 = (x, y)
∀ (y : δ) (hx : condβα (coeβα x, coeδγ y).fst) (hy : condδγ (coeβα x, coeδγ y).snd), ∃ (y_1 : β × δ), map coeβα coeδγ y_1 = (coeβα x, coeδγ y)
rcases CanLift.prf (β := δ) y hy with ⟨y, rfl⟩
[ "y", "hx", "hy" ]
rcases
goal
α : Type u_1 β : Type u_2 γ : Type u_3 δ : Type u_4 coeβα : β → α condβα : α → Prop coeδγ : δ → γ condδγ : γ → Prop inst : CanLift α β coeβα condβα inst_1 : CanLift γ δ coeδγ condδγ y : γ x : β hx : condβα (coeβα x, y).fst hy : condδγ (coeβα x, y).snd ⊢ ∃ (y_1 : β × δ), map coeβα coeδγ y_1 = (coeβα x, y)
∀ (this : DecidablePred p), ∃ (g : (i : ι) → α i), (fun (i : Subtype p) ↦ g (i.val (p := p))) = f
haveI : DecidablePred p := fun i ↦ Classical.propDecidable (p i)
[]
haveI
goal
ι : Sort u_1 α : ι → Sort u_2 ne : ∀ (i : ι), Nonempty.{u_2} (α i) p : ι → Prop f : (i : Subtype p) → α (i.val (p := p)) ⊢ ∃ (g : (i : ι) → α i), (fun (i : Subtype p) ↦ g (i.val (p := p))) = f
¬LT.lt (α := ℕ∞) ⊤ ⊤
cases x
[ "x" ]
top
goal
x : ℕ∞ ⊢ ¬⊤ < x
∀ (a : ℕ), ¬LT.lt (α := ℕ∞) ⊤ (↑a : ℕ∞)
cases x
[ "x" ]
coe
goal
x : ℕ∞ top : ¬LT.lt (α := ℕ∞) ⊤ ⊤ ⊢ ¬⊤ < x
∀ (h : ¬r), r → p → r ∧ q
tauto
[ "h" ]
inl
goal
p q r : Prop h : r → p → q ⊢ r ∧ p → r ∧ q
∀ (h : p → q), r → p → r ∧ q
tauto
[ "h" ]
inr
goal
p q r : Prop h : r → p → q inl : ∀ (h : ¬r), r → p → r ∧ q ⊢ r ∧ p → r ∧ q
∀ (h : p → q), r → p → r
tauto
[ "h" ]
inr₂
goal
p q r : Prop h : r → p → q inl : ∀ (h : ¬r), r → p → r ∧ q inr inr₁ : ∀ (h : p → q), r → p → r ∧ q ⊢ r ∧ p → r ∧ q
∀ (h : p → q), r → p → q
tauto
[ "h" ]
inr₃
goal
p q r : Prop h : r → p → q inl : ∀ (h : ¬r), r → p → r ∧ q inr inr₁ : ∀ (h : p → q), r → p → r ∧ q inr₂ : ∀ (h : p → q), r → p → r ⊢ r ∧ p → r ∧ q
r → p → ∀ (h : ¬p), q
tauto
[ "h" ]
inr₄
goal
p q r : Prop h : r → p → q inl : ∀ (h : ¬r), r → p → r ∧ q inr inr₁ : ∀ (h : p → q), r → p → r ∧ q inr₂ : ∀ (h : p → q), r → p → r inr₃ : ∀ (h : p → q), r → p → q ⊢ r ∧ p → r ∧ q
r → p → ∀ (h : q), q
tauto
[ "h" ]
inr₅
goal
p q r : Prop h : r → p → q inl : ∀ (h : ¬r), r → p → r ∧ q inr inr₁ : ∀ (h : p → q), r → p → r ∧ q inr₂ : ∀ (h : p → q), r → p → r inr₃ : ∀ (h : p → q), r → p → q inr₄ : r → p → ∀ (h : ¬p), q ⊢ r ∧ p → r ∧ q
∀ (h' : ∀ (a : α), β = β'), Eq (α := Sort (imax u v)) (α → β) (α → β')
cases h
[ "α'", "h", "h'" ]
refl
goal
α α' : Sort u β β' : Sort v h : α = α' h' : ∀ (a : α'), β = β' ⊢ Eq (α := Sort (imax u v)) (α → β) (α' → β')
Eq (α := Sort (imax u v)) ((x : α) → (fun (x : α) ↦ β') x) (α → β')
rw [funext h']
[]
refl
goal
α : Sort u β β' : Sort v h' : ∀ (a : α), β = β' ⊢ Eq (α := Sort (imax u v)) ((x : α) → (fun (x : α) ↦ β) x) (α → β')
∀ {p : x ≍ x → Prop} (h : ∀ (he : x = x), p sorry), p sorry
cases he
[ "y", "p", "h", "he" ]
refl
goal
α : Sort u_1 x y : α p : x ≍ y → Prop h : ∀ (he : x = y), p ⋯ he : x ≍ y ⊢ p he
∀ {p : x = x → Prop} (h : ∀ (he : x ↔ x), p sorry), p sorry
cases he
[ "y", "p", "h", "he" ]
refl
goal
x y : Prop p : x = y → Prop h : ∀ (he : x ↔ y), p ⋯ he : x = y ⊢ p he
Nat → Ordering
cases p
[ "p" ]
var
goal
p q : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases p
[ "p" ]
and'
goal
p q : IProp var : Nat → Ordering true false : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
var
goal
q : IProp a : Nat ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
var₃
goal
q : IProp a : Nat var : Nat → Ordering var₁ var₂ : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
true
goal
q : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
true₂
goal
q : IProp true : Nat → Ordering cases true₁ : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
false
goal
q : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
false₂
goal
q : IProp false : Nat → Ordering false₁ cases : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
and'
goal
q : IProp a : AndKind a_1 a_2 : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
and'₃
goal
q : IProp a : AndKind a_1 a_2 : IProp and' : Nat → Ordering and'₁ and'₂ : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
or
goal
q a a_1 : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
or₃
goal
q a a_1 : IProp or : Nat → Ordering or₁ or₂ : Ordering ⊢ Ordering
Nat → Ordering
cases q
[ "q" ]
imp
goal
q a a_1 : IProp ⊢ Ordering
AndKind → IProp → IProp → Ordering
cases q
[ "q" ]
imp₃
goal
q a a_1 : IProp imp : Nat → Ordering imp₁ imp₂ : Ordering ⊢ Ordering
NF.eval [] * zpow' («$r», «$x»).2 («$r», «$x»).1 = «$e»
rw [NF.eval_cons]
[]
rw
goal
«$v» : Level «$M» : Type v «$iM» : CommGroupWithZero «$M» «$r» : ℤ «$x» : «$M» «$snd» : ℕ «$e» : «$M» «$pf» : zpow' «$x» «$r» = «$e» ⊢ ((«$r», «$x») ::ᵣ []).eval = «$e»
¬p ∧ q ∨ p ∧ ¬q ↔ p ∧ ¬q ∨ ¬p ∧ q
rw [not_not, or_comm]
[]
rw
goal
p q : Prop ⊢ ¬p ∧ q ∨ ¬¬p ∧ ¬q ↔ p ∧ ¬q ∨ ¬p ∧ q
p ∧ ¬q ∨ ¬p ∧ q ↔ p ∧ ¬q ∨ ¬p ∧ q
rw [not_not, or_comm]
[]
rw₁
goal
p q : Prop rw : ¬p ∧ q ∨ p ∧ ¬q ↔ p ∧ ¬q ∨ ¬p ∧ q ⊢ ¬p ∧ q ∨ ¬¬p ∧ ¬q ↔ p ∧ ¬q ∨ ¬p ∧ q
∀ (a b : ℕ) (h : (Nat.unpair ((Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b))).1 ≠ 0), (Nat.unpair ((Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b))).2 < (Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b)
obtain ⟨⟨a, b⟩, rfl⟩ := Nat.pairEquiv.surjective n
[ "n", "h" ]
obtain
goal
n : ℕ h : (Nat.unpair n).1 ≠ 0 ⊢ (Nat.unpair n).2 < n
∀ (h : a ≠ 0), b < Nat.pair a b
simp only [Nat.pairEquiv_apply, Function.uncurry_apply_pair, Nat.unpair_pair] at *
[ "h" ]
simp
goal
a b : ℕ h : (Nat.unpair ((Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b))).1 ≠ 0 ⊢ (Nat.unpair ((Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b))).2 < (Nat.pairEquiv : (a : ℕ × ℕ) → ℕ) (a, b)
a ≤ a * a
have := Nat.le_mul_self a
[]
this
hypothesis
a b : ℕ h : a ≠ 0 ⊢ b < if a < b then b * b + a else a * a + a + b
b ≤ b * b
have := Nat.le_mul_self b
[]
this₁
hypothesis
a b : ℕ h : a ≠ 0 this : a ≤ a * a ⊢ b < if a < b then b * b + a else a * a + a + b
a < b → b < b * b + a
split
[]
isTrue
goal
a b : ℕ h : a ≠ 0 this_1 : a ≤ a * a this : b ≤ b * b ⊢ b < if a < b then b * b + a else a * a + a + b
¬a < b → b < a * a + a + b
split
[]
isFalse
goal
a b : ℕ h : a ≠ 0 this_1 : a ≤ a * a this : b ≤ b * b isTrue : a < b → b < b * b + a ⊢ b < if a < b then b * b + a else a * a + a + b
(let p := Nat.unpair (Nat.pair 0 n); if h : p.1 = 0 then S.nat p.2 else have this : p.1 ≤ Nat.pair 0 n := sorry; have this := sorry; have this := sorry; (S.decode (p.1 - 1)).cons (S.decode p.2)) = S.nat n
unfold S.encode S.decode
[]
nat
goal
n : ℕ ⊢ S.decode (S.nat n).encode = S.nat n
(let p := Nat.unpair (Nat.pair (a.encode + 1) b.encode); if h : p.1 = 0 then S.nat p.2 else have this : p.1 ≤ Nat.pair (a.encode + 1) b.encode := sorry; have this := sorry; have this := sorry; (S.decode (p.1 - 1)).cons (S.decode p.2)) = a.cons b
unfold S.encode S.decode
[]
cons
goal
a b : S iha : S.decode a.encode = a ihb : S.decode b.encode = b ⊢ S.decode (a.cons b).encode = a.cons b
∀ (n : ℕ), S.decode (S.nat n).encode = S.nat n
induction s with | nat n => unfold S.encode S.decode simp | cons a b iha ihb => unfold S.encode S.decode simp [iha, ihb]
[ "s" ]
nat
goal
s : S ⊢ S.decode s.encode = s
∀ (a b : S) (iha : S.decode a.encode = a) (ihb : S.decode b.encode = b), S.decode (a.cons b).encode = a.cons b
induction s with | nat n => unfold S.encode S.decode simp | cons a b iha ihb => unfold S.encode S.decode simp [iha, ihb]
[ "s" ]
cons
goal
s : S nat : ∀ (n : ℕ), S.decode (S.nat n).encode = S.nat n ⊢ S.decode s.encode = s
S.encode (let p := Nat.unpair n; if h : p.1 = 0 then S.nat p.2 else have this := sorry; have this := sorry; have this := sorry; (S.decode (p.1 - 1)).cons (S.decode p.2)) = n
unfold S.decode
[]
ind
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m ⊢ (S.decode n).encode = n
(Nat.unpair n).1 = 0 → (S.nat (Nat.unpair n).2).encode = n
split
[]
ind
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m ⊢ S.encode (if h : (Nat.unpair n).1 = 0 then S.nat (Nat.unpair n).2 else (S.decode ((Nat.unpair n).1 - 1)).cons (S.decode (Nat.unpair n).2)) = n
¬(Nat.unpair n).1 = 0 → ((S.decode ((Nat.unpair n).1 - 1)).cons (S.decode (Nat.unpair n).2)).encode = n
split
[]
ind₁
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m ind : (Nat.unpair n).1 = 0 → (S.nat (Nat.unpair n).2).encode = n ⊢ S.encode (if h : (Nat.unpair n).1 = 0 then S.nat (Nat.unpair n).2 else (S.decode ((Nat.unpair n).1 - 1)).cons (S.decode (Nat.unpair n).2)) = n
Nat.pair (Nat.unpair n).1 (Nat.unpair n).2 = n
rw [← h, Nat.pair_unpair]
[]
rw
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : (Nat.unpair n).1 = 0 ⊢ Nat.pair 0 (Nat.unpair n).2 = n
n = n
rw [← h, Nat.pair_unpair]
[]
rw₁
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : (Nat.unpair n).1 = 0 rw : Nat.pair (Nat.unpair n).1 (Nat.unpair n).2 = n ⊢ Nat.pair 0 (Nat.unpair n).2 = n
1 ≤ (Nat.unpair n).1
rw [ih, ih, Nat.sub_add_cancel, Nat.pair_unpair]
[]
rw
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 ⊢ Nat.pair ((S.decode ((Nat.unpair n).1 - 1)).encode + 1) (S.decode (Nat.unpair n).2).encode = n
(Nat.unpair n).2 < n
rw [ih, ih, Nat.sub_add_cancel, Nat.pair_unpair]
[]
a
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 rw : 1 ≤ (Nat.unpair n).1 ⊢ Nat.pair ((S.decode ((Nat.unpair n).1 - 1)).encode + 1) (S.decode (Nat.unpair n).2).encode = n
(Nat.unpair n).1 - 1 < n
rw [ih, ih, Nat.sub_add_cancel, Nat.pair_unpair]
[]
a₁
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 rw : 1 ≤ (Nat.unpair n).1 a : (Nat.unpair n).2 < n ⊢ Nat.pair ((S.decode ((Nat.unpair n).1 - 1)).encode + 1) (S.decode (Nat.unpair n).2).encode = n
(Nat.unpair n).1 ≠ 0
rwa [Nat.one_le_iff_ne_zero]
[]
rwa
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 ⊢ 1 ≤ (Nat.unpair n).1
∀ (ih : ∀ m < 0, (S.decode m).encode = m) (h : ¬(Nat.unpair 0).1 = 0), (Nat.unpair 0).1 - 1 < 0
obtain _ | n' := n
[ "n", "ih", "h" ]
a
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 ⊢ (Nat.unpair n).1 - 1 < n
∀ (n' : ℕ) (ih : ∀ m < n' + 1, (S.decode m).encode = m) (h : ¬(Nat.unpair (n' + 1)).1 = 0), (Nat.unpair (n' + 1)).1 - 1 < n' + 1
obtain _ | n' := n
[ "n", "ih", "h" ]
a₁
goal
n : ℕ ih : ∀ m < n, (S.decode m).encode = m h : ¬(Nat.unpair n).1 = 0 a : ∀ (ih : ∀ m < 0, (S.decode m).encode = m) (h : ¬(Nat.unpair 0).1 = 0), (Nat.unpair 0).1 - 1 < 0 ⊢ (Nat.unpair n).1 - 1 < n
(Nat.unpair (n' + 1)).1 < n' + 1
have := Nat.unpair_lt (by lia : 1 ≤ n' + 1)
[]
this
hypothesis
n' : ℕ ih : ∀ m < n' + 1, (S.decode m).encode = m h : ¬(Nat.unpair (n' + 1)).1 = 0 ⊢ (Nat.unpair (n' + 1)).1 - 1 < n' + 1
∀ (n : ℕ) (ih : ∀ m < n, (S.decode m).encode = m), (S.decode n).encode = n
induction n using Nat.strongRecOn with | _ n ih => unfold S.decode dsimp only split next h => unfold S.encode rw [← h, Nat.pair_unpair] next h => unfold S.encode rw [ih, ih, Nat.sub_add_cancel, Nat.pair_unpair] · rwa [Nat.one_le_iff_ne_zero] · exact nat_unpair_lt_...
[ "n" ]
ind
goal
n : ℕ ⊢ (S.decode n).encode = n
r₁ • x + (l₁.eval + (r₂ • x + l₂.eval)) = r₁ • x + (r₂ • x + (l₁.eval + l₂.eval))
simp only [← h, eval_cons, add_smul, add_assoc]
[]
simp
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M r₁ r₂ : R x : M l₁ l₂ l : NF R M h : l₁.eval + l₂.eval = l.eval ⊢ ((r₁, x) ::ᵣ l₁).eval + ((r₂, x) ::ᵣ l₂).eval = ((r₁ + r₂, x) ::ᵣ l).eval
l₁.eval + (r₂ • x + l₂.eval) = r₂ • x + (l₁.eval + l₂.eval)
congr! 1
[]
h₁
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M r₁ r₂ : R x : M l₁ l₂ l : NF R M h : l₁.eval + l₂.eval = l.eval ⊢ r₁ • x + (l₁.eval + (r₂ • x + l₂.eval)) = r₁ • x + (r₂ • x + (l₁.eval + l₂.eval))
l₁.eval + r₂ • x + l₂.eval = r₂ • x + l₁.eval + l₂.eval
simp only [← add_assoc]
[]
h₁
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M r₁ r₂ : R x : M l₁ l₂ l : NF R M h : l₁.eval + l₂.eval = l.eval ⊢ l₁.eval + (r₂ • x + l₂.eval) = r₂ • x + (l₁.eval + l₂.eval)
l₁.eval + r₂ • x = r₂ • x + l₁.eval
congr! 1
[]
h₁
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M r₁ r₂ : R x : M l₁ l₂ l : NF R M h : l₁.eval + l₂.eval = l.eval ⊢ l₁.eval + r₂ • x + l₂.eval = r₂ • x + l₁.eval + l₂.eval
r₂ • x + l₁.eval = r₂ • x + l₁.eval
rw [add_comm]
[]
h₁
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M r₁ r₂ : R x : M l₁ l₂ l : NF R M h : l₁.eval + l₂.eval = l.eval ⊢ l₁.eval + r₂ • x = r₂ • x + l₁.eval
a₁.1 • a₁.2 + l₁.eval + (a₂.1 • a₂.2 + l₂.eval) = a₂.1 • a₂.2 + (a₁.1 • a₁.2 + l₁.eval + l₂.eval)
simp only [eval_cons, ← h]
[]
simp
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M a₁ a₂ : R × M l₁ l₂ l : NF R M h : (a₁ ::ᵣ l₁).eval + l₂.eval = l.eval ⊢ (a₁ ::ᵣ l₁).eval + (a₂ ::ᵣ l₂).eval = (a₂ ::ᵣ l).eval
a₁.1 • a₁.2 + l₁.eval + (a₂.1 • a₂.2 + l₂.eval) = a₁.1 • a₁.2 + l₁.eval + l₂.eval + a₂.1 • a₂.2
nth_rw 4 [add_comm]
[]
nth_rw
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M a₁ a₂ : R × M l₁ l₂ l : NF R M h : (a₁ ::ᵣ l₁).eval + l₂.eval = l.eval ⊢ a₁.1 • a₁.2 + l₁.eval + (a₂.1 • a₂.2 + l₂.eval) = a₂.1 • a₂.2 + (a₁.1 • a₁.2 + l₁.eval + l₂.eval)
a₁.1 • a₁.2 + (l₁.eval + (a₂.1 • a₂.2 + l₂.eval)) = a₁.1 • a₁.2 + (l₁.eval + (l₂.eval + a₂.1 • a₂.2))
simp only [add_assoc]
[]
simp
goal
R : Type u_2 M : Type u_3 inst : Semiring R inst_1 : AddCommMonoid M inst_2 : Module R M a₁ a₂ : R × M l₁ l₂ l : NF R M h : (a₁ ::ᵣ l₁).eval + l₂.eval = l.eval ⊢ a₁.1 • a₁.2 + l₁.eval + (a₂.1 • a₂.2 + l₂.eval) = a₁.1 • a₁.2 + l₁.eval + l₂.eval + a₂.1 • a₂.2
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
277