{"text": "[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na b : ℕ\nh : a ≤ b\n⊢ ↑(choose b a) = ↑b ! / (↑a ! * ↑(b - a)!)\n[PROOFSTEP]\nhave : ∀ {n : ℕ}, (n ! : K) ≠ 0 := Nat.cast_ne_zero.2 (factorial_ne_zero _)\n[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na b : ℕ\nh : a ≤ b\nthis : ∀ {n : ℕ}, ↑n ! ≠ 0\n⊢ ↑(choose b a) = ↑b ! / (↑a ! * ↑(b - a)!)\n[PROOFSTEP]\nrw [eq_div_iff_mul_eq (mul_ne_zero this this)]\n[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na b : ℕ\nh : a ≤ b\nthis : ∀ {n : ℕ}, ↑n ! ≠ 0\n⊢ ↑(choose b a) * (↑a ! * ↑(b - a)!) = ↑b !\n[PROOFSTEP]\nrw_mod_cast [← mul_assoc, choose_mul_factorial_mul_factorial h]\n[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na b : ℕ\n⊢ ↑(choose (a + b) a) = ↑(a + b)! / (↑a ! * ↑b !)\n[PROOFSTEP]\nrw [cast_choose K (_root_.le_add_right le_rfl), add_tsub_cancel_left]\n[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na b : ℕ\n⊢ ↑(choose a b) = Polynomial.eval (↑(a - (b - 1))) (pochhammer K b) / ↑b !\n[PROOFSTEP]\nrw [eq_div_iff_mul_eq (cast_ne_zero.2 b.factorial_ne_zero : (b ! : K) ≠ 0), ← cast_mul, mul_comm, ←\n descFactorial_eq_factorial_mul_choose, ← cast_descFactorial]\n[GOAL]\nK : Type u_1\ninst✝¹ : DivisionRing K\ninst✝ : CharZero K\na : ℕ\n⊢ ↑(choose a 2) = ↑a * (↑a - 1) / 2\n[PROOFSTEP]\nrw [← cast_descFactorial_two, descFactorial_eq_factorial_mul_choose, factorial_two, mul_comm, cast_mul, cast_two,\n eq_div_iff_mul_eq (two_ne_zero : (2 : K) ≠ 0)]\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Choose.Cast", "llama_tokens": 770, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8652240756264639, "lm_q2_score": 0.8080672112416737, "lm_q1q2_score": 0.6991592058906316}} {"text": "[GOAL]\nn : ℕ\n⊢ ↑n = 1 ↔ Odd n\n[PROOFSTEP]\nrw [← @Nat.cast_one (ZMod 2), ZMod.eq_iff_modEq_nat, Nat.odd_iff, Nat.ModEq]\n[GOAL]\nn : ℕ\n⊢ n % 2 = 1 % 2 ↔ n % 2 = 1\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\n⊢ ↑n ≠ 0 ↔ Odd n\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase mp\nn : ℕ\n⊢ ↑n ≠ 0 → Odd n\n[PROOFSTEP]\ncontrapose\n[GOAL]\ncase mp\nn : ℕ\n⊢ ¬Odd n → ¬↑n ≠ 0\n[PROOFSTEP]\nsimp [eq_zero_iff_even]\n[GOAL]\ncase mpr\nn : ℕ\n⊢ Odd n → ↑n ≠ 0\n[PROOFSTEP]\ncontrapose\n[GOAL]\ncase mpr\nn : ℕ\n⊢ ¬↑n ≠ 0 → ¬Odd n\n[PROOFSTEP]\nsimp [eq_zero_iff_even]\n", "meta": {"mathlib_filename": "Mathlib.Data.ZMod.Parity", "llama_tokens": 315, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9184802350995703, "lm_q2_score": 0.7606506418255928, "lm_q1q2_score": 0.6986425803326096}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : DivisionRing α\nn✝ : ℤ\na : α\nn : ℤ\n⊢ (-a) ^ bit1 n = -a ^ bit1 n\n[PROOFSTEP]\nrw [zpow_bit1', zpow_bit1', neg_mul_neg, neg_mul_eq_mul_neg]\n[GOAL]\nα : Type u_1\ninst✝ : DivisionRing α\nn : ℤ\nh : Odd n\na : α\n⊢ (-a) ^ n = -a ^ n\n[PROOFSTEP]\nobtain ⟨k, rfl⟩ := h.exists_bit1\n[GOAL]\ncase intro\nα : Type u_1\ninst✝ : DivisionRing α\na : α\nk : ℤ\nh : Odd (bit1 k)\n⊢ (-a) ^ bit1 k = -a ^ bit1 k\n[PROOFSTEP]\nexact zpow_bit1_neg _ _\n[GOAL]\nα : Type u_1\ninst✝ : DivisionRing α\nn : ℤ\nh : Odd n\n⊢ (-1) ^ n = -1\n[PROOFSTEP]\nrw [h.neg_zpow, one_zpow]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Field.Power", "llama_tokens": 310, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9196425355825848, "lm_q2_score": 0.7577943712746406, "lm_q1q2_score": 0.6968999370492212}} {"text": "[GOAL]\nR : Type u_1\nM : Type u_2\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : Module.Free R M\ninst✝¹ : Module.Finite R M\ninst✝ : Nontrivial M\n⊢ ↑LinearMap.det 0 = 0\n[PROOFSTEP]\nletI : Nonempty (Module.Free.ChooseBasisIndex R M) := (Module.Free.chooseBasis R M).index_nonempty\n[GOAL]\nR : Type u_1\nM : Type u_2\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : Module.Free R M\ninst✝¹ : Module.Finite R M\ninst✝ : Nontrivial M\nthis : Nonempty (Module.Free.ChooseBasisIndex R M) := Basis.index_nonempty (Module.Free.chooseBasis R M)\n⊢ ↑LinearMap.det 0 = 0\n[PROOFSTEP]\nnontriviality R\n[GOAL]\nR : Type u_1\nM : Type u_2\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : Module.Free R M\ninst✝¹ : Module.Finite R M\ninst✝ : Nontrivial M\nthis : Nonempty (Module.Free.ChooseBasisIndex R M) := Basis.index_nonempty (Module.Free.chooseBasis R M)\n✝ : Nontrivial R\n⊢ ↑LinearMap.det 0 = 0\n[PROOFSTEP]\nexact LinearMap.det_zero' (Module.Free.chooseBasis R M)\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.FreeModule.Determinant", "llama_tokens": 463, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9263037384317887, "lm_q2_score": 0.7520125737597972, "lm_q1q2_score": 0.6965920584214115}} {"text": "[GOAL]\nF : Type u_1\ninst✝² : Field F\ninst✝¹ : Finite F\ninst✝ : Algebra (ZMod (ringChar F)) F\na : F\nha : a ≠ 0\n⊢ ∃ b, ↑(Algebra.trace (ZMod (ringChar F)) F) (a * b) ≠ 0\n[PROOFSTEP]\nhaveI : Fact (ringChar F).Prime := ⟨CharP.char_is_prime F _⟩\n[GOAL]\nF : Type u_1\ninst✝² : Field F\ninst✝¹ : Finite F\ninst✝ : Algebra (ZMod (ringChar F)) F\na : F\nha : a ≠ 0\nthis : Fact (Nat.Prime (ringChar F))\n⊢ ∃ b, ↑(Algebra.trace (ZMod (ringChar F)) F) (a * b) ≠ 0\n[PROOFSTEP]\nhave htr := traceForm_nondegenerate (ZMod (ringChar F)) F a\n[GOAL]\nF : Type u_1\ninst✝² : Field F\ninst✝¹ : Finite F\ninst✝ : Algebra (ZMod (ringChar F)) F\na : F\nha : a ≠ 0\nthis : Fact (Nat.Prime (ringChar F))\nhtr : (∀ (n : F), BilinForm.bilin (Algebra.traceForm (ZMod (ringChar F)) F) a n = 0) → a = 0\n⊢ ∃ b, ↑(Algebra.trace (ZMod (ringChar F)) F) (a * b) ≠ 0\n[PROOFSTEP]\nsimp_rw [Algebra.traceForm_apply] at htr \n[GOAL]\nF : Type u_1\ninst✝² : Field F\ninst✝¹ : Finite F\ninst✝ : Algebra (ZMod (ringChar F)) F\na : F\nha : a ≠ 0\nthis : Fact (Nat.Prime (ringChar F))\nhtr : (∀ (n : F), ↑(Algebra.trace (ZMod (ringChar F)) F) (a * n) = 0) → a = 0\n⊢ ∃ b, ↑(Algebra.trace (ZMod (ringChar F)) F) (a * b) ≠ 0\n[PROOFSTEP]\nby_contra' hf\n[GOAL]\nF : Type u_1\ninst✝² : Field F\ninst✝¹ : Finite F\ninst✝ : Algebra (ZMod (ringChar F)) F\na : F\nha : a ≠ 0\nthis : Fact (Nat.Prime (ringChar F))\nhtr : (∀ (n : F), ↑(Algebra.trace (ZMod (ringChar F)) F) (a * n) = 0) → a = 0\nhf : ∀ (b : F), ↑(Algebra.trace (ZMod (ringChar F)) F) (a * b) = 0\n⊢ False\n[PROOFSTEP]\nexact ha (htr hf)\n", "meta": {"mathlib_filename": "Mathlib.FieldTheory.Finite.Trace", "llama_tokens": 771, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8840392817460332, "lm_q2_score": 0.7879311956428947, "lm_q1q2_score": 0.6965621282614378}} {"text": "[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\n⊢ HasDerivAt exp (exp x) x\n[PROOFSTEP]\nrw [hasDerivAt_iff_isLittleO_nhds_zero]\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\n⊢ (fun h => exp (x + h) - exp x - h • exp x) =o[𝓝 0] fun h => h\n[PROOFSTEP]\nhave : (1 : ℕ) < 2 := by norm_num\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\n⊢ 1 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\nthis : 1 < 2\n⊢ (fun h => exp (x + h) - exp x - h • exp x) =o[𝓝 0] fun h => h\n[PROOFSTEP]\nrefine' (IsBigO.of_bound ‖exp x‖ _).trans_isLittleO (isLittleO_pow_id this)\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\nthis : 1 < 2\n⊢ ∀ᶠ (x_1 : ℂ) in 𝓝 0, ‖exp (x + x_1) - exp x - x_1 • exp x‖ ≤ ‖exp x‖ * ‖x_1 ^ 2‖\n[PROOFSTEP]\nfilter_upwards [Metric.ball_mem_nhds (0 : ℂ) zero_lt_one]\n[GOAL]\ncase h\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\nthis : 1 < 2\n⊢ ∀ (a : ℂ), a ∈ Metric.ball 0 1 → ‖exp (x + a) - exp x - a • exp x‖ ≤ ‖exp x‖ * ‖a ^ 2‖\n[PROOFSTEP]\nsimp only [Metric.mem_ball, dist_zero_right, norm_pow]\n[GOAL]\ncase h\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nx : ℂ\nthis : 1 < 2\n⊢ ∀ (a : ℂ), ‖a‖ < 1 → ‖exp (x + a) - exp x - a • exp x‖ ≤ ‖exp x‖ * ‖a‖ ^ 2\n[PROOFSTEP]\nexact fun z hz => exp_bound_sq x z hz.le\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\n⊢ deriv^[n + 1] exp = exp\n[PROOFSTEP]\nrw [iterate_succ_apply, deriv_exp, iter_deriv_exp n]\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\n⊢ ∀ {n : ℕ∞}, ContDiff 𝕜 n exp\n[PROOFSTEP]\nrefine' @(contDiff_all_iff_nat.2 fun n => ?_)\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\n⊢ ContDiff 𝕜 (↑n) exp\n[PROOFSTEP]\nhave : ContDiff ℂ (↑n) exp := by\n induction' n with n ihn\n · exact contDiff_zero.2 continuous_exp\n · rw [contDiff_succ_iff_deriv]\n use differentiable_exp\n rwa [deriv_exp]\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\n⊢ ContDiff ℂ (↑n) exp\n[PROOFSTEP]\ninduction' n with n ihn\n[GOAL]\ncase zero\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\n⊢ ContDiff ℂ (↑Nat.zero) exp\n[PROOFSTEP]\nexact contDiff_zero.2 continuous_exp\n[GOAL]\ncase succ\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\nihn : ContDiff ℂ (↑n) exp\n⊢ ContDiff ℂ (↑(Nat.succ n)) exp\n[PROOFSTEP]\nrw [contDiff_succ_iff_deriv]\n[GOAL]\ncase succ\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\nihn : ContDiff ℂ (↑n) exp\n⊢ Differentiable ℂ exp ∧ ContDiff ℂ (↑n) (deriv exp)\n[PROOFSTEP]\nuse differentiable_exp\n[GOAL]\ncase right\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\nihn : ContDiff ℂ (↑n) exp\n⊢ ContDiff ℂ (↑n) (deriv exp)\n[PROOFSTEP]\nrwa [deriv_exp]\n[GOAL]\n𝕜 : Type u_1\ninst✝¹ : NontriviallyNormedField 𝕜\ninst✝ : NormedAlgebra 𝕜 ℂ\nn : ℕ\nthis : ContDiff ℂ (↑n) exp\n⊢ ContDiff 𝕜 (↑n) exp\n[PROOFSTEP]\nexact this.restrict_scalars 𝕜\n[GOAL]\nx y z : ℝ\nn : ℕ\n⊢ deriv^[n + 1] exp = exp\n[PROOFSTEP]\nrw [iterate_succ_apply, deriv_exp, iter_deriv_exp n]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "llama_tokens": 1730, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8774767874818408, "lm_q2_score": 0.7931059536292271, "lm_q1q2_score": 0.6959320643232959}} {"text": "[GOAL]\nG : Type u_1\nα : Type u_2\ninst✝⁴ : Group G\ninst✝³ : MulAction G α\ninst✝² : MeasurableSpace G\ninst✝¹ : MeasurableSpace α\ninst✝ : MeasurableSMul G α\ns : Set α\nhs : MeasurableSet s\na : G\n⊢ MeasurableSet (a • s)\n[PROOFSTEP]\nrw [← preimage_smul_inv]\n[GOAL]\nG : Type u_1\nα : Type u_2\ninst✝⁴ : Group G\ninst✝³ : MulAction G α\ninst✝² : MeasurableSpace G\ninst✝¹ : MeasurableSpace α\ninst✝ : MeasurableSMul G α\ns : Set α\nhs : MeasurableSet s\na : G\n⊢ MeasurableSet ((fun x => a⁻¹ • x) ⁻¹' s)\n[PROOFSTEP]\nexact measurable_const_smul _ hs\n[GOAL]\nG₀ : Type u_1\nα : Type u_2\ninst✝⁴ : GroupWithZero G₀\ninst✝³ : MulAction G₀ α\ninst✝² : MeasurableSpace G₀\ninst✝¹ : MeasurableSpace α\ninst✝ : MeasurableSMul G₀ α\ns : Set α\nhs : MeasurableSet s\na : G₀\nha : a ≠ 0\n⊢ MeasurableSet (a • s)\n[PROOFSTEP]\nrw [← preimage_smul_inv₀ ha]\n[GOAL]\nG₀ : Type u_1\nα : Type u_2\ninst✝⁴ : GroupWithZero G₀\ninst✝³ : MulAction G₀ α\ninst✝² : MeasurableSpace G₀\ninst✝¹ : MeasurableSpace α\ninst✝ : MeasurableSMul G₀ α\ns : Set α\nhs : MeasurableSet s\na : G₀\nha : a ≠ 0\n⊢ MeasurableSet ((fun x => a⁻¹ • x) ⁻¹' s)\n[PROOFSTEP]\nexact measurable_const_smul _ hs\n[GOAL]\nG₀ : Type u_1\nα : Type u_2\ninst✝⁶ : GroupWithZero G₀\ninst✝⁵ : Zero α\ninst✝⁴ : MulActionWithZero G₀ α\ninst✝³ : MeasurableSpace G₀\ninst✝² : MeasurableSpace α\ninst✝¹ : MeasurableSMul G₀ α\ninst✝ : MeasurableSingletonClass α\ns : Set α\nhs : MeasurableSet s\na : G₀\n⊢ MeasurableSet (a • s)\n[PROOFSTEP]\nrcases eq_or_ne a 0 with (rfl | ha)\n[GOAL]\ncase inl\nG₀ : Type u_1\nα : Type u_2\ninst✝⁶ : GroupWithZero G₀\ninst✝⁵ : Zero α\ninst✝⁴ : MulActionWithZero G₀ α\ninst✝³ : MeasurableSpace G₀\ninst✝² : MeasurableSpace α\ninst✝¹ : MeasurableSMul G₀ α\ninst✝ : MeasurableSingletonClass α\ns : Set α\nhs : MeasurableSet s\n⊢ MeasurableSet (0 • s)\ncase inr\nG₀ : Type u_1\nα : Type u_2\ninst✝⁶ : GroupWithZero G₀\ninst✝⁵ : Zero α\ninst✝⁴ : MulActionWithZero G₀ α\ninst✝³ : MeasurableSpace G₀\ninst✝² : MeasurableSpace α\ninst✝¹ : MeasurableSMul G₀ α\ninst✝ : MeasurableSingletonClass α\ns : Set α\nhs : MeasurableSet s\na : G₀\nha : a ≠ 0\n⊢ MeasurableSet (a • s)\n[PROOFSTEP]\nexacts [(subsingleton_zero_smul_set s).measurableSet, hs.const_smul_of_ne_zero ha]\n", "meta": {"mathlib_filename": "Mathlib.MeasureTheory.Group.Pointwise", "llama_tokens": 1036, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9111797075998823, "lm_q2_score": 0.7634837635542924, "lm_q1q2_score": 0.6956709124326578}} {"text": "[GOAL]\nR : Type u_1\nS : Type u_2\ninst✝⁴ : CommRing R\ninst✝³ : Nontrivial R\ninst✝² : LinearOrderedCommRing S\nn : Type u_3\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nA : Matrix n n R\nabv : AbsoluteValue R S\nx : S\nhx : ∀ (i j : n), ↑abv (A i j) ≤ x\nσ : Perm n\nx✝ : σ ∈ univ\n⊢ ↑abv (↑Perm.sign σ • ∏ i : n, A (↑σ i) i) = ∏ i : n, ↑abv (A (↑σ i) i)\n[PROOFSTEP]\nrw [abv.map_units_int_smul, abv.map_prod]\n[GOAL]\nR : Type u_1\nS : Type u_2\ninst✝⁴ : CommRing R\ninst✝³ : Nontrivial R\ninst✝² : LinearOrderedCommRing S\nn : Type u_3\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nA : Matrix n n R\nabv : AbsoluteValue R S\nx : S\nhx : ∀ (i j : n), ↑abv (A i j) ≤ x\nx✝¹ : Perm n\nx✝ : x✝¹ ∈ univ\n⊢ ∏ _i : n, x = x ^ Fintype.card n\n[PROOFSTEP]\nrw [prod_const, Finset.card_univ]\n[GOAL]\nR : Type u_1\nS : Type u_2\ninst✝⁴ : CommRing R\ninst✝³ : Nontrivial R\ninst✝² : LinearOrderedCommRing S\nn : Type u_3\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nA : Matrix n n R\nabv : AbsoluteValue R S\nx : S\nhx : ∀ (i j : n), ↑abv (A i j) ≤ x\n⊢ ∑ _σ : Perm n, x ^ Fintype.card n = Nat.factorial (Fintype.card n) • x ^ Fintype.card n\n[PROOFSTEP]\nrw [sum_const, Finset.card_univ, Fintype.card_perm]\n[GOAL]\nR : Type u_1\nS : Type u_2\ninst✝⁴ : CommRing R\ninst✝³ : Nontrivial R\ninst✝² : LinearOrderedCommRing S\nn : Type u_3\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nι : Type u_4\ns : Finset ι\nA : ι → Matrix n n R\nabv : AbsoluteValue R S\nx : S\nhx : ∀ (k : ι) (i j : n), ↑abv (A k i j) ≤ x\ni j : n\n⊢ ↑abv (Finset.sum s (fun k => A k) i j) = ↑abv (∑ k in s, A k i j)\n[PROOFSTEP]\nsimp only [sum_apply]\n[GOAL]\nR : Type u_1\nS : Type u_2\ninst✝⁴ : CommRing R\ninst✝³ : Nontrivial R\ninst✝² : LinearOrderedCommRing S\nn : Type u_3\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nι : Type u_4\ns : Finset ι\nc : ι → R\nA : ι → Matrix n n R\nabv : AbsoluteValue R S\nx : S\nhx : ∀ (k : ι) (i j : n), ↑abv (A k i j) ≤ x\ny : S\nhy : ∀ (k : ι), ↑abv (c k) ≤ y\n⊢ ↑abv (det (∑ k in s, c k • A k)) ≤ Nat.factorial (Fintype.card n) • (card s • y * x) ^ Fintype.card n\n[PROOFSTEP]\nsimpa only [smul_mul_assoc] using\n det_sum_le s fun k i j =>\n calc\n abv (c k * A k i j) = abv (c k) * abv (A k i j) := abv.map_mul _ _\n _ ≤ y * x := mul_le_mul (hy k) (hx k i j) (abv.nonneg _) ((abv.nonneg _).trans (hy k))\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.Matrix.AbsoluteValue", "llama_tokens": 1186, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8918110368115781, "lm_q2_score": 0.7799929053683038, "lm_q1q2_score": 0.6956062816421822}} {"text": "[GOAL]\nd : ℕ\nx y a b : ℤ\nh₁ : ↑d ∣ x\nh₂ : ↑d ∣ y\nh₃ : x * a + y * b = ↑d\n⊢ Int.gcd x y = d\n[PROOFSTEP]\nrefine Nat.dvd_antisymm ?_ (Int.coe_nat_dvd.1 (Int.dvd_gcd h₁ h₂))\n[GOAL]\nd : ℕ\nx y a b : ℤ\nh₁ : ↑d ∣ x\nh₂ : ↑d ∣ y\nh₃ : x * a + y * b = ↑d\n⊢ Int.gcd x y ∣ d\n[PROOFSTEP]\nrw [← Int.coe_nat_dvd, ← h₃]\n[GOAL]\nd : ℕ\nx y a b : ℤ\nh₁ : ↑d ∣ x\nh₂ : ↑d ∣ y\nh₃ : x * a + y * b = ↑d\n⊢ ↑(Int.gcd x y) ∣ x * a + y * b\n[PROOFSTEP]\napply dvd_add\n[GOAL]\ncase h₁\nd : ℕ\nx y a b : ℤ\nh₁ : ↑d ∣ x\nh₂ : ↑d ∣ y\nh₃ : x * a + y * b = ↑d\n⊢ ↑(Int.gcd x y) ∣ x * a\n[PROOFSTEP]\nexact (Int.gcd_dvd_left _ _).mul_right _\n[GOAL]\ncase h₂\nd : ℕ\nx y a b : ℤ\nh₁ : ↑d ∣ x\nh₂ : ↑d ∣ y\nh₃ : x * a + y * b = ↑d\n⊢ ↑(Int.gcd x y) ∣ y * b\n[PROOFSTEP]\nexact (Int.gcd_dvd_right _ _).mul_right _\n[GOAL]\nd x y a b : ℕ\nhu : x % d = 0\nhv : y % d = 0\nh : x * a = y * b + d\n⊢ Nat.gcd x y = d\n[PROOFSTEP]\nrw [← Int.coe_nat_gcd]\n[GOAL]\nd x y a b : ℕ\nhu : x % d = 0\nhv : y % d = 0\nh : x * a = y * b + d\n⊢ Int.gcd ↑x ↑y = d\n[PROOFSTEP]\napply\n int_gcd_helper' a (-b) (Int.coe_nat_dvd.mpr (Nat.dvd_of_mod_eq_zero hu))\n (Int.coe_nat_dvd.mpr (Nat.dvd_of_mod_eq_zero hv))\n[GOAL]\nd x y a b : ℕ\nhu : x % d = 0\nhv : y % d = 0\nh : x * a = y * b + d\n⊢ ↑x * ↑a + ↑y * -↑b = ↑d\n[PROOFSTEP]\nrw [mul_neg, ← sub_eq_add_neg, sub_eq_iff_eq_add']\n[GOAL]\nd x y a b : ℕ\nhu : x % d = 0\nhv : y % d = 0\nh : x * a = y * b + d\n⊢ ↑x * ↑a = ↑y * ↑b + ↑d\n[PROOFSTEP]\nexact_mod_cast h\n[GOAL]\nx y d m : ℕ\nhd : Nat.gcd x y = d\nd0 : Nat.beq d 0 = false\ndm : x * y = d * m\n⊢ (fun x x_1 => x * x_1) d (Nat.lcm x y) = (fun x x_1 => x * x_1) d m\n[PROOFSTEP]\ndsimp only\n -- Porting note: the `dsimp only` was not necessary in Lean3.\n[GOAL]\nx y d m : ℕ\nhd : Nat.gcd x y = d\nd0 : Nat.beq d 0 = false\ndm : x * y = d * m\n⊢ d * Nat.lcm x y = d * m\n[PROOFSTEP]\nrw [← dm, ← hd, Nat.gcd_mul_lcm]\n[GOAL]\nx y : ℤ\nx' y' d : ℕ\nhx : Int.natAbs x = x'\nhy : Int.natAbs y = y'\nh : Nat.gcd x' y' = d\n⊢ Int.gcd x y = d\n[PROOFSTEP]\nsubst_vars\n[GOAL]\nx y : ℤ\n⊢ Int.gcd x y = Nat.gcd (Int.natAbs x) (Int.natAbs y)\n[PROOFSTEP]\nrw [Int.gcd_def]\n[GOAL]\nx y : ℤ\nx' y' d : ℕ\nhx : Int.natAbs x = x'\nhy : Int.natAbs y = y'\nh : Nat.lcm x' y' = d\n⊢ Int.lcm x y = d\n[PROOFSTEP]\nsubst_vars\n[GOAL]\nx y : ℤ\n⊢ Int.lcm x y = Nat.lcm (Int.natAbs x) (Int.natAbs y)\n[PROOFSTEP]\nrw [Int.lcm_def]\n", "meta": {"mathlib_filename": "Mathlib.Tactic.NormNum.GCD", "llama_tokens": 1369, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8887587817066392, "lm_q2_score": 0.7826624840223698, "lm_q1q2_score": 0.6955981557872134}} {"text": "[GOAL]\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s✝ : R\nx y : M\ns : Multiset R\nt : Multiset M\n⊢ sum s • sum t = sum (map (fun p => p.fst • p.snd) (s ×ˢ t))\n[PROOFSTEP]\ninduction' s using Multiset.induction with a s ih\n[GOAL]\ncase empty\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s : R\nx y : M\nt : Multiset M\n⊢ sum 0 • sum t = sum (map (fun p => p.fst • p.snd) (0 ×ˢ t))\n[PROOFSTEP]\nsimp\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s✝ : R\nx y : M\nt : Multiset M\na : R\ns : Multiset R\nih : sum s • sum t = sum (map (fun p => p.fst • p.snd) (s ×ˢ t))\n⊢ sum (a ::ₘ s) • sum t = sum (map (fun p => p.fst • p.snd) ((a ::ₘ s) ×ˢ t))\n[PROOFSTEP]\nsimp [add_smul, ih, ← Multiset.smul_sum]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s✝ : R\nx y : M\nf : α → R\ng : β → M\ns : Finset α\nt : Finset β\n⊢ (∑ i in s, f i) • ∑ i in t, g i = ∑ p in s ×ˢ t, f p.fst • g p.snd\n[PROOFSTEP]\nrw [Finset.sum_product, Finset.sum_smul, Finset.sum_congr rfl]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s✝ : R\nx y : M\nf : α → R\ng : β → M\ns : Finset α\nt : Finset β\n⊢ ∀ (x : α), x ∈ s → f x • ∑ i in t, g i = ∑ y in t, f (x, y).fst • g (x, y).snd\n[PROOFSTEP]\nintros\n[GOAL]\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝² : Semiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nr s✝ : R\nx y : M\nf : α → R\ng : β → M\ns : Finset α\nt : Finset β\nx✝ : α\na✝ : x✝ ∈ s\n⊢ f x✝ • ∑ i in t, g i = ∑ y in t, f (x✝, y).fst • g (x✝, y).snd\n[PROOFSTEP]\nrw [Finset.smul_sum]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nR : Type u_3\nM : Type u_4\nι : Type u_5\ninst✝ : CommSemiring R\ns : Finset α\n⊢ ↑(card s) = ∑ a in s, 1\n[PROOFSTEP]\nrw [Finset.sum_const, Nat.smul_one_eq_coe]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Module.BigOperators", "llama_tokens": 1155, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.863391617003942, "lm_q2_score": 0.8056321866478978, "lm_q1q2_score": 0.6955760763403501}} {"text": "[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nhave norm_sum : ‖U i j‖ ^ 2 ≤ ∑ x, ‖U i x‖ ^ 2 :=\n by\n apply Multiset.single_le_sum\n · intro x h_x\n rw [Multiset.mem_map] at h_x \n cases' h_x with a h_a\n rw [← h_a.2]\n apply sq_nonneg\n · rw [Multiset.mem_map]\n use j\n simp only [eq_self_iff_true, Finset.mem_univ_val, and_self_iff, sq_eq_sq]\n -- The L2 norm of a row is a diagonal entry of U * Uᴴ\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\n[PROOFSTEP]\napply Multiset.single_le_sum\n[GOAL]\ncase a\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ ∀ (x : ℝ), x ∈ Multiset.map (fun x => ‖U i x‖ ^ 2) Finset.univ.val → 0 ≤ x\n[PROOFSTEP]\nintro x h_x\n[GOAL]\ncase a\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nx : ℝ\nh_x : x ∈ Multiset.map (fun x => ‖U i x‖ ^ 2) Finset.univ.val\n⊢ 0 ≤ x\n[PROOFSTEP]\nrw [Multiset.mem_map] at h_x \n[GOAL]\ncase a\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nx : ℝ\nh_x : ∃ a, a ∈ Finset.univ.val ∧ ‖U i a‖ ^ 2 = x\n⊢ 0 ≤ x\n[PROOFSTEP]\ncases' h_x with a h_a\n[GOAL]\ncase a.intro\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nx : ℝ\na : n\nh_a : a ∈ Finset.univ.val ∧ ‖U i a‖ ^ 2 = x\n⊢ 0 ≤ x\n[PROOFSTEP]\nrw [← h_a.2]\n[GOAL]\ncase a.intro\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nx : ℝ\na : n\nh_a : a ∈ Finset.univ.val ∧ ‖U i a‖ ^ 2 = x\n⊢ 0 ≤ ‖U i a‖ ^ 2\n[PROOFSTEP]\napply sq_nonneg\n[GOAL]\ncase a\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ ‖U i j‖ ^ 2 ∈ Multiset.map (fun x => ‖U i x‖ ^ 2) Finset.univ.val\n[PROOFSTEP]\nrw [Multiset.mem_map]\n[GOAL]\ncase a\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ ∃ a, a ∈ Finset.univ.val ∧ ‖U i a‖ ^ 2 = ‖U i j‖ ^ 2\n[PROOFSTEP]\nuse j\n[GOAL]\ncase h\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\n⊢ j ∈ Finset.univ.val ∧ ‖U i j‖ ^ 2 = ‖U i j‖ ^ 2\n[PROOFSTEP]\nsimp only [eq_self_iff_true, Finset.mem_univ_val, and_self_iff, sq_eq_sq]\n -- The L2 norm of a row is a diagonal entry of U * Uᴴ\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nhave diag_eq_norm_sum : (U * Uᴴ) i i = ∑ x : n, ‖U i x‖ ^ 2 := by\n simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, ← starRingEnd_apply, IsROrC.mul_conj, IsROrC.normSq_eq_def',\n IsROrC.ofReal_pow];\n norm_cast\n -- The L2 norm of a row is a diagonal entry of U * Uᴴ, real part\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\n⊢ (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\n[PROOFSTEP]\nsimp only [Matrix.mul_apply, Matrix.conjTranspose_apply, ← starRingEnd_apply, IsROrC.mul_conj, IsROrC.normSq_eq_def',\n IsROrC.ofReal_pow]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\n⊢ ∑ x : n, ↑‖U i x‖ ^ 2 = ↑(∑ x : n, ‖U i x‖ ^ 2)\n[PROOFSTEP]\nnorm_cast\n -- The L2 norm of a row is a diagonal entry of U * Uᴴ, real part\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nhave re_diag_eq_norm_sum : IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2 :=\n by\n rw [IsROrC.ext_iff] at diag_eq_norm_sum \n rw [diag_eq_norm_sum.1]\n norm_cast\n -- Since U is unitary, the diagonal entries of U * Uᴴ are all 1\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\n⊢ ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\n[PROOFSTEP]\nrw [IsROrC.ext_iff] at diag_eq_norm_sum \n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum✝ : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\ndiag_eq_norm_sum :\n ↑IsROrC.re ((U * Uᴴ) i i) = ↑IsROrC.re ↑(∑ x : n, ‖U i x‖ ^ 2) ∧\n ↑IsROrC.im ((U * Uᴴ) i i) = ↑IsROrC.im ↑(∑ x : n, ‖U i x‖ ^ 2)\n⊢ ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\n[PROOFSTEP]\nrw [diag_eq_norm_sum.1]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum✝ : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\ndiag_eq_norm_sum :\n ↑IsROrC.re ((U * Uᴴ) i i) = ↑IsROrC.re ↑(∑ x : n, ‖U i x‖ ^ 2) ∧\n ↑IsROrC.im ((U * Uᴴ) i i) = ↑IsROrC.im ↑(∑ x : n, ‖U i x‖ ^ 2)\n⊢ ↑IsROrC.re ↑(∑ x : n, ‖U i x‖ ^ 2) = ∑ x : n, ‖U i x‖ ^ 2\n[PROOFSTEP]\nnorm_cast\n -- Since U is unitary, the diagonal entries of U * Uᴴ are all 1\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\nre_diag_eq_norm_sum : ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nhave mul_eq_one : U * Uᴴ = 1 := unitary.mul_star_self_of_mem hU\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\nre_diag_eq_norm_sum : ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\nmul_eq_one : U * Uᴴ = 1\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nhave diag_eq_one : IsROrC.re ((U * Uᴴ) i i) = 1 := by\n simp only [mul_eq_one, eq_self_iff_true, Matrix.one_apply_eq, IsROrC.one_re]\n -- Putting it all together\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\nre_diag_eq_norm_sum : ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\nmul_eq_one : U * Uᴴ = 1\n⊢ ↑IsROrC.re ((U * Uᴴ) i i) = 1\n[PROOFSTEP]\nsimp only [mul_eq_one, eq_self_iff_true, Matrix.one_apply_eq, IsROrC.one_re]\n -- Putting it all together\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\nre_diag_eq_norm_sum : ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\nmul_eq_one : U * Uᴴ = 1\ndiag_eq_one : ↑IsROrC.re ((U * Uᴴ) i i) = 1\n⊢ ‖U i j‖ ≤ 1\n[PROOFSTEP]\nrw [← sq_le_one_iff (norm_nonneg (U i j)), ← diag_eq_one, re_diag_eq_norm_sum]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni j : n\nnorm_sum : ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\ndiag_eq_norm_sum : (U * Uᴴ) i i = ↑(∑ x : n, ‖U i x‖ ^ 2)\nre_diag_eq_norm_sum : ↑IsROrC.re ((U * Uᴴ) i i) = ∑ x : n, ‖U i x‖ ^ 2\nmul_eq_one : U * Uᴴ = 1\ndiag_eq_one : ↑IsROrC.re ((U * Uᴴ) i i) = 1\n⊢ ‖U i j‖ ^ 2 ≤ ∑ x : n, ‖U i x‖ ^ 2\n[PROOFSTEP]\nexact norm_sum\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n⊢ ‖U‖ ≤ 1\n[PROOFSTEP]\nconv =>\n -- Porting note: was `simp_rw [pi_norm_le_iff_of_nonneg zero_le_one]`\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n intro\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n| ‖U‖ ≤ 1\n[PROOFSTEP]\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n intro\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n| ‖U‖ ≤ 1\n[PROOFSTEP]\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n intro\n rw [pi_norm_le_iff_of_nonneg zero_le_one]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n| ‖U‖ ≤ 1\n[PROOFSTEP]\nrw [pi_norm_le_iff_of_nonneg zero_le_one]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n| ∀ (i : n), ‖U i‖ ≤ 1\n[PROOFSTEP]\nintro\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni✝ : n\n| ‖U i✝‖ ≤ 1\n[PROOFSTEP]\nrw [pi_norm_le_iff_of_nonneg zero_le_one]\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\n⊢ ∀ (i i_1 : n), ‖U i i_1‖ ≤ 1\n[PROOFSTEP]\nintros\n[GOAL]\n𝕜 : Type u_1\nm : Type u_2\nn : Type u_3\nE : Type u_4\ninst✝² : IsROrC 𝕜\ninst✝¹ : Fintype n\ninst✝ : DecidableEq n\nU : Matrix n n 𝕜\nhU : U ∈ Matrix.unitaryGroup n 𝕜\ni✝¹ i✝ : n\n⊢ ‖U i✝¹ i✝‖ ≤ 1\n[PROOFSTEP]\nexact entry_norm_bound_of_unitary hU _ _\n", "meta": {"mathlib_filename": "Mathlib.Analysis.NormedSpace.Star.Matrix", "llama_tokens": 6349, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8947894717137996, "lm_q2_score": 0.7772998560157665, "lm_q1q2_score": 0.6955197275275602}} {"text": "[GOAL]\n⊢ DecidableRel fun x x_1 => x ≤ x_1\n[PROOFSTEP]\ninfer_instance\n[GOAL]\n⊢ DecidableEq ℤ\n[PROOFSTEP]\ninfer_instance\n[GOAL]\n⊢ DecidableRel fun x x_1 => x < x_1\n[PROOFSTEP]\ninfer_instance\n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhlt₂ : 0 < b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nhave : 0 < a * b := Int.mul_pos hlt₁ hlt₂\n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhlt₂ : 0 < b\nthis : 0 < a * b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nrw [h] at this \n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhlt₂ : 0 < b\nthis : 0 < 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nexact absurd this (lt_irrefl _)\n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhgt₂ : b < 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nhave : 0 > a * b := Int.mul_neg_of_pos_of_neg hlt₁ hgt₂\n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhgt₂ : b < 0\nthis : 0 > a * b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nrw [h] at this \n[GOAL]\na b : ℤ\nh : a * b = 0\nhlt₁ : 0 < a\nhgt₂ : b < 0\nthis : 0 > 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nexact absurd this (lt_irrefl _)\n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhlt₂ : 0 < b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nhave : 0 > a * b := Int.mul_neg_of_neg_of_pos hgt₁ hlt₂\n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhlt₂ : 0 < b\nthis : 0 > a * b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nrw [h] at this \n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhlt₂ : 0 < b\nthis : 0 > 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nexact absurd this (lt_irrefl _)\n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhgt₂ : b < 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nhave : 0 < a * b := Int.mul_pos_of_neg_of_neg hgt₁ hgt₂\n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhgt₂ : b < 0\nthis : 0 < a * b\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nrw [h] at this \n[GOAL]\na b : ℤ\nh : a * b = 0\nhgt₁ : a < 0\nhgt₂ : b < 0\nthis : 0 < 0\n⊢ a = 0 ∨ b = 0\n[PROOFSTEP]\nexact absurd this (lt_irrefl _)\n", "meta": {"mathlib_filename": "Mathlib.Init.Data.Int.Order", "llama_tokens": 1038, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8824278664544911, "lm_q2_score": 0.7879311931529758, "lm_q1q2_score": 0.695292441686922}} {"text": "[GOAL]\nn : ℕ\nα : Type u_1\ninst✝ : LinearOrder α\nf : Fin n → α\nP : (Fin n → α) → Prop\nhf : P f\nh :\n ∀ (σ : Equiv.Perm (Fin n)) (i j : Fin n),\n i < j → (f ∘ ↑σ) j < (f ∘ ↑σ) i → P (f ∘ ↑σ) → P (f ∘ ↑σ ∘ ↑(Equiv.swap i j))\n⊢ P (f ∘ ↑(sort f))\n[PROOFSTEP]\nletI := @Preorder.lift _ (Lex (Fin n → α)) _ fun σ : Equiv.Perm (Fin n) => toLex (f ∘ σ)\n[GOAL]\nn : ℕ\nα : Type u_1\ninst✝ : LinearOrder α\nf : Fin n → α\nP : (Fin n → α) → Prop\nhf : P f\nh :\n ∀ (σ : Equiv.Perm (Fin n)) (i j : Fin n),\n i < j → (f ∘ ↑σ) j < (f ∘ ↑σ) i → P (f ∘ ↑σ) → P (f ∘ ↑σ ∘ ↑(Equiv.swap i j))\nthis : Preorder (Equiv.Perm (Fin n)) := Preorder.lift fun σ => ↑toLex (f ∘ ↑σ)\n⊢ P (f ∘ ↑(sort f))\n[PROOFSTEP]\nrefine'\n @WellFounded.induction_bot' _ _ _ (IsWellFounded.wf : WellFounded (· < ·)) (Equiv.refl _) (sort f) P (fun σ => f ∘ σ)\n (fun σ hσ hfσ => _) hf\n[GOAL]\nn : ℕ\nα : Type u_1\ninst✝ : LinearOrder α\nf : Fin n → α\nP : (Fin n → α) → Prop\nhf : P f\nh :\n ∀ (σ : Equiv.Perm (Fin n)) (i j : Fin n),\n i < j → (f ∘ ↑σ) j < (f ∘ ↑σ) i → P (f ∘ ↑σ) → P (f ∘ ↑σ ∘ ↑(Equiv.swap i j))\nthis : Preorder (Equiv.Perm (Fin n)) := Preorder.lift fun σ => ↑toLex (f ∘ ↑σ)\nσ : Fin n ≃ Fin n\nhσ : (fun σ => f ∘ ↑σ) σ ≠ (fun σ => f ∘ ↑σ) (sort f)\nhfσ : P ((fun σ => f ∘ ↑σ) σ)\n⊢ ∃ c, c < σ ∧ P ((fun σ => f ∘ ↑σ) c)\n[PROOFSTEP]\nobtain ⟨i, j, hij₁, hij₂⟩ := antitone_pair_of_not_sorted' hσ\n[GOAL]\ncase intro.intro.intro\nn : ℕ\nα : Type u_1\ninst✝ : LinearOrder α\nf : Fin n → α\nP : (Fin n → α) → Prop\nhf : P f\nh :\n ∀ (σ : Equiv.Perm (Fin n)) (i j : Fin n),\n i < j → (f ∘ ↑σ) j < (f ∘ ↑σ) i → P (f ∘ ↑σ) → P (f ∘ ↑σ ∘ ↑(Equiv.swap i j))\nthis : Preorder (Equiv.Perm (Fin n)) := Preorder.lift fun σ => ↑toLex (f ∘ ↑σ)\nσ : Fin n ≃ Fin n\nhσ : (fun σ => f ∘ ↑σ) σ ≠ (fun σ => f ∘ ↑σ) (sort f)\nhfσ : P ((fun σ => f ∘ ↑σ) σ)\ni j : Fin n\nhij₁ : i < j\nhij₂ : (f ∘ ↑σ) j < (f ∘ ↑σ) i\n⊢ ∃ c, c < σ ∧ P ((fun σ => f ∘ ↑σ) c)\n[PROOFSTEP]\nexact ⟨σ * Equiv.swap i j, Pi.lex_desc hij₁.le hij₂, h σ i j hij₁ hij₂ hfσ⟩\n", "meta": {"mathlib_filename": "Mathlib.Data.Fin.Tuple.BubbleSortInduction", "llama_tokens": 1103, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9032942067038784, "lm_q2_score": 0.7690802264851919, "lm_q1q2_score": 0.6947057130745805}} {"text": "[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∀ (n : ℕ),\n (∀ (m : ℕ), m < n → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts) →\n ∃ conts, continuantsAux (of v) n = Pair.map Rat.cast conts\n[PROOFSTEP]\nclear n\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\n⊢ ∀ (n : ℕ),\n (∀ (m : ℕ), m < n → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts) →\n ∃ conts, continuantsAux (of v) n = Pair.map Rat.cast conts\n[PROOFSTEP]\nlet g := of v\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\n⊢ ∀ (n : ℕ),\n (∀ (m : ℕ), m < n → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts) →\n ∃ conts, continuantsAux (of v) n = Pair.map Rat.cast conts\n[PROOFSTEP]\nintro n IH\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < n → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ conts, continuantsAux (of v) n = Pair.map Rat.cast conts\n[PROOFSTEP]\nrcases n with\n (_ | _ | n)\n -- n = 0\n[GOAL]\ncase zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ conts, continuantsAux (of v) Nat.zero = Pair.map Rat.cast conts\n[PROOFSTEP]\nsuffices ∃ gp : Pair ℚ, Pair.mk (1 : K) 0 = gp.map (↑) by simpa [continuantsAux]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\nthis : ∃ gp, { a := 1, b := 0 } = Pair.map Rat.cast gp\n⊢ ∃ conts, continuantsAux (of v) Nat.zero = Pair.map Rat.cast conts\n[PROOFSTEP]\nsimpa [continuantsAux]\n[GOAL]\ncase zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ gp, { a := 1, b := 0 } = Pair.map Rat.cast gp\n[PROOFSTEP]\nuse Pair.mk 1 0\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ { a := 1, b := 0 } = Pair.map Rat.cast { a := 1, b := 0 }\n[PROOFSTEP]\nsimp\n -- n = 1\n[GOAL]\ncase succ.zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.succ Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ Nat.zero) = Pair.map Rat.cast conts\n[PROOFSTEP]\nsuffices ∃ conts : Pair ℚ, Pair.mk g.h 1 = conts.map (↑) by simpa [continuantsAux]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.succ Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\nthis : ∃ conts, { a := g.h, b := 1 } = Pair.map Rat.cast conts\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ Nat.zero) = Pair.map Rat.cast conts\n[PROOFSTEP]\nsimpa [continuantsAux]\n[GOAL]\ncase succ.zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.succ Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ conts, { a := g.h, b := 1 } = Pair.map Rat.cast conts\n[PROOFSTEP]\nuse Pair.mk ⌊v⌋ 1\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nIH : ∀ (m : ℕ), m < Nat.succ Nat.zero → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ { a := g.h, b := 1 } = Pair.map Rat.cast { a := ↑⌊v⌋, b := 1 }\n[PROOFSTEP]\nsimp\n -- 2 ≤ n\n[GOAL]\ncase succ.succ\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\ncases' IH (n + 1) <| lt_add_one (n + 1) with pred_conts pred_conts_eq\n[GOAL]\ncase succ.succ.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\ncases' s_ppred_nth_eq : g.s.get? n with gp_n\n[GOAL]\ncase succ.succ.intro.none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = none\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\nuse pred_conts\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = none\n⊢ continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast pred_conts\n[PROOFSTEP]\nhave : g.continuantsAux (n + 2) = g.continuantsAux (n + 1) :=\n continuantsAux_stable_of_terminated (n + 1).le_succ s_ppred_nth_eq\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = none\nthis : continuantsAux g (n + 2) = continuantsAux g (n + 1)\n⊢ continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast pred_conts\n[PROOFSTEP]\nsimp only [this, pred_conts_eq]\n -- option.some\n[GOAL]\ncase succ.succ.intro.some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\ncases' IH n <| lt_of_le_of_lt n.le_succ <| lt_add_one <| n + 1 with ppred_conts ppred_conts_eq\n[GOAL]\ncase succ.succ.intro.some.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\nobtain ⟨a_eq_one, z, b_eq_z⟩ : gp_n.a = 1 ∧ ∃ z : ℤ, gp_n.b = (z : K)\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\n⊢ gp_n.a = 1 ∧ ∃ z, gp_n.b = ↑z\ncase succ.succ.intro.some.intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\nexact of_part_num_eq_one_and_exists_int_part_denom_eq s_ppred_nth_eq\n[GOAL]\ncase succ.succ.intro.some.intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\n⊢ ∃ conts, continuantsAux (of v) (Nat.succ (Nat.succ n)) = Pair.map Rat.cast conts\n[PROOFSTEP]\nsimp only [a_eq_one, b_eq_z, continuantsAux_recurrence s_ppred_nth_eq ppred_conts_eq pred_conts_eq]\n[GOAL]\ncase succ.succ.intro.some.intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\n⊢ ∃ conts,\n { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,\n b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =\n Pair.map Rat.cast conts\n[PROOFSTEP]\nuse nextContinuants 1 (z : ℚ) ppred_conts pred_conts\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\nppred_conts : Pair ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast ppred_conts\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\n⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast ppred_conts).a,\n b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast ppred_conts).b } =\n Pair.map Rat.cast (nextContinuants 1 (↑z) ppred_conts pred_conts)\n[PROOFSTEP]\ncases ppred_conts\n[GOAL]\ncase h.mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\npred_conts : Pair ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast pred_conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\na✝ b✝ : ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast { a := a✝, b := b✝ }\n⊢ { a := ↑z * (Pair.map Rat.cast pred_conts).a + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).a,\n b := ↑z * (Pair.map Rat.cast pred_conts).b + 1 * (Pair.map Rat.cast { a := a✝, b := b✝ }).b } =\n Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝, b := b✝ } pred_conts)\n[PROOFSTEP]\ncases pred_conts\n[GOAL]\ncase h.mk.mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\ng : GeneralizedContinuedFraction K := of v\nn : ℕ\nIH : ∀ (m : ℕ), m < Nat.succ (Nat.succ n) → ∃ conts, continuantsAux (of v) m = Pair.map Rat.cast conts\ngp_n : Pair K\ns_ppred_nth_eq : Stream'.Seq.get? g.s n = some gp_n\na_eq_one : gp_n.a = 1\nz : ℤ\nb_eq_z : gp_n.b = ↑z\na✝¹ b✝¹ : ℚ\nppred_conts_eq : continuantsAux (of v) n = Pair.map Rat.cast { a := a✝¹, b := b✝¹ }\na✝ b✝ : ℚ\npred_conts_eq : continuantsAux (of v) (n + 1) = Pair.map Rat.cast { a := a✝, b := b✝ }\n⊢ { a := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).a + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).a,\n b := ↑z * (Pair.map Rat.cast { a := a✝, b := b✝ }).b + 1 * (Pair.map Rat.cast { a := a✝¹, b := b✝¹ }).b } =\n Pair.map Rat.cast (nextContinuants 1 ↑z { a := a✝¹, b := b✝¹ } { a := a✝, b := b✝ })\n[PROOFSTEP]\nsimp [nextContinuants, nextNumerator, nextDenominator]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∃ conts, continuants (of v) n = Pair.map Rat.cast conts\n[PROOFSTEP]\nrw [nth_cont_eq_succ_nth_cont_aux]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∃ conts, continuantsAux (of v) (n + 1) = Pair.map Rat.cast conts\n[PROOFSTEP]\nexact exists_gcf_pair_rat_eq_of_nth_conts_aux v <| n + 1\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∃ q, numerators (of v) n = ↑q\n[PROOFSTEP]\nrcases exists_gcf_pair_rat_eq_nth_conts v n with ⟨⟨a, _⟩, nth_cont_eq⟩\n[GOAL]\ncase intro.mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\na b✝ : ℚ\nnth_cont_eq : continuants (of v) n = Pair.map Rat.cast { a := a, b := b✝ }\n⊢ ∃ q, numerators (of v) n = ↑q\n[PROOFSTEP]\nuse a\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\na b✝ : ℚ\nnth_cont_eq : continuants (of v) n = Pair.map Rat.cast { a := a, b := b✝ }\n⊢ numerators (of v) n = ↑a\n[PROOFSTEP]\nsimp [num_eq_conts_a, nth_cont_eq]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∃ q, denominators (of v) n = ↑q\n[PROOFSTEP]\nrcases exists_gcf_pair_rat_eq_nth_conts v n with ⟨⟨_, b⟩, nth_cont_eq⟩\n[GOAL]\ncase intro.mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\na✝ b : ℚ\nnth_cont_eq : continuants (of v) n = Pair.map Rat.cast { a := a✝, b := b }\n⊢ ∃ q, denominators (of v) n = ↑q\n[PROOFSTEP]\nuse b\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\na✝ b : ℚ\nnth_cont_eq : continuants (of v) n = Pair.map Rat.cast { a := a✝, b := b }\n⊢ denominators (of v) n = ↑b\n[PROOFSTEP]\nsimp [denom_eq_conts_b, nth_cont_eq]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\n⊢ ∃ q, convergents (of v) n = ↑q\n[PROOFSTEP]\nrcases exists_rat_eq_nth_numerator v n with ⟨Aₙ, nth_num_eq⟩\n[GOAL]\ncase intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\nAₙ : ℚ\nnth_num_eq : numerators (of v) n = ↑Aₙ\n⊢ ∃ q, convergents (of v) n = ↑q\n[PROOFSTEP]\nrcases exists_rat_eq_nth_denominator v n with ⟨Bₙ, nth_denom_eq⟩\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\nAₙ : ℚ\nnth_num_eq : numerators (of v) n = ↑Aₙ\nBₙ : ℚ\nnth_denom_eq : denominators (of v) n = ↑Bₙ\n⊢ ∃ q, convergents (of v) n = ↑q\n[PROOFSTEP]\nuse Aₙ / Bₙ\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\nAₙ : ℚ\nnth_num_eq : numerators (of v) n = ↑Aₙ\nBₙ : ℚ\nnth_denom_eq : denominators (of v) n = ↑Bₙ\n⊢ convergents (of v) n = ↑(Aₙ / Bₙ)\n[PROOFSTEP]\nsimp [nth_num_eq, nth_denom_eq, convergent_eq_num_div_denom]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\nterminates : Terminates (of v)\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nobtain ⟨n, v_eq_conv⟩ : ∃ n, v = (of v).convergents n\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn : ℕ\nterminates : Terminates (of v)\n⊢ ∃ n, v = convergents (of v) n\ncase intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nexact of_correctness_of_terminates terminates\n[GOAL]\ncase intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nobtain ⟨q, conv_eq_q⟩ : ∃ q : ℚ, (of v).convergents n = (↑q : K)\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\n⊢ ∃ q, convergents (of v) n = ↑q\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\nq : ℚ\nconv_eq_q : convergents (of v) n = ↑q\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nexact exists_rat_eq_nth_convergent v n\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\nq : ℚ\nconv_eq_q : convergents (of v) n = ↑q\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nhave : v = (↑q : K) := Eq.trans v_eq_conv conv_eq_q\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nn✝ : ℕ\nterminates : Terminates (of v)\nn : ℕ\nv_eq_conv : v = convergents (of v) n\nq : ℚ\nconv_eq_q : convergents (of v) n = ↑q\nthis : v = ↑q\n⊢ ∃ q, v = ↑q\n[PROOFSTEP]\nuse q, this\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ mapFr Rat.cast (IntFractPair.of q) = IntFractPair.of v\n[PROOFSTEP]\nsimp [IntFractPair.of, v_eq_q]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n\n[PROOFSTEP]\ninduction' n with n IH\n[GOAL]\ncase zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q Nat.zero) = IntFractPair.stream v Nat.zero\ncase succ\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase zero =>\n -- Porting note: was\n -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]simp only [IntFractPair.stream, Option.map_some',\n coe_of_rat_eq v_eq_q]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q Nat.zero) = IntFractPair.stream v Nat.zero\n[PROOFSTEP]\ncase zero =>\n -- Porting note: was\n -- simp [IntFractPair.stream, coe_of_rat_eq v_eq_q]simp only [IntFractPair.stream, Option.map_some',\n coe_of_rat_eq v_eq_q]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q Nat.zero) = IntFractPair.stream v Nat.zero\n[PROOFSTEP]\nsimp only [IntFractPair.stream, Option.map_some', coe_of_rat_eq v_eq_q]\n[GOAL]\ncase succ\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase succ =>\n rw [v_eq_q] at IH \n cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n\n case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]\n case some =>\n cases' ifp_n with b fr\n cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero\n · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]\n · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n; · rwa [stream_q_nth_eq] at IH \n have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast\n have coe_of_fr := coe_of_rat_eq this\n simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase succ =>\n rw [v_eq_q] at IH \n cases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n\n case none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]\n case some =>\n cases' ifp_n with b fr\n cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero\n · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]\n · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n; · rwa [stream_q_nth_eq] at IH \n have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast\n have coe_of_fr := coe_of_rat_eq this\n simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream v n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nrw [v_eq_q] at IH \n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncases' stream_q_nth_eq : IntFractPair.stream q n with ifp_n\n[GOAL]\ncase none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nstream_q_nth_eq : IntFractPair.stream q n = none\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nifp_n : IntFractPair ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some ifp_n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nstream_q_nth_eq : IntFractPair.stream q n = none\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase none => simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nstream_q_nth_eq : IntFractPair.stream q n = none\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nsimp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq]\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nifp_n : IntFractPair ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some ifp_n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase some =>\n cases' ifp_n with b fr\n cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero\n · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]\n · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n; · rwa [stream_q_nth_eq] at IH \n have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast\n have coe_of_fr := coe_of_rat_eq this\n simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nifp_n : IntFractPair ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some ifp_n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncase some =>\n cases' ifp_n with b fr\n cases' Decidable.em (fr = 0) with fr_zero fr_ne_zero\n · simp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]\n · replace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n; · rwa [stream_q_nth_eq] at IH \n have : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast\n have coe_of_fr := coe_of_rat_eq this\n simpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nifp_n : IntFractPair ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some ifp_n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncases' ifp_n with b fr\n[GOAL]\ncase mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\ncases' Decidable.em (fr = 0) with fr_zero fr_ne_zero\n[GOAL]\ncase mk.inl\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_zero : fr = 0\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nsimp [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_zero]\n[GOAL]\ncase mk.inr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nreplace IH : some (IntFractPair.mk b (fr : K)) = IntFractPair.stream (↑q) n\n[GOAL]\ncase IH\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nIH : Option.map (mapFr Rat.cast) (IntFractPair.stream q n) = IntFractPair.stream (↑q) n\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\n⊢ some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n\n[PROOFSTEP]\nrwa [stream_q_nth_eq] at IH \n[GOAL]\ncase mk.inr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\nIH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nhave : (fr : K)⁻¹ = ((fr⁻¹ : ℚ) : K) := by norm_cast\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\nIH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n\n⊢ (↑fr)⁻¹ = ↑fr⁻¹\n[PROOFSTEP]\nnorm_cast\n[GOAL]\ncase mk.inr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\nIH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n\nthis : (↑fr)⁻¹ = ↑fr⁻¹\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nhave coe_of_fr := coe_of_rat_eq this\n[GOAL]\ncase mk.inr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\nb : ℤ\nfr : ℚ\nstream_q_nth_eq : IntFractPair.stream q n = some { b := b, fr := fr }\nfr_ne_zero : ¬fr = 0\nIH : some { b := b, fr := ↑fr } = IntFractPair.stream (↑q) n\nthis : (↑fr)⁻¹ = ↑fr⁻¹\ncoe_of_fr : mapFr Rat.cast (IntFractPair.of fr⁻¹) = IntFractPair.of (↑fr)⁻¹\n⊢ Option.map (mapFr Rat.cast) (IntFractPair.stream q (Nat.succ n)) = IntFractPair.stream v (Nat.succ n)\n[PROOFSTEP]\nsimpa [IntFractPair.stream, IH.symm, v_eq_q, stream_q_nth_eq, fr_ne_zero]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Stream'.map (Option.map (mapFr Rat.cast)) (IntFractPair.stream q) = IntFractPair.stream v\n[PROOFSTEP]\nfunext n\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\n⊢ Stream'.map (Option.map (mapFr Rat.cast)) (IntFractPair.stream q) n = IntFractPair.stream v n\n[PROOFSTEP]\nexact IntFractPair.coe_stream_nth_rat_eq v_eq_q n\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ ↑(of q).h = (of v).h\n[PROOFSTEP]\nunfold of IntFractPair.seq1\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ ↑(match\n (IntFractPair.of q,\n Stream'.Seq.tail\n { val := IntFractPair.stream q, property := (_ : Stream'.IsSeq (IntFractPair.stream q)) }) with\n | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h =\n (match\n (IntFractPair.of v,\n Stream'.Seq.tail\n { val := IntFractPair.stream v, property := (_ : Stream'.IsSeq (IntFractPair.stream v)) }) with\n | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h\n[PROOFSTEP]\nrw [← IntFractPair.coe_of_rat_eq v_eq_q]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ ↑(match\n (IntFractPair.of q,\n Stream'.Seq.tail\n { val := IntFractPair.stream q, property := (_ : Stream'.IsSeq (IntFractPair.stream q)) }) with\n | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h =\n (match\n (IntFractPair.mapFr Rat.cast (IntFractPair.of q),\n Stream'.Seq.tail\n { val := IntFractPair.stream v, property := (_ : Stream'.IsSeq (IntFractPair.stream v)) }) with\n | (h, s) => { h := ↑h.b, s := Stream'.Seq.map (fun p => { a := 1, b := ↑p.b }) s }).h\n[PROOFSTEP]\nsimp\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = Stream'.Seq.get? (of v).s n\n[PROOFSTEP]\nsimp only [of, IntFractPair.seq1, Stream'.Seq.map_get?, Stream'.Seq.get?_tail]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (Pair.map Rat.cast)\n (Option.map (fun p => { a := 1, b := ↑p.b })\n (Stream'.Seq.get? { val := IntFractPair.stream q, property := (_ : Stream'.IsSeq (IntFractPair.stream q)) }\n (n + 1))) =\n Option.map (fun p => { a := 1, b := ↑p.b })\n (Stream'.Seq.get? { val := IntFractPair.stream v, property := (_ : Stream'.IsSeq (IntFractPair.stream v)) }\n (n + 1))\n[PROOFSTEP]\nsimp only [Stream'.Seq.get?]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (Pair.map Rat.cast) (Option.map (fun p => { a := 1, b := ↑p.b }) (IntFractPair.stream q (n + 1))) =\n Option.map (fun p => { a := 1, b := ↑p.b }) (IntFractPair.stream v (n + 1))\n[PROOFSTEP]\nrw [← IntFractPair.coe_stream'_rat_eq v_eq_q]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Option.map (Pair.map Rat.cast) (Option.map (fun p => { a := 1, b := ↑p.b }) (IntFractPair.stream q (n + 1))) =\n Option.map (fun p => { a := 1, b := ↑p.b })\n (Stream'.map (Option.map (IntFractPair.mapFr Rat.cast)) (IntFractPair.stream q) (n + 1))\n[PROOFSTEP]\nrcases succ_nth_stream_eq : IntFractPair.stream q (n + 1) with (_ | ⟨_, _⟩)\n[GOAL]\ncase none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nsucc_nth_stream_eq : IntFractPair.stream q (n + 1) = none\n⊢ Option.map (Pair.map Rat.cast) (Option.map (fun p => { a := 1, b := ↑p.b }) none) =\n Option.map (fun p => { a := 1, b := ↑p.b })\n (Stream'.map (Option.map (IntFractPair.mapFr Rat.cast)) (IntFractPair.stream q) (n + 1))\n[PROOFSTEP]\nsimp [Stream'.map, Stream'.nth, succ_nth_stream_eq]\n[GOAL]\ncase some.mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nb✝ : ℤ\nfr✝ : ℚ\nsucc_nth_stream_eq : IntFractPair.stream q (n + 1) = some { b := b✝, fr := fr✝ }\n⊢ Option.map (Pair.map Rat.cast) (Option.map (fun p => { a := 1, b := ↑p.b }) (some { b := b✝, fr := fr✝ })) =\n Option.map (fun p => { a := 1, b := ↑p.b })\n (Stream'.map (Option.map (IntFractPair.mapFr Rat.cast)) (IntFractPair.stream q) (n + 1))\n[PROOFSTEP]\nsimp [Stream'.map, Stream'.nth, succ_nth_stream_eq]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ Stream'.Seq.map (Pair.map Rat.cast) (of q).s = (of v).s\n[PROOFSTEP]\next n\n[GOAL]\ncase h.a\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\na✝ : Pair K\n⊢ a✝ ∈ Stream'.Seq.get? (Stream'.Seq.map (Pair.map Rat.cast) (of q).s) n ↔ a✝ ∈ Stream'.Seq.get? (of v).s n\n[PROOFSTEP]\nrw [← coe_of_s_get?_rat_eq v_eq_q]\n[GOAL]\ncase h.a\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn✝ n : ℕ\na✝ : Pair K\n⊢ a✝ ∈ Stream'.Seq.get? (Stream'.Seq.map (Pair.map Rat.cast) (of q).s) n ↔\n a✝ ∈ Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n)\n[PROOFSTEP]\nrfl\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\n⊢ { h := ↑(of q).h, s := Stream'.Seq.map (Pair.map Rat.cast) (of q).s } = of v\n[PROOFSTEP]\ncases' gcf_v_eq : of v with h s\n[GOAL]\ncase mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : K\ns : Stream'.Seq (Pair K)\ngcf_v_eq : of v = { h := h, s := s }\n⊢ { h := ↑(of q).h, s := Stream'.Seq.map (Pair.map Rat.cast) (of q).s } = { h := h, s := s }\n[PROOFSTEP]\nsubst v\n[GOAL]\ncase mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nh : K\ns : Stream'.Seq (Pair K)\ngcf_v_eq : of ↑q = { h := h, s := s }\n⊢ { h := ↑(of q).h, s := Stream'.Seq.map (Pair.map Rat.cast) (of q).s } = { h := h, s := s }\n[PROOFSTEP]\nobtain rfl : ↑⌊(q : K)⌋ = h := by injection gcf_v_eq\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nh : K\ns : Stream'.Seq (Pair K)\ngcf_v_eq : of ↑q = { h := h, s := s }\n⊢ ↑⌊↑q⌋ = h\n[PROOFSTEP]\ninjection gcf_v_eq\n[GOAL]\ncase mk\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\ns : Stream'.Seq (Pair K)\ngcf_v_eq : of ↑q = { h := ↑⌊↑q⌋, s := s }\n⊢ { h := ↑(of q).h, s := Stream'.Seq.map (Pair.map Rat.cast) (of q).s } = { h := ↑⌊↑q⌋, s := s }\n[PROOFSTEP]\nsimp only [gcf_v_eq, Int.cast_inj, Rat.floor_cast, of_h_eq_floor, eq_self_iff_true, Rat.cast_coe_int, and_self,\n coe_of_h_rat_eq rfl, coe_of_s_rat_eq rfl]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\n⊢ Terminates (of v) ↔ Terminates (of q)\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase mp\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\n⊢ Terminates (of v) → Terminates (of q)\n[PROOFSTEP]\nintro h\n[GOAL]\ncase mpr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\n⊢ Terminates (of q) → Terminates (of v)\n[PROOFSTEP]\nintro h\n[GOAL]\ncase mp\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nh : Terminates (of v)\n⊢ Terminates (of q)\n[PROOFSTEP]\ncases' h with n h\n[GOAL]\ncase mpr\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nh : Terminates (of q)\n⊢ Terminates (of v)\n[PROOFSTEP]\ncases' h with n h\n[GOAL]\ncase mp.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.TerminatedAt (of v).s n\n⊢ Terminates (of q)\n[PROOFSTEP]\nuse n\n[GOAL]\ncase mpr.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.TerminatedAt (of q).s n\n⊢ Terminates (of v)\n[PROOFSTEP]\nuse n\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.TerminatedAt (of v).s n\n⊢ Stream'.Seq.TerminatedAt (of q).s n\n[PROOFSTEP]\nsimp only [Stream'.Seq.TerminatedAt, (coe_of_s_get?_rat_eq v_eq_q n).symm] at h ⊢\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.TerminatedAt (of q).s n\n⊢ Stream'.Seq.TerminatedAt (of v).s n\n[PROOFSTEP]\nsimp only [Stream'.Seq.TerminatedAt, (coe_of_s_get?_rat_eq v_eq_q n).symm] at h ⊢\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = none\n⊢ Stream'.Seq.get? (of q).s n = none\n[PROOFSTEP]\ncases h' : (of q).s.get? n\n[GOAL]\ncase h\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.get? (of q).s n = none\n⊢ Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = none\n[PROOFSTEP]\ncases h' : (of q).s.get? n\n[GOAL]\ncase h.none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = none\nh' : Stream'.Seq.get? (of q).s n = none\n⊢ none = none\n[PROOFSTEP]\nsimp only [h'] at h \n[GOAL]\ncase h.some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Option.map (Pair.map Rat.cast) (Stream'.Seq.get? (of q).s n) = none\nval✝ : Pair ℚ\nh' : Stream'.Seq.get? (of q).s n = some val✝\n⊢ some val✝ = none\n[PROOFSTEP]\nsimp only [h'] at h \n[GOAL]\ncase h.none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh h' : Stream'.Seq.get? (of q).s n = none\n⊢ Option.map (Pair.map Rat.cast) none = none\n[PROOFSTEP]\nsimp only [h'] at h \n[GOAL]\ncase h.some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh : Stream'.Seq.get? (of q).s n = none\nval✝ : Pair ℚ\nh' : Stream'.Seq.get? (of q).s n = some val✝\n⊢ Option.map (Pair.map Rat.cast) (some val✝) = none\n[PROOFSTEP]\nsimp only [h'] at h \n[GOAL]\ncase h.none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh' : Stream'.Seq.get? (of q).s n = none\nh : Option.map (Pair.map Rat.cast) none = none\n⊢ none = none\n[PROOFSTEP]\ntrivial\n[GOAL]\ncase h.some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nval✝ : Pair ℚ\nh' : Stream'.Seq.get? (of q).s n = some val✝\nh : Option.map (Pair.map Rat.cast) (some val✝) = none\n⊢ some val✝ = none\n[PROOFSTEP]\ntrivial\n[GOAL]\ncase h.none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nv✝ : K\nq✝ : ℚ\nv_eq_q✝ : v✝ = ↑q✝\nn✝ : ℕ\nv : K\nq : ℚ\nv_eq_q : v = ↑q\nn : ℕ\nh' : Stream'.Seq.get? (of q).s n = none\nh : True\n⊢ Option.map (Pair.map Rat.cast) none = none\n[PROOFSTEP]\ntrivial\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\n⊢ ifp_succ_n.fr.num < ifp_n.fr.num\n[PROOFSTEP]\nobtain ⟨ifp_n', stream_nth_eq', ifp_n_fract_ne_zero, IntFractPair.of_eq_ifp_succ_n⟩ :\n ∃ ifp_n', IntFractPair.stream q n = some ifp_n' ∧ ifp_n'.fr ≠ 0 ∧ IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\n⊢ ∃ ifp_n', IntFractPair.stream q n = some ifp_n' ∧ ifp_n'.fr ≠ 0 ∧ IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\ncase intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nifp_n' : IntFractPair ℚ\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n'\nifp_n_fract_ne_zero : ifp_n'.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\n⊢ ifp_succ_n.fr.num < ifp_n.fr.num\n[PROOFSTEP]\nexact succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq\n[GOAL]\ncase intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nifp_n' : IntFractPair ℚ\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n'\nifp_n_fract_ne_zero : ifp_n'.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\n⊢ ifp_succ_n.fr.num < ifp_n.fr.num\n[PROOFSTEP]\nhave : ifp_n = ifp_n' := by injection Eq.trans stream_nth_eq.symm stream_nth_eq'\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nifp_n' : IntFractPair ℚ\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n'\nifp_n_fract_ne_zero : ifp_n'.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\n⊢ ifp_n = ifp_n'\n[PROOFSTEP]\ninjection Eq.trans stream_nth_eq.symm stream_nth_eq'\n[GOAL]\ncase intro.intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nifp_n' : IntFractPair ℚ\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n'\nifp_n_fract_ne_zero : ifp_n'.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n'.fr⁻¹ = ifp_succ_n\nthis : ifp_n = ifp_n'\n⊢ ifp_succ_n.fr.num < ifp_n.fr.num\n[PROOFSTEP]\ncases this\n[GOAL]\ncase intro.intro.intro.refl\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n\nifp_n_fract_ne_zero : ifp_n.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n\n⊢ ifp_succ_n.fr.num < ifp_n.fr.num\n[PROOFSTEP]\nrw [← IntFractPair.of_eq_ifp_succ_n]\n[GOAL]\ncase intro.intro.intro.refl\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n\nifp_n_fract_ne_zero : ifp_n.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n\n⊢ (IntFractPair.of ifp_n.fr⁻¹).fr.num < ifp_n.fr.num\n[PROOFSTEP]\ncases' nth_stream_fr_nonneg_lt_one stream_nth_eq with zero_le_ifp_n_fract ifp_n_fract_lt_one\n[GOAL]\ncase intro.intro.intro.refl.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n\nifp_n_fract_ne_zero : ifp_n.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n\nzero_le_ifp_n_fract : 0 ≤ ifp_n.fr\nifp_n_fract_lt_one : ifp_n.fr < 1\n⊢ (IntFractPair.of ifp_n.fr⁻¹).fr.num < ifp_n.fr.num\n[PROOFSTEP]\nhave : 0 < ifp_n.fr := lt_of_le_of_ne zero_le_ifp_n_fract <| ifp_n_fract_ne_zero.symm\n[GOAL]\ncase intro.intro.intro.refl.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_n ifp_succ_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nstream_succ_nth_eq : IntFractPair.stream q (n + 1) = some ifp_succ_n\nstream_nth_eq' : IntFractPair.stream q n = some ifp_n\nifp_n_fract_ne_zero : ifp_n.fr ≠ 0\nIntFractPair.of_eq_ifp_succ_n : IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n\nzero_le_ifp_n_fract : 0 ≤ ifp_n.fr\nifp_n_fract_lt_one : ifp_n.fr < 1\nthis : 0 < ifp_n.fr\n⊢ (IntFractPair.of ifp_n.fr⁻¹).fr.num < ifp_n.fr.num\n[PROOFSTEP]\nexact of_inv_fr_num_lt_num_of_pos this\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\n⊢ ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\n[PROOFSTEP]\ninduction' n with n IH\n[GOAL]\ncase zero\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q Nat.zero = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑Nat.zero\ncase succ\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q (Nat.succ n) = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\ncase zero =>\n intro ifp_zero stream_zero_eq\n have : IntFractPair.of q = ifp_zero := by injection stream_zero_eq\n simp [le_refl, this.symm]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q Nat.zero = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑Nat.zero\n[PROOFSTEP]\ncase zero =>\n intro ifp_zero stream_zero_eq\n have : IntFractPair.of q = ifp_zero := by injection stream_zero_eq\n simp [le_refl, this.symm]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q Nat.zero = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑Nat.zero\n[PROOFSTEP]\nintro ifp_zero stream_zero_eq\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_zero : IntFractPair ℚ\nstream_zero_eq : IntFractPair.stream q Nat.zero = some ifp_zero\n⊢ ifp_zero.fr.num ≤ (IntFractPair.of q).fr.num - ↑Nat.zero\n[PROOFSTEP]\nhave : IntFractPair.of q = ifp_zero := by injection stream_zero_eq\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_zero : IntFractPair ℚ\nstream_zero_eq : IntFractPair.stream q Nat.zero = some ifp_zero\n⊢ IntFractPair.of q = ifp_zero\n[PROOFSTEP]\ninjection stream_zero_eq\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn : ℕ\nifp_zero : IntFractPair ℚ\nstream_zero_eq : IntFractPair.stream q Nat.zero = some ifp_zero\nthis : IntFractPair.of q = ifp_zero\n⊢ ifp_zero.fr.num ≤ (IntFractPair.of q).fr.num - ↑Nat.zero\n[PROOFSTEP]\nsimp [le_refl, this.symm]\n[GOAL]\ncase succ\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q (Nat.succ n) = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\ncase succ =>\n intro ifp_succ_n stream_succ_nth_eq\n suffices ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - n\n by\n rw [Int.ofNat_succ, sub_add_eq_sub_sub]\n solve_by_elim [le_sub_right_of_add_le]\n rcases succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq with ⟨ifp_n, stream_nth_eq, -⟩\n have : ifp_succ_n.fr.num < ifp_n.fr.num := stream_succ_nth_fr_num_lt_nth_fr_num_rat stream_nth_eq stream_succ_nth_eq\n have : ifp_succ_n.fr.num + 1 ≤ ifp_n.fr.num := Int.add_one_le_of_lt this\n exact le_trans this (IH stream_nth_eq)\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q (Nat.succ n) = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\ncase succ =>\n intro ifp_succ_n stream_succ_nth_eq\n suffices ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - n\n by\n rw [Int.ofNat_succ, sub_add_eq_sub_sub]\n solve_by_elim [le_sub_right_of_add_le]\n rcases succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq with ⟨ifp_n, stream_nth_eq, -⟩\n have : ifp_succ_n.fr.num < ifp_n.fr.num := stream_succ_nth_fr_num_lt_nth_fr_num_rat stream_nth_eq stream_succ_nth_eq\n have : ifp_succ_n.fr.num + 1 ≤ ifp_n.fr.num := Int.add_one_le_of_lt this\n exact le_trans this (IH stream_nth_eq)\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ∀ {ifp_n : IntFractPair ℚ},\n IntFractPair.stream q (Nat.succ n) = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\nintro ifp_succ_n stream_succ_nth_eq\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\n⊢ ifp_succ_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\nsuffices ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - n\n by\n rw [Int.ofNat_succ, sub_add_eq_sub_sub]\n solve_by_elim [le_sub_right_of_add_le]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\nthis : ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ifp_succ_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑(Nat.succ n)\n[PROOFSTEP]\nrw [Int.ofNat_succ, sub_add_eq_sub_sub]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\nthis : ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n⊢ ifp_succ_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n - 1\n[PROOFSTEP]\nsolve_by_elim [le_sub_right_of_add_le]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\n⊢ ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n[PROOFSTEP]\nrcases succ_nth_stream_eq_some_iff.mp stream_succ_nth_eq with ⟨ifp_n, stream_nth_eq, -⟩\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\nifp_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\n⊢ ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n[PROOFSTEP]\nhave : ifp_succ_n.fr.num < ifp_n.fr.num := stream_succ_nth_fr_num_lt_nth_fr_num_rat stream_nth_eq stream_succ_nth_eq\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\nifp_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nthis : ifp_succ_n.fr.num < ifp_n.fr.num\n⊢ ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n[PROOFSTEP]\nhave : ifp_succ_n.fr.num + 1 ≤ ifp_n.fr.num := Int.add_one_le_of_lt this\n[GOAL]\ncase intro.intro\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq : ℚ\nn✝ n : ℕ\nIH : ∀ {ifp_n : IntFractPair ℚ}, IntFractPair.stream q n = some ifp_n → ifp_n.fr.num ≤ (IntFractPair.of q).fr.num - ↑n\nifp_succ_n : IntFractPair ℚ\nstream_succ_nth_eq : IntFractPair.stream q (Nat.succ n) = some ifp_succ_n\nifp_n : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp_n\nthis✝ : ifp_succ_n.fr.num < ifp_n.fr.num\nthis : ifp_succ_n.fr.num + 1 ≤ ifp_n.fr.num\n⊢ ifp_succ_n.fr.num + 1 ≤ (IntFractPair.of q).fr.num - ↑n\n[PROOFSTEP]\nexact le_trans this (IH stream_nth_eq)\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn : ℕ\nq : ℚ\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nlet fract_q_num := (Int.fract q).num\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nlet n := fract_q_num.natAbs + 1\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\ncases' stream_nth_eq : IntFractPair.stream q n with ifp\n[GOAL]\ncase none\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nstream_nth_eq : IntFractPair.stream q n = none\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nuse n, stream_nth_eq\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nhave ifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - n := stream_nth_fr_num_le_fr_num_sub_n_rat stream_nth_eq\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nhave : fract_q_num - n = -1 :=\n by\n have : 0 ≤ fract_q_num :=\n Rat.num_nonneg_iff_zero_le.mpr\n (Int.fract_nonneg q)\n -- Porting note: was\n -- simp [Int.natAbs_of_nonneg this, sub_add_eq_sub_sub_swap, sub_right_comm]\n simp only [Nat.cast_add, Int.natAbs_of_nonneg this, Nat.cast_one, sub_add_eq_sub_sub_swap, sub_right_comm, sub_self,\n zero_sub]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\n⊢ fract_q_num - ↑n = -1\n[PROOFSTEP]\nhave : 0 ≤ fract_q_num :=\n Rat.num_nonneg_iff_zero_le.mpr\n (Int.fract_nonneg q)\n -- Porting note: was\n -- simp [Int.natAbs_of_nonneg this, sub_add_eq_sub_sub_swap, sub_right_comm]\n[GOAL]\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\nthis : 0 ≤ fract_q_num\n⊢ fract_q_num - ↑n = -1\n[PROOFSTEP]\nsimp only [Nat.cast_add, Int.natAbs_of_nonneg this, Nat.cast_one, sub_add_eq_sub_sub_swap, sub_right_comm, sub_self,\n zero_sub]\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\nthis : fract_q_num - ↑n = -1\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nhave : 0 ≤ ifp.fr := (nth_stream_fr_nonneg_lt_one stream_nth_eq).left\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\nthis✝ : fract_q_num - ↑n = -1\nthis : 0 ≤ ifp.fr\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nhave : 0 ≤ ifp.fr.num := Rat.num_nonneg_iff_zero_le.mpr this\n[GOAL]\ncase some\nK : Type u_1\ninst✝¹ : LinearOrderedField K\ninst✝ : FloorRing K\nq✝ : ℚ\nn✝ : ℕ\nq : ℚ\nfract_q_num : ℤ := (Int.fract q).num\nn : ℕ := Int.natAbs fract_q_num + 1\nifp : IntFractPair ℚ\nstream_nth_eq : IntFractPair.stream q n = some ifp\nifp_fr_num_le_q_fr_num_sub_n : ifp.fr.num ≤ fract_q_num - ↑n\nthis✝¹ : fract_q_num - ↑n = -1\nthis✝ : 0 ≤ ifp.fr\nthis : 0 ≤ ifp.fr.num\n⊢ ∃ n, IntFractPair.stream q n = none\n[PROOFSTEP]\nlinarith\n", "meta": {"mathlib_filename": "Mathlib.Algebra.ContinuedFractions.Computation.TerminatesIffRat", "llama_tokens": 30015, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8757869851639066, "lm_q2_score": 0.7931059536292271, "lm_q1q2_score": 0.6945918720444859}} {"text": "[GOAL]\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀\nh : Commute a b\n⊢ inverse (a * b) = inverse b * inverse a\n[PROOFSTEP]\nby_cases hab : IsUnit (a * b)\n[GOAL]\ncase pos\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀\nh : Commute a b\nhab : IsUnit (a * b)\n⊢ inverse (a * b) = inverse b * inverse a\n[PROOFSTEP]\nobtain ⟨⟨a, rfl⟩, b, rfl⟩ := h.isUnit_mul_iff.mp hab\n[GOAL]\ncase pos.intro.intro.intro\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀ˣ\nh : Commute ↑a ↑b\nhab : IsUnit (↑a * ↑b)\n⊢ inverse (↑a * ↑b) = inverse ↑b * inverse ↑a\n[PROOFSTEP]\nrw [← Units.val_mul, inverse_unit, inverse_unit, inverse_unit, ← Units.val_mul, mul_inv_rev]\n[GOAL]\ncase neg\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀\nh : Commute a b\nhab : ¬IsUnit (a * b)\n⊢ inverse (a * b) = inverse b * inverse a\n[PROOFSTEP]\nobtain ha | hb := not_and_or.mp (mt h.isUnit_mul_iff.mpr hab)\n[GOAL]\ncase neg.inl\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀\nh : Commute a b\nhab : ¬IsUnit (a * b)\nha : ¬IsUnit a\n⊢ inverse (a * b) = inverse b * inverse a\n[PROOFSTEP]\nrw [inverse_non_unit _ hab, inverse_non_unit _ ha, mul_zero]\n[GOAL]\ncase neg.inr\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝ : MonoidWithZero M₀\na b : M₀\nh : Commute a b\nhab : ¬IsUnit (a * b)\nhb : ¬IsUnit b\n⊢ inverse (a * b) = inverse b * inverse a\n[PROOFSTEP]\nrw [inverse_non_unit _ hab, inverse_non_unit _ hb, zero_mul]\n[GOAL]\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝¹ : MonoidWithZero M₀\ninst✝ : GroupWithZero G₀\na b c : G₀\nhac : Commute a c\nhbc : Commute b c\n⊢ Commute (a / b) c\n[PROOFSTEP]\nrw [div_eq_mul_inv]\n[GOAL]\nα : Type u_1\nM₀ : Type u_2\nG₀ : Type u_3\nM₀' : Type u_4\nG₀' : Type u_5\nF : Type u_6\nF' : Type u_7\ninst✝¹ : MonoidWithZero M₀\ninst✝ : GroupWithZero G₀\na b c : G₀\nhac : Commute a c\nhbc : Commute b c\n⊢ Commute (a * b⁻¹) c\n[PROOFSTEP]\nexact hac.mul_left hbc.inv_left₀\n", "meta": {"mathlib_filename": "Mathlib.Algebra.GroupWithZero.Commute", "llama_tokens": 1194, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8807970873650401, "lm_q2_score": 0.7879312031126512, "lm_q1q2_score": 0.694007508745655}} {"text": "[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\n⊢ e₁ = e₂\n[PROOFSTEP]\nsimpa only [h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id] using distrib e₂ e₁ e₁ e₂\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\n⊢ m₁ = m₂\n[PROOFSTEP]\nfunext a b\n[GOAL]\ncase h.h\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b : X\n⊢ m₁ a b = m₂ a b\n[PROOFSTEP]\ncalc\n m₁ a b = m₁ (m₂ a e₁) (m₂ e₁ b) := by {simp only [one h₁ h₂ distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]\n }\n _ = m₂ a b := by simp only [distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b : X\n⊢ m₁ a b = m₁ (m₂ a e₁) (m₂ e₁ b)\n[PROOFSTEP]\n{simp only [one h₁ h₂ distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]\n}\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b : X\n⊢ m₁ a b = m₁ (m₂ a e₁) (m₂ e₁ b)\n[PROOFSTEP]\nsimp only [one h₁ h₂ distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b : X\n⊢ m₁ (m₂ a e₁) (m₂ e₁ b) = m₂ a b\n[PROOFSTEP]\nsimp only [distrib, h₁.left_id, h₁.right_id, h₂.left_id, h₂.right_id]\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b : X\n⊢ m₂ a b = m₂ b a\n[PROOFSTEP]\nsimpa [mul h₁ h₂ distrib, h₂.left_id, h₂.right_id] using distrib e₂ a b e₂\n[GOAL]\nX : Type u\nm₁ m₂ : X → X → X\ne₁ e₂ : X\nh₁ : IsUnital m₁ e₁\nh₂ : IsUnital m₂ e₂\ndistrib : ∀ (a b c d : X), m₁ (m₂ a b) (m₂ c d) = m₂ (m₁ a c) (m₁ b d)\na b c : X\n⊢ m₂ (m₂ a b) c = m₂ a (m₂ b c)\n[PROOFSTEP]\nsimpa [mul h₁ h₂ distrib, h₂.left_id, h₂.right_id] using distrib a b e₂ c\n", "meta": {"mathlib_filename": "Mathlib.GroupTheory.EckmannHilton", "llama_tokens": 1304, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8856314677809303, "lm_q2_score": 0.7826624738835052, "lm_q1q2_score": 0.6931505155225027}} {"text": "[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh : X ≃ₜ Y\n⊢ Homotopic (comp (toContinuousMap (Homeomorph.symm h)) (toContinuousMap h)) (ContinuousMap.id X)\n[PROOFSTEP]\nrw [symm_comp_toContinuousMap]\n[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh : X ≃ₜ Y\n⊢ Homotopic (comp (toContinuousMap h) (toContinuousMap (Homeomorph.symm h))) (ContinuousMap.id Y)\n[PROOFSTEP]\nrw [toContinuousMap_comp_symm]\n[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh₁ : X ≃ₕ Y\nh₂ : Y ≃ₕ Z\n⊢ Homotopic (comp (comp h₁.invFun h₂.invFun) (comp h₂.toFun h₁.toFun)) (ContinuousMap.id X)\n[PROOFSTEP]\nrefine Homotopic.trans ?_ h₁.left_inv\n[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh₁ : X ≃ₕ Y\nh₂ : Y ≃ₕ Z\n⊢ Homotopic (comp (comp h₁.invFun h₂.invFun) (comp h₂.toFun h₁.toFun)) (comp h₁.invFun h₁.toFun)\n[PROOFSTEP]\nexact ((Homotopic.refl _).hcomp h₂.left_inv).hcomp (Homotopic.refl _)\n[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh₁ : X ≃ₕ Y\nh₂ : Y ≃ₕ Z\n⊢ Homotopic (comp (comp h₂.toFun h₁.toFun) (comp h₁.invFun h₂.invFun)) (ContinuousMap.id Z)\n[PROOFSTEP]\nrefine Homotopic.trans ?_ h₂.right_inv\n[GOAL]\nX : Type u\nY : Type v\nZ : Type w\nZ' : Type x\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : TopologicalSpace Z\ninst✝ : TopologicalSpace Z'\nh₁ : X ≃ₕ Y\nh₂ : Y ≃ₕ Z\n⊢ Homotopic (comp (comp h₂.toFun h₁.toFun) (comp h₁.invFun h₂.invFun)) (comp h₂.toFun h₂.invFun)\n[PROOFSTEP]\nexact ((Homotopic.refl _).hcomp h₁.right_inv).hcomp (Homotopic.refl _)\n", "meta": {"mathlib_filename": "Mathlib.Topology.Homotopy.Equiv", "llama_tokens": 956, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8519527944504227, "lm_q2_score": 0.8128673155708975, "lm_q1q2_score": 0.6925245810180397}} {"text": "[GOAL]\nG : Type u_1\nH : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝⁶ : Group H\ninst✝⁵ : SMul G α\ninst✝⁴ : SMul G β\ninst✝³ : MulAction H α\ninst✝² : SMul H β\ninst✝¹ : SMulCommClass G H β\ninst✝ : SMulCommClass G H α\ns t : Set α\nb : β\ng : H\nh : Supports G s b\n⊢ Supports G (g • s) (g • b)\n[PROOFSTEP]\nrintro g' hg'\n[GOAL]\nG : Type u_1\nH : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝⁶ : Group H\ninst✝⁵ : SMul G α\ninst✝⁴ : SMul G β\ninst✝³ : MulAction H α\ninst✝² : SMul H β\ninst✝¹ : SMulCommClass G H β\ninst✝ : SMulCommClass G H α\ns t : Set α\nb : β\ng : H\nh : Supports G s b\ng' : G\nhg' : ∀ ⦃a : α⦄, a ∈ g • s → g' • a = a\n⊢ g' • g • b = g • b\n[PROOFSTEP]\nrw [smul_comm, h]\n[GOAL]\ncase a\nG : Type u_1\nH : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝⁶ : Group H\ninst✝⁵ : SMul G α\ninst✝⁴ : SMul G β\ninst✝³ : MulAction H α\ninst✝² : SMul H β\ninst✝¹ : SMulCommClass G H β\ninst✝ : SMulCommClass G H α\ns t : Set α\nb : β\ng : H\nh : Supports G s b\ng' : G\nhg' : ∀ ⦃a : α⦄, a ∈ g • s → g' • a = a\n⊢ ∀ ⦃a : α⦄, a ∈ s → g' • a = a\n[PROOFSTEP]\nrintro a ha\n[GOAL]\ncase a\nG : Type u_1\nH : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝⁶ : Group H\ninst✝⁵ : SMul G α\ninst✝⁴ : SMul G β\ninst✝³ : MulAction H α\ninst✝² : SMul H β\ninst✝¹ : SMulCommClass G H β\ninst✝ : SMulCommClass G H α\ns t : Set α\nb : β\ng : H\nh : Supports G s b\ng' : G\nhg' : ∀ ⦃a : α⦄, a ∈ g • s → g' • a = a\na : α\nha : a ∈ s\n⊢ g' • a = a\n[PROOFSTEP]\nhave := Set.ball_image_iff.1 hg' a ha\n[GOAL]\ncase a\nG : Type u_1\nH : Type u_2\nα : Type u_3\nβ : Type u_4\ninst✝⁶ : Group H\ninst✝⁵ : SMul G α\ninst✝⁴ : SMul G β\ninst✝³ : MulAction H α\ninst✝² : SMul H β\ninst✝¹ : SMulCommClass G H β\ninst✝ : SMulCommClass G H α\ns t : Set α\nb : β\ng : H\nh : Supports G s b\ng' : G\nhg' : ∀ ⦃a : α⦄, a ∈ g • s → g' • a = a\na : α\nha : a ∈ s\nthis : g' • g • a = g • a\n⊢ g' • a = a\n[PROOFSTEP]\nrwa [smul_comm, smul_left_cancel_iff] at this \n", "meta": {"mathlib_filename": "Mathlib.GroupTheory.GroupAction.Support", "llama_tokens": 1048, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8840392878563336, "lm_q2_score": 0.7826624738835052, "lm_q1q2_score": 0.6919043760438502}} {"text": "[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nι : Type u_5\n⊢ Module R (AlternatingMap R M N ι)\n[PROOFSTEP]\ninfer_instance\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\n⊢ ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] N\n[PROOFSTEP]\nsuffices (∀ i, AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] ∀ i, AlternatingMap R M N (Fin i)\n by\n refine' LinearMap.compr₂ this _\n refine' (LinearEquiv.toLinearMap _).comp (LinearMap.proj 0)\n exact AlternatingMap.constLinearEquivOfIsEmpty.symm\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nthis : ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] N\n[PROOFSTEP]\nrefine' LinearMap.compr₂ this _\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nthis : ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] N\n[PROOFSTEP]\nrefine' (LinearEquiv.toLinearMap _).comp (LinearMap.proj 0)\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nthis : ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ AlternatingMap R M N (Fin 0) ≃ₗ[R] N\n[PROOFSTEP]\nexact AlternatingMap.constLinearEquivOfIsEmpty.symm\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\n⊢ ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] ExteriorAlgebra R M →ₗ[R] (i : ℕ) → AlternatingMap R M N (Fin i)\n[PROOFSTEP]\nrefine' CliffordAlgebra.foldl _ _ _\n[GOAL]\ncase refine'_1\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\n⊢ M →ₗ[R] ((i : ℕ) → AlternatingMap R M N (Fin i)) →ₗ[R] (i : ℕ) → AlternatingMap R M N (Fin i)\n[PROOFSTEP]\nrefine'\n LinearMap.mk₂ R (fun m f i => (f i.succ).curryLeft m) (fun m₁ m₂ f => _) (fun c m f => _) (fun m f₁ f₂ => _)\n fun c m f => _\n[GOAL]\ncase refine'_1.refine'_1\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm₁ m₂ : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f\ncase refine'_1.refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f\ncase refine'_1.refine'_3\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nf₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂\ncase refine'_1.refine'_4\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f\n[PROOFSTEP]\nall_goals\n ext i : 1\n simp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add,\n AlternatingMap.curryLeft_smul, map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply]\n[GOAL]\ncase refine'_1.refine'_1\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm₁ m₂ : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f\n[PROOFSTEP]\next i : 1\n[GOAL]\ncase refine'_1.refine'_1.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm₁ m₂ : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\ni : ℕ\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f i =\n ((fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n i\n[PROOFSTEP]\nsimp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul,\n map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply]\n[GOAL]\ncase refine'_1.refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f\n[PROOFSTEP]\next i : 1\n[GOAL]\ncase refine'_1.refine'_2.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\ni : ℕ\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f i =\n (c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f) i\n[PROOFSTEP]\nsimp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul,\n map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply]\n[GOAL]\ncase refine'_1.refine'_3\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nf₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂\n[PROOFSTEP]\next i : 1\n[GOAL]\ncase refine'_1.refine'_3.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nf₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)\ni : ℕ\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) i =\n ((fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n i\n[PROOFSTEP]\nsimp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul,\n map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply]\n[GOAL]\ncase refine'_1.refine'_4\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f\n[PROOFSTEP]\next i : 1\n[GOAL]\ncase refine'_1.refine'_4.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nc : R\nm : M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\ni : ℕ\n⊢ (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) i =\n (c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f) i\n[PROOFSTEP]\nsimp only [map_smul, map_add, Pi.add_apply, Pi.smul_apply, AlternatingMap.curryLeft_add, AlternatingMap.curryLeft_smul,\n map_add, map_smul, LinearMap.add_apply, LinearMap.smul_apply]\n[GOAL]\ncase refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\n⊢ ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x\n[PROOFSTEP]\nintro m x\n[GOAL]\ncase refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nx : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x\n[PROOFSTEP]\ndsimp only [LinearMap.mk₂_apply, QuadraticForm.coeFn_zero, Pi.zero_apply]\n[GOAL]\ncase refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nx : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun i => ↑(AlternatingMap.curryLeft (↑(AlternatingMap.curryLeft (x (Nat.succ (Nat.succ i)))) m)) m) = 0 • x\n[PROOFSTEP]\nsimp_rw [zero_smul]\n[GOAL]\ncase refine'_2\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nx : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (fun i => ↑(AlternatingMap.curryLeft (↑(AlternatingMap.curryLeft (x (Nat.succ (Nat.succ i)))) m)) m) = 0\n[PROOFSTEP]\next i : 1\n[GOAL]\ncase refine'_2.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nm : M\nx : (i : ℕ) → AlternatingMap R M N (Fin i)\ni : ℕ\n⊢ ↑(AlternatingMap.curryLeft (↑(AlternatingMap.curryLeft (x (Nat.succ (Nat.succ i)))) m)) m = OfNat.ofNat 0 i\n[PROOFSTEP]\nexact AlternatingMap.curryLeft_same _ _\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\n⊢ ↑(↑liftAlternating f) (↑(ι R) m) = ↑(f 1) ![m]\n[PROOFSTEP]\ndsimp [liftAlternating]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\n⊢ ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n f)\n (↑(ι R) m) 0)\n 0 =\n ↑(f 1) ![m]\n[PROOFSTEP]\nrw [foldl_ι, LinearMap.mk₂_apply, AlternatingMap.curryLeft_apply_apply]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\n⊢ ↑(f (Nat.succ 0)) (Matrix.vecCons m 0) = ↑(f 1) ![m]\n[PROOFSTEP]\ncongr\n -- porting note: In Lean 3, `congr` could use the `[Subsingleton (Fin 0 → M)]` instance to finish\n -- the proof. Here, the instance can be synthesized but `congr` does not use it so the following\n -- line is provided.\n[GOAL]\ncase h.e_6.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\n⊢ Matrix.vecCons m 0 = ![m]\n[PROOFSTEP]\nrw [Matrix.zero_empty]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\nx : ExteriorAlgebra R M\n⊢ ↑(↑liftAlternating f) (↑(ι R) m * x) = ↑(↑liftAlternating fun i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) x\n[PROOFSTEP]\ndsimp [liftAlternating]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\nx : ExteriorAlgebra R M\n⊢ ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n f)\n (↑(ι R) m * x) 0)\n 0 =\n ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n fun i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n x 0)\n 0\n[PROOFSTEP]\nrw [foldl_mul, foldl_ι]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nm : M\nx : ExteriorAlgebra R M\n⊢ ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n f))\n x 0)\n 0 =\n ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n fun i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n x 0)\n 0\n[PROOFSTEP]\nrfl\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑liftAlternating f) 1 = ↑(f 0) 0\n[PROOFSTEP]\ndsimp [liftAlternating]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑(↑(foldl 0\n (LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n (_ :\n ∀ (m : M) (x : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n (↑(↑(LinearMap.mk₂ R (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)\n (_ :\n ∀ (m₁ m₂ : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (m₁ + m₂) f =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₁ f +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m₂ f)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) (c • m) f =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f)\n (_ :\n ∀ (m : M) (f₁ f₂ : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (f₁ + f₂) =\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₁ +\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f₂)\n (_ :\n ∀ (c : R) (m : M) (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m (c • f) =\n c • (fun m f i => ↑(AlternatingMap.curryLeft (f (Nat.succ i))) m) m f))\n m)\n x) =\n ↑0 m • x))\n f)\n 1 0)\n 0 =\n ↑(f 0) 0\n[PROOFSTEP]\nrw [foldl_one]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nr : R\n⊢ ↑(↑liftAlternating f) (↑(algebraMap R (ExteriorAlgebra R M)) r) = r • ↑(f 0) 0\n[PROOFSTEP]\nrw [Algebra.algebraMap_eq_smul_one, map_smul, liftAlternating_one]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn : ℕ\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin n → M\n⊢ ↑(↑liftAlternating f) (↑(ιMulti R n) v) = ↑(f n) v\n[PROOFSTEP]\nrw [ιMulti_apply]\n -- porting note: `v` is generalized automatically so it was removed from the next line\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn : ℕ\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin n → M\n⊢ ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f n) v\n[PROOFSTEP]\ninduction' n with n ih generalizing f\n[GOAL]\ncase zero\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n → M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin Nat.zero → M\n⊢ ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f Nat.zero) v\n[PROOFSTEP]\nletI : Subsingleton (Fin 0 → M) := by infer_instance\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n → M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin Nat.zero → M\n⊢ Subsingleton (Fin 0 → M)\n[PROOFSTEP]\ninfer_instance\n[GOAL]\ncase zero\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n → M\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin Nat.zero → M\nthis : Subsingleton (Fin 0 → M) := inferInstance\n⊢ ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f Nat.zero) v\n[PROOFSTEP]\nrw [List.ofFn_zero, List.prod_nil, liftAlternating_one, Subsingleton.elim 0 v]\n[GOAL]\ncase succ\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn✝ : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n✝ → M\nn : ℕ\nih :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)) (v : Fin n → M),\n ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f n) v\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin (Nat.succ n) → M\n⊢ ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f (Nat.succ n)) v\n[PROOFSTEP]\nrw [List.ofFn_succ, List.prod_cons, liftAlternating_ι_mul, ih, AlternatingMap.curryLeft_apply_apply]\n[GOAL]\ncase succ\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn✝ : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n✝ → M\nn : ℕ\nih :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)) (v : Fin n → M),\n ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f n) v\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin (Nat.succ n) → M\n⊢ ↑(f (Nat.succ n)) (Matrix.vecCons (v 0) fun i => v (Fin.succ i)) = ↑(f (Nat.succ n)) v\n[PROOFSTEP]\ncongr\n[GOAL]\ncase succ.h.e_6.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nn✝ : ℕ\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nv✝ : Fin n✝ → M\nn : ℕ\nih :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)) (v : Fin n → M),\n ↑(↑liftAlternating f) (List.prod (List.ofFn fun i => ↑(ι R) (v i))) = ↑(f n) v\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : Fin (Nat.succ n) → M\n⊢ (Matrix.vecCons (v 0) fun i => v (Fin.succ i)) = v\n[PROOFSTEP]\nexact Matrix.cons_head_tail _\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ (↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) = LinearMap.comp g (↑liftAlternating f)\n[PROOFSTEP]\next v\n[GOAL]\ncase h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : ExteriorAlgebra R M\n⊢ ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) v = ↑(LinearMap.comp g (↑liftAlternating f)) v\n[PROOFSTEP]\nrw [LinearMap.comp_apply]\n[GOAL]\ncase h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\nv : ExteriorAlgebra R M\n⊢ ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) v = ↑g (↑(↑liftAlternating f) v)\n[PROOFSTEP]\ninduction' v using CliffordAlgebra.left_induction with r x y hx hy x m hx generalizing f\n[GOAL]\ncase h.hr\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nr : R\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) (↑(algebraMap R (CliffordAlgebra 0)) r) =\n ↑g (↑(↑liftAlternating f) (↑(algebraMap R (CliffordAlgebra 0)) r))\n[PROOFSTEP]\nrw [liftAlternating_algebraMap, liftAlternating_algebraMap, map_smul, LinearMap.compAlternatingMap_apply]\n[GOAL]\ncase h.h_add\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nx y : CliffordAlgebra 0\nhx :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) x = ↑g (↑(↑liftAlternating f) x)\nhy :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) y = ↑g (↑(↑liftAlternating f) y)\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) (x + y) = ↑g (↑(↑liftAlternating f) (x + y))\n[PROOFSTEP]\nrw [map_add, map_add, map_add, hx, hy]\n[GOAL]\ncase h.h_mul_ι\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nx : CliffordAlgebra 0\nm : M\nhx :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) x = ↑g (↑(↑liftAlternating f) x)\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) (↑(CliffordAlgebra.ι 0) m * x) =\n ↑g (↑(↑liftAlternating f) (↑(CliffordAlgebra.ι 0) m * x))\n[PROOFSTEP]\nrw [liftAlternating_ι_mul, liftAlternating_ι_mul, ← hx]\n[GOAL]\ncase h.h_mul_ι\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\ng : N →ₗ[R] N'\nf✝ : (i : ℕ) → AlternatingMap R M N (Fin i)\nx : CliffordAlgebra 0\nm : M\nhx :\n ∀ (f : (i : ℕ) → AlternatingMap R M N (Fin i)),\n ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (f i)) x = ↑g (↑(↑liftAlternating f) x)\nf : (i : ℕ) → AlternatingMap R M N (Fin i)\n⊢ ↑(↑liftAlternating fun i => ↑(AlternatingMap.curryLeft (↑(LinearMap.compAlternatingMap g) (f (Nat.succ i)))) m) x =\n ↑(↑liftAlternating fun i => ↑(LinearMap.compAlternatingMap g) (↑(AlternatingMap.curryLeft (f (Nat.succ i))) m)) x\n[PROOFSTEP]\nsimp_rw [AlternatingMap.curryLeft_compAlternatingMap]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\n⊢ ↑liftAlternating (ιMulti R) = LinearMap.id\n[PROOFSTEP]\next v\n[GOAL]\ncase h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nv : ExteriorAlgebra R M\n⊢ ↑(↑liftAlternating (ιMulti R)) v = ↑LinearMap.id v\n[PROOFSTEP]\ndsimp\n[GOAL]\ncase h\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nv : ExteriorAlgebra R M\n⊢ ↑(↑liftAlternating (ιMulti R)) v = v\n[PROOFSTEP]\ninduction' v using CliffordAlgebra.left_induction with r x y hx hy x m hx\n[GOAL]\ncase h.hr\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nr : R\n⊢ ↑(↑liftAlternating (ιMulti R)) (↑(algebraMap R (CliffordAlgebra 0)) r) = ↑(algebraMap R (CliffordAlgebra 0)) r\n[PROOFSTEP]\nrw [liftAlternating_algebraMap, ιMulti_zero_apply, Algebra.algebraMap_eq_smul_one]\n[GOAL]\ncase h.h_add\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nx y : CliffordAlgebra 0\nhx : ↑(↑liftAlternating (ιMulti R)) x = x\nhy : ↑(↑liftAlternating (ιMulti R)) y = y\n⊢ ↑(↑liftAlternating (ιMulti R)) (x + y) = x + y\n[PROOFSTEP]\nrw [map_add, hx, hy]\n[GOAL]\ncase h.h_mul_ι\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nx : CliffordAlgebra 0\nm : M\nhx : ↑(↑liftAlternating (ιMulti R)) x = x\n⊢ ↑(↑liftAlternating (ιMulti R)) (↑(CliffordAlgebra.ι 0) m * x) = ↑(CliffordAlgebra.ι 0) m * x\n[PROOFSTEP]\nsimp_rw [liftAlternating_ι_mul, ιMulti_succ_curryLeft, liftAlternating_comp, LinearMap.comp_apply,\n LinearMap.mulLeft_apply, hx]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nN' : Type u_4\ninst✝⁶ : CommRing R\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : AddCommGroup N\ninst✝³ : AddCommGroup N'\ninst✝² : Module R M\ninst✝¹ : Module R N\ninst✝ : Module R N'\nF : ExteriorAlgebra R M →ₗ[R] N\n⊢ LinearMap.comp F (↑liftAlternating fun i => ιMulti R i) = F\n[PROOFSTEP]\nrw [liftAlternating_ιMulti, LinearMap.comp_id]\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.ExteriorAlgebra.OfAlternating", "llama_tokens": 27203, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8991213772699435, "lm_q2_score": 0.76908023177796, "lm_q1q2_score": 0.6914964772272868}} {"text": "[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : PartialOrder α\ninst✝ : TopologicalSpace β\na : α\nf : α → β\n⊢ ContinuousWithinAt f (Ioi a) a ↔ ContinuousWithinAt f (Ici a) a\n[PROOFSTEP]\nsimp only [← Ici_diff_left, continuousWithinAt_diff_self]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\n⊢ 𝓝[Iic a] a ⊔ 𝓝[Ici a] a = 𝓝 a\n[PROOFSTEP]\nrw [← nhdsWithin_union, Iic_union_Ici, nhdsWithin_univ]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\n⊢ 𝓝[Iio a] a ⊔ 𝓝[Ici a] a = 𝓝 a\n[PROOFSTEP]\nrw [← nhdsWithin_union, Iio_union_Ici, nhdsWithin_univ]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\n⊢ 𝓝[Iic a] a ⊔ 𝓝[Ioi a] a = 𝓝 a\n[PROOFSTEP]\nrw [← nhdsWithin_union, Iic_union_Ioi, nhdsWithin_univ]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\n⊢ 𝓝[Iio a] a ⊔ 𝓝[Ioi a] a = 𝓝[{a}ᶜ] a\n[PROOFSTEP]\nrw [← nhdsWithin_union, Iio_union_Ioi]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\nf : α → β\n⊢ ContinuousAt f a ↔ ContinuousWithinAt f (Iic a) a ∧ ContinuousWithinAt f (Ici a) a\n[PROOFSTEP]\nsimp only [ContinuousWithinAt, ContinuousAt, ← tendsto_sup, nhds_left_sup_nhds_right]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝² : TopologicalSpace α\ninst✝¹ : LinearOrder α\ninst✝ : TopologicalSpace β\na : α\nf : α → β\n⊢ ContinuousAt f a ↔ ContinuousWithinAt f (Iio a) a ∧ ContinuousWithinAt f (Ioi a) a\n[PROOFSTEP]\nrw [continuousWithinAt_Ioi_iff_Ici, continuousWithinAt_Iio_iff_Iic, continuousAt_iff_continuous_left_right]\n", "meta": {"mathlib_filename": "Mathlib.Topology.Algebra.Order.LeftRight", "llama_tokens": 880, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8652240825770432, "lm_q2_score": 0.795658090372256, "lm_q1q2_score": 0.6884225412873373}} {"text": "[GOAL]\nx : ℂ\n⊢ Real.sin (arg x) = x.im / ↑abs x\n[PROOFSTEP]\nunfold arg\n[GOAL]\nx : ℂ\n⊢ Real.sin\n (if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then arcsin ((-x).im / ↑abs x) + π else arcsin ((-x).im / ↑abs x) - π) =\n x.im / ↑abs x\n[PROOFSTEP]\nsplit_ifs\n[GOAL]\ncase pos\nx : ℂ\nh✝ : 0 ≤ x.re\n⊢ Real.sin (arcsin (x.im / ↑abs x)) = x.im / ↑abs x\n[PROOFSTEP]\nsimp [sub_eq_add_neg, arg,\n Real.sin_arcsin (abs_le.1 (abs_im_div_abs_le_one x)).1 (abs_le.1 (abs_im_div_abs_le_one x)).2, Real.sin_add, neg_div,\n Real.arcsin_neg, Real.sin_neg]\n[GOAL]\ncase pos\nx : ℂ\nh✝¹ : ¬0 ≤ x.re\nh✝ : 0 ≤ x.im\n⊢ Real.sin (arcsin ((-x).im / ↑abs x) + π) = x.im / ↑abs x\n[PROOFSTEP]\nsimp [sub_eq_add_neg, arg,\n Real.sin_arcsin (abs_le.1 (abs_im_div_abs_le_one x)).1 (abs_le.1 (abs_im_div_abs_le_one x)).2, Real.sin_add, neg_div,\n Real.arcsin_neg, Real.sin_neg]\n[GOAL]\ncase neg\nx : ℂ\nh✝¹ : ¬0 ≤ x.re\nh✝ : ¬0 ≤ x.im\n⊢ Real.sin (arcsin ((-x).im / ↑abs x) - π) = x.im / ↑abs x\n[PROOFSTEP]\nsimp [sub_eq_add_neg, arg,\n Real.sin_arcsin (abs_le.1 (abs_im_div_abs_le_one x)).1 (abs_le.1 (abs_im_div_abs_le_one x)).2, Real.sin_add, neg_div,\n Real.arcsin_neg, Real.sin_neg]\n[GOAL]\nx : ℂ\nhx : x ≠ 0\n⊢ Real.cos (arg x) = x.re / ↑abs x\n[PROOFSTEP]\nrw [arg]\n[GOAL]\nx : ℂ\nhx : x ≠ 0\n⊢ Real.cos\n (if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then arcsin ((-x).im / ↑abs x) + π else arcsin ((-x).im / ↑abs x) - π) =\n x.re / ↑abs x\n[PROOFSTEP]\nsplit_ifs with h₁ h₂\n[GOAL]\ncase pos\nx : ℂ\nhx : x ≠ 0\nh₁ : 0 ≤ x.re\n⊢ Real.cos (arcsin (x.im / ↑abs x)) = x.re / ↑abs x\n[PROOFSTEP]\nrw [Real.cos_arcsin]\n[GOAL]\ncase pos\nx : ℂ\nhx : x ≠ 0\nh₁ : 0 ≤ x.re\n⊢ sqrt (1 - (x.im / ↑abs x) ^ 2) = x.re / ↑abs x\n[PROOFSTEP]\nfield_simp [Real.sqrt_sq, (abs.pos hx).le, *]\n[GOAL]\ncase pos\nx : ℂ\nhx : x ≠ 0\nh₁ : ¬0 ≤ x.re\nh₂ : 0 ≤ x.im\n⊢ Real.cos (arcsin ((-x).im / ↑abs x) + π) = x.re / ↑abs x\n[PROOFSTEP]\nrw [Real.cos_add_pi, Real.cos_arcsin]\n[GOAL]\ncase pos\nx : ℂ\nhx : x ≠ 0\nh₁ : ¬0 ≤ x.re\nh₂ : 0 ≤ x.im\n⊢ -sqrt (1 - ((-x).im / ↑abs x) ^ 2) = x.re / ↑abs x\n[PROOFSTEP]\nfield_simp [Real.sqrt_div (sq_nonneg _), Real.sqrt_sq_eq_abs, _root_.abs_of_neg (not_le.1 h₁), *]\n[GOAL]\ncase neg\nx : ℂ\nhx : x ≠ 0\nh₁ : ¬0 ≤ x.re\nh₂ : ¬0 ≤ x.im\n⊢ Real.cos (arcsin ((-x).im / ↑abs x) - π) = x.re / ↑abs x\n[PROOFSTEP]\nrw [Real.cos_sub_pi, Real.cos_arcsin]\n[GOAL]\ncase neg\nx : ℂ\nhx : x ≠ 0\nh₁ : ¬0 ≤ x.re\nh₂ : ¬0 ≤ x.im\n⊢ -sqrt (1 - ((-x).im / ↑abs x) ^ 2) = x.re / ↑abs x\n[PROOFSTEP]\nfield_simp [Real.sqrt_div (sq_nonneg _), Real.sqrt_sq_eq_abs, _root_.abs_of_neg (not_le.1 h₁), *]\n[GOAL]\nx : ℂ\n⊢ ↑(↑abs x) * exp (↑(arg x) * I) = x\n[PROOFSTEP]\nrcases eq_or_ne x 0 with (rfl | hx)\n[GOAL]\ncase inl\n⊢ ↑(↑abs 0) * exp (↑(arg 0) * I) = 0\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nx : ℂ\nhx : x ≠ 0\n⊢ ↑(↑abs x) * exp (↑(arg x) * I) = x\n[PROOFSTEP]\nhave : abs x ≠ 0 := abs.ne_zero hx\n[GOAL]\ncase inr\nx : ℂ\nhx : x ≠ 0\nthis : ↑abs x ≠ 0\n⊢ ↑(↑abs x) * exp (↑(arg x) * I) = x\n[PROOFSTEP]\next\n[GOAL]\ncase inr.a\nx : ℂ\nhx : x ≠ 0\nthis : ↑abs x ≠ 0\n⊢ (↑(↑abs x) * exp (↑(arg x) * I)).re = x.re\n[PROOFSTEP]\nfield_simp [sin_arg, cos_arg hx, this, mul_comm (abs x)]\n[GOAL]\ncase inr.a\nx : ℂ\nhx : x ≠ 0\nthis : ↑abs x ≠ 0\n⊢ (↑(↑abs x) * exp (↑(arg x) * I)).im = x.im\n[PROOFSTEP]\nfield_simp [sin_arg, cos_arg hx, this, mul_comm (abs x)]\n[GOAL]\nx : ℂ\n⊢ ↑(↑abs x) * (cos ↑(arg x) + sin ↑(arg x) * I) = x\n[PROOFSTEP]\nrw [← exp_mul_I, abs_mul_exp_arg_mul_I]\n[GOAL]\nz : ℂ\n⊢ ↑abs z = 1 ↔ ∃ θ, exp (↑θ * I) = z\n[PROOFSTEP]\nrefine' ⟨fun hz => ⟨arg z, _⟩, _⟩\n[GOAL]\ncase refine'_1\nz : ℂ\nhz : ↑abs z = 1\n⊢ exp (↑(arg z) * I) = z\n[PROOFSTEP]\ncalc\n exp (arg z * I) = abs z * exp (arg z * I) := by rw [hz, ofReal_one, one_mul]\n _ = z := abs_mul_exp_arg_mul_I z\n[GOAL]\nz : ℂ\nhz : ↑abs z = 1\n⊢ exp (↑(arg z) * I) = ↑(↑abs z) * exp (↑(arg z) * I)\n[PROOFSTEP]\nrw [hz, ofReal_one, one_mul]\n[GOAL]\ncase refine'_2\nz : ℂ\n⊢ (∃ θ, exp (↑θ * I) = z) → ↑abs z = 1\n[PROOFSTEP]\nrintro ⟨θ, rfl⟩\n[GOAL]\ncase refine'_2.intro\nθ : ℝ\n⊢ ↑abs (exp (↑θ * I)) = 1\n[PROOFSTEP]\nexact Complex.abs_exp_ofReal_mul_I θ\n[GOAL]\n⊢ (Set.range fun x => exp (↑x * I)) = Metric.sphere 0 1\n[PROOFSTEP]\next x\n[GOAL]\ncase h\nx : ℂ\n⊢ (x ∈ Set.range fun x => exp (↑x * I)) ↔ x ∈ Metric.sphere 0 1\n[PROOFSTEP]\nsimp only [mem_sphere_zero_iff_norm, norm_eq_abs, abs_eq_one_iff, Set.mem_range]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\n⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) = θ\n[PROOFSTEP]\nsimp only [arg, map_mul, abs_cos_add_sin_mul_I, abs_of_nonneg hr.le, mul_one]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\n⊢ (if 0 ≤ (↑r * (cos ↑θ + sin ↑θ * I)).re then arcsin ((↑r * (cos ↑θ + sin ↑θ * I)).im / r)\n else\n if 0 ≤ (↑r * (cos ↑θ + sin ↑θ * I)).im then arcsin ((-(↑r * (cos ↑θ + sin ↑θ * I))).im / r) + π\n else arcsin ((-(↑r * (cos ↑θ + sin ↑θ * I))).im / r) - π) =\n θ\n[PROOFSTEP]\nsimp only [ofReal_mul_re, ofReal_mul_im, neg_im, ← ofReal_cos, ← ofReal_sin, ← mk_eq_add_mul_I, neg_div,\n mul_div_cancel_left _ hr.ne', mul_nonneg_iff_right_nonneg_of_pos hr]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nby_cases h₁ : θ ∈ Set.Icc (-(π / 2)) (π / 2)\n[GOAL]\ncase pos\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : θ ∈ Set.Icc (-(π / 2)) (π / 2)\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [if_pos]\n[GOAL]\ncase pos\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : θ ∈ Set.Icc (-(π / 2)) (π / 2)\n⊢ arcsin (Real.sin θ) = θ\ncase pos.hc r : ℝ hr : 0 < r θ : ℝ hθ : θ ∈ Set.Ioc (-π) π h₁ : θ ∈ Set.Icc (-(π / 2)) (π / 2) ⊢ 0 ≤ Real.cos θ\n[PROOFSTEP]\nexacts [Real.arcsin_sin' h₁, Real.cos_nonneg_of_mem_Icc h₁]\n[GOAL]\ncase neg\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : ¬θ ∈ Set.Icc (-(π / 2)) (π / 2)\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [Set.mem_Icc, not_and_or, not_le, not_le] at h₁ \n[GOAL]\ncase neg\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : θ < -(π / 2) ∨ π / 2 < θ\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\ncases' h₁ with h₁ h₁\n[GOAL]\ncase neg.inl\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : θ < -(π / 2)\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nreplace hθ := hθ.1\n[GOAL]\ncase neg.inl\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nhave hcos : Real.cos θ < 0 := by\n rw [← neg_pos, ← Real.cos_add_pi]\n refine' Real.cos_pos_of_mem_Ioo ⟨_, _⟩ <;> linarith\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\n⊢ Real.cos θ < 0\n[PROOFSTEP]\nrw [← neg_pos, ← Real.cos_add_pi]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\n⊢ 0 < Real.cos (θ + π)\n[PROOFSTEP]\nrefine' Real.cos_pos_of_mem_Ioo ⟨_, _⟩\n[GOAL]\ncase refine'_1\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\n⊢ -(π / 2) < θ + π\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase refine'_2\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\n⊢ θ + π < π / 2\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inl\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nhave hsin : Real.sin θ < 0 := Real.sin_neg_of_neg_of_neg_pi_lt (by linarith) hθ\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\n⊢ θ < 0\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inl\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [if_neg, if_neg, ← Real.sin_add_pi, Real.arcsin_sin, add_sub_cancel] <;> [linarith; linarith; exact hsin.not_le;\n exact hcos.not_le]\n[GOAL]\ncase neg.inl\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [if_neg, if_neg, ← Real.sin_add_pi, Real.arcsin_sin, add_sub_cancel]\n[GOAL]\ncase neg.inl.hx₁\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ -(π / 2) ≤ θ + π\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inl.hx₂\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ θ + π ≤ π / 2\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inl.hnc\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ ¬0 ≤ Real.sin θ\n[PROOFSTEP]\nexact hsin.not_le\n[GOAL]\ncase neg.inl.hnc\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : θ < -(π / 2)\nhθ : -π < θ\nhcos : Real.cos θ < 0\nhsin : Real.sin θ < 0\n⊢ ¬0 ≤ Real.cos θ\n[PROOFSTEP]\nexact hcos.not_le\n[GOAL]\ncase neg.inr\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\nh₁ : π / 2 < θ\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nreplace hθ := hθ.2\n[GOAL]\ncase neg.inr\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nhave hcos : Real.cos θ < 0 := Real.cos_neg_of_pi_div_two_lt_of_lt h₁ (by linarith)\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\n⊢ θ < π + π / 2\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inr\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nhave hsin : 0 ≤ Real.sin θ := Real.sin_nonneg_of_mem_Icc ⟨by linarith, hθ⟩\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\n⊢ 0 ≤ θ\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inr\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [if_neg, if_pos, ← Real.sin_sub_pi, Real.arcsin_sin, sub_add_cancel] <;> [linarith; linarith; exact hsin;\n exact hcos.not_le]\n[GOAL]\ncase neg.inr\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ (if 0 ≤ Real.cos θ then arcsin (Real.sin θ)\n else if 0 ≤ Real.sin θ then arcsin (-Real.sin θ) + π else arcsin (-Real.sin θ) - π) =\n θ\n[PROOFSTEP]\nrw [if_neg, if_pos, ← Real.sin_sub_pi, Real.arcsin_sin, sub_add_cancel]\n[GOAL]\ncase neg.inr.hx₁\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ -(π / 2) ≤ θ - π\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inr.hx₂\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ θ - π ≤ π / 2\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase neg.inr.hc\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ 0 ≤ Real.sin θ\n[PROOFSTEP]\nexact hsin\n[GOAL]\ncase neg.inr.hnc\nr : ℝ\nhr : 0 < r\nθ : ℝ\nh₁ : π / 2 < θ\nhθ : θ ≤ π\nhcos : Real.cos θ < 0\nhsin : 0 ≤ Real.sin θ\n⊢ ¬0 ≤ Real.cos θ\n[PROOFSTEP]\nexact hcos.not_le\n[GOAL]\nθ : ℝ\nhθ : θ ∈ Set.Ioc (-π) π\n⊢ arg (cos ↑θ + sin ↑θ * I) = θ\n[PROOFSTEP]\nrw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I zero_lt_one hθ]\n[GOAL]\n⊢ arg 0 = 0\n[PROOFSTEP]\nsimp [arg, le_refl]\n[GOAL]\nx y : ℂ\nh₁ : ↑abs x = ↑abs y\nh₂ : arg x = arg y\n⊢ x = y\n[PROOFSTEP]\nrw [← abs_mul_exp_arg_mul_I x, ← abs_mul_exp_arg_mul_I y, h₁, h₂]\n[GOAL]\nz : ℂ\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nhave hπ : 0 < π := Real.pi_pos\n[GOAL]\nz : ℂ\nhπ : 0 < π\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nrcases eq_or_ne z 0 with (rfl | hz)\n[GOAL]\ncase inl\nhπ : 0 < π\n⊢ arg 0 ∈ Set.Ioc (-π) π\ncase inr z : ℂ hπ : 0 < π hz : z ≠ 0 ⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nsimp [hπ, hπ.le]\n[GOAL]\ncase inr\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nrcases existsUnique_add_zsmul_mem_Ioc Real.two_pi_pos (arg z) (-π) with ⟨N, hN, -⟩\n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + N • (2 * π) ∈ Set.Ioc (-π) (-π + 2 * π)\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nrw [two_mul, neg_add_cancel_left, ← two_mul, zsmul_eq_mul] at hN \n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + ↑N * (2 * π) ∈ Set.Ioc (-π) π\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I z, ← cos_add_int_mul_two_pi _ N, ← sin_add_int_mul_two_pi _ N]\n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + ↑N * (2 * π) ∈ Set.Ioc (-π) π\n⊢ arg (↑(↑abs z) * (cos (↑(arg z) + ↑N * (2 * ↑π)) + sin (↑(arg z) + ↑N * (2 * ↑π)) * I)) ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nsimp only [← ofReal_one, ← ofReal_bit0, ← ofReal_mul, ← ofReal_add, ofReal_int_cast]\n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + ↑N * (2 * π) ∈ Set.Ioc (-π) π\n⊢ arg (↑(↑abs z) * (cos (↑(arg z) + ↑N * (2 * ↑π)) + sin (↑(arg z) + ↑N * (2 * ↑π)) * I)) ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nhave := arg_mul_cos_add_sin_mul_I (abs.pos hz) hN\n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + ↑N * (2 * π) ∈ Set.Ioc (-π) π\nthis : arg (↑(↑abs z) * (cos ↑(arg z + ↑N * (2 * π)) + sin ↑(arg z + ↑N * (2 * π)) * I)) = arg z + ↑N * (2 * π)\n⊢ arg (↑(↑abs z) * (cos (↑(arg z) + ↑N * (2 * ↑π)) + sin (↑(arg z) + ↑N * (2 * ↑π)) * I)) ∈ Set.Ioc (-π) π\n[PROOFSTEP]\npush_cast at this \n[GOAL]\ncase inr.intro.intro\nz : ℂ\nhπ : 0 < π\nhz : z ≠ 0\nN : ℤ\nhN : arg z + ↑N * (2 * π) ∈ Set.Ioc (-π) π\nthis : arg (↑(↑abs z) * (cos (↑(arg z) + ↑N * (2 * ↑π)) + sin (↑(arg z) + ↑N * (2 * ↑π)) * I)) = arg z + ↑N * (2 * π)\n⊢ arg (↑(↑abs z) * (cos (↑(arg z) + ↑N * (2 * ↑π)) + sin (↑(arg z) + ↑N * (2 * ↑π)) * I)) ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nrwa [this]\n[GOAL]\nz : ℂ\n⊢ 0 ≤ arg z ↔ 0 ≤ z.im\n[PROOFSTEP]\nrcases eq_or_ne z 0 with (rfl | h₀)\n[GOAL]\ncase inl\n⊢ 0 ≤ arg 0 ↔ 0 ≤ 0.im\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nz : ℂ\nh₀ : z ≠ 0\n⊢ 0 ≤ arg z ↔ 0 ≤ z.im\n[PROOFSTEP]\ncalc\n 0 ≤ arg z ↔ 0 ≤ Real.sin (arg z) :=\n ⟨fun h => Real.sin_nonneg_of_mem_Icc ⟨h, arg_le_pi z⟩,\n by\n contrapose!\n intro h\n exact Real.sin_neg_of_neg_of_neg_pi_lt h (neg_pi_lt_arg _)⟩\n _ ↔ _ := by rw [sin_arg, le_div_iff (abs.pos h₀), zero_mul]\n[GOAL]\nz : ℂ\nh₀ : z ≠ 0\n⊢ 0 ≤ Real.sin (arg z) → 0 ≤ arg z\n[PROOFSTEP]\ncontrapose!\n[GOAL]\nz : ℂ\nh₀ : z ≠ 0\n⊢ arg z < 0 → Real.sin (arg z) < 0\n[PROOFSTEP]\nintro h\n[GOAL]\nz : ℂ\nh₀ : z ≠ 0\nh : arg z < 0\n⊢ Real.sin (arg z) < 0\n[PROOFSTEP]\nexact Real.sin_neg_of_neg_of_neg_pi_lt h (neg_pi_lt_arg _)\n[GOAL]\nz : ℂ\nh₀ : z ≠ 0\n⊢ 0 ≤ Real.sin (arg z) ↔ 0 ≤ z.im\n[PROOFSTEP]\nrw [sin_arg, le_div_iff (abs.pos h₀), zero_mul]\n[GOAL]\nx : ℂ\nr : ℝ\nhr : 0 < r\n⊢ arg (↑r * x) = arg x\n[PROOFSTEP]\nrcases eq_or_ne x 0 with (rfl | hx)\n[GOAL]\ncase inl\nr : ℝ\nhr : 0 < r\n⊢ arg (↑r * 0) = arg 0\n[PROOFSTEP]\nrw [mul_zero]\n[GOAL]\ncase inr\nx : ℂ\nr : ℝ\nhr : 0 < r\nhx : x ≠ 0\n⊢ arg (↑r * x) = arg x\n[PROOFSTEP]\nconv_lhs =>\n rw [← abs_mul_cos_add_sin_mul_I x, ← mul_assoc, ← ofReal_mul,\n arg_mul_cos_add_sin_mul_I (mul_pos hr (abs.pos hx)) x.arg_mem_Ioc]\n[GOAL]\nx : ℂ\nr : ℝ\nhr : 0 < r\nhx : x ≠ 0\n| arg (↑r * x)\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I x, ← mul_assoc, ← ofReal_mul,\n arg_mul_cos_add_sin_mul_I (mul_pos hr (abs.pos hx)) x.arg_mem_Ioc]\n[GOAL]\nx : ℂ\nr : ℝ\nhr : 0 < r\nhx : x ≠ 0\n| arg (↑r * x)\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I x, ← mul_assoc, ← ofReal_mul,\n arg_mul_cos_add_sin_mul_I (mul_pos hr (abs.pos hx)) x.arg_mem_Ioc]\n[GOAL]\nx : ℂ\nr : ℝ\nhr : 0 < r\nhx : x ≠ 0\n| arg (↑r * x)\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I x, ← mul_assoc, ← ofReal_mul,\n arg_mul_cos_add_sin_mul_I (mul_pos hr (abs.pos hx)) x.arg_mem_Ioc]\n[GOAL]\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ arg x = arg y ↔ ↑(↑abs y) / ↑(↑abs x) * x = y\n[PROOFSTEP]\nsimp only [ext_abs_arg_iff, map_mul, map_div₀, abs_ofReal, abs_abs, div_mul_cancel _ (abs.ne_zero hx), eq_self_iff_true,\n true_and_iff]\n[GOAL]\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ arg x = arg y ↔ arg (↑(↑abs y) / ↑(↑abs x) * x) = arg y\n[PROOFSTEP]\nrw [← ofReal_div, arg_real_mul]\n[GOAL]\ncase hr\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ 0 < ↑abs y / ↑abs x\n[PROOFSTEP]\nexact div_pos (abs.pos hy) (abs.pos hx)\n[GOAL]\n⊢ arg 1 = 0\n[PROOFSTEP]\nsimp [arg, zero_le_one]\n[GOAL]\n⊢ arg (-1) = π\n[PROOFSTEP]\nsimp [arg, le_refl, not_le.2 (zero_lt_one' ℝ)]\n[GOAL]\n⊢ arg I = π / 2\n[PROOFSTEP]\nsimp [arg, le_refl]\n[GOAL]\n⊢ arg (-I) = -(π / 2)\n[PROOFSTEP]\nsimp [arg, le_refl]\n[GOAL]\nx : ℂ\n⊢ Real.tan (arg x) = x.im / x.re\n[PROOFSTEP]\nby_cases h : x = 0\n[GOAL]\ncase pos\nx : ℂ\nh : x = 0\n⊢ Real.tan (arg x) = x.im / x.re\n[PROOFSTEP]\nsimp only [h, zero_div, Complex.zero_im, Complex.arg_zero, Real.tan_zero, Complex.zero_re]\n[GOAL]\ncase neg\nx : ℂ\nh : ¬x = 0\n⊢ Real.tan (arg x) = x.im / x.re\n[PROOFSTEP]\nrw [Real.tan_eq_sin_div_cos, sin_arg, cos_arg h, div_div_div_cancel_right _ (abs.ne_zero h)]\n[GOAL]\nx : ℝ\nhx : 0 ≤ x\n⊢ arg ↑x = 0\n[PROOFSTEP]\nsimp [arg, hx]\n[GOAL]\nz : ℂ\n⊢ arg z = 0 ↔ 0 ≤ z.re ∧ z.im = 0\n[PROOFSTEP]\nrefine' ⟨fun h => _, _⟩\n[GOAL]\ncase refine'_1\nz : ℂ\nh : arg z = 0\n⊢ 0 ≤ z.re ∧ z.im = 0\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I z, h]\n[GOAL]\ncase refine'_1\nz : ℂ\nh : arg z = 0\n⊢ 0 ≤ (↑(↑abs z) * (cos ↑0 + sin ↑0 * I)).re ∧ (↑(↑abs z) * (cos ↑0 + sin ↑0 * I)).im = 0\n[PROOFSTEP]\nsimp [abs.nonneg]\n[GOAL]\ncase refine'_2\nz : ℂ\n⊢ 0 ≤ z.re ∧ z.im = 0 → arg z = 0\n[PROOFSTEP]\ncases' z with x y\n[GOAL]\ncase refine'_2.mk\nx y : ℝ\n⊢ 0 ≤ { re := x, im := y }.re ∧ { re := x, im := y }.im = 0 → arg { re := x, im := y } = 0\n[PROOFSTEP]\nrintro ⟨h, rfl : y = 0⟩\n[GOAL]\ncase refine'_2.mk.intro\nx : ℝ\nh : 0 ≤ { re := x, im := 0 }.re\n⊢ arg { re := x, im := 0 } = 0\n[PROOFSTEP]\nexact arg_ofReal_of_nonneg h\n[GOAL]\nz : ℂ\n⊢ arg z = π ↔ z.re < 0 ∧ z.im = 0\n[PROOFSTEP]\nby_cases h₀ : z = 0\n[GOAL]\ncase pos\nz : ℂ\nh₀ : z = 0\n⊢ arg z = π ↔ z.re < 0 ∧ z.im = 0\ncase neg z : ℂ h₀ : ¬z = 0 ⊢ arg z = π ↔ z.re < 0 ∧ z.im = 0\n[PROOFSTEP]\nsimp [h₀, lt_irrefl, Real.pi_ne_zero.symm]\n[GOAL]\ncase neg\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = π ↔ z.re < 0 ∧ z.im = 0\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = π → z.re < 0 ∧ z.im = 0\n[PROOFSTEP]\nintro h\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = π\n⊢ z.re < 0 ∧ z.im = 0\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I z, h]\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = π\n⊢ (↑(↑abs z) * (cos ↑π + sin ↑π * I)).re < 0 ∧ (↑(↑abs z) * (cos ↑π + sin ↑π * I)).im = 0\n[PROOFSTEP]\nsimp [h₀]\n[GOAL]\ncase neg.mpr\nz : ℂ\nh₀ : ¬z = 0\n⊢ z.re < 0 ∧ z.im = 0 → arg z = π\n[PROOFSTEP]\ncases' z with x y\n[GOAL]\ncase neg.mpr.mk\nx y : ℝ\nh₀ : ¬{ re := x, im := y } = 0\n⊢ { re := x, im := y }.re < 0 ∧ { re := x, im := y }.im = 0 → arg { re := x, im := y } = π\n[PROOFSTEP]\nrintro ⟨h : x < 0, rfl : y = 0⟩\n[GOAL]\ncase neg.mpr.mk.intro\nx : ℝ\nh : x < 0\nh₀ : ¬{ re := x, im := 0 } = 0\n⊢ arg { re := x, im := 0 } = π\n[PROOFSTEP]\nrw [← arg_neg_one, ← arg_real_mul (-1) (neg_pos.2 h)]\n[GOAL]\ncase neg.mpr.mk.intro\nx : ℝ\nh : x < 0\nh₀ : ¬{ re := x, im := 0 } = 0\n⊢ arg { re := x, im := 0 } = arg (↑(-x) * -1)\n[PROOFSTEP]\nsimp [← ofReal_def]\n[GOAL]\nz : ℂ\n⊢ arg z < π ↔ 0 ≤ z.re ∨ z.im ≠ 0\n[PROOFSTEP]\nrw [(arg_le_pi z).lt_iff_ne, not_iff_comm, not_or, not_le, Classical.not_not, arg_eq_pi_iff]\n[GOAL]\nz : ℂ\n⊢ arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im\n[PROOFSTEP]\nby_cases h₀ : z = 0\n[GOAL]\ncase pos\nz : ℂ\nh₀ : z = 0\n⊢ arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im\n[PROOFSTEP]\nsimp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]\n[GOAL]\ncase neg\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = π / 2 → z.re = 0 ∧ 0 < z.im\n[PROOFSTEP]\nintro h\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = π / 2\n⊢ z.re = 0 ∧ 0 < z.im\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I z, h]\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = π / 2\n⊢ (↑(↑abs z) * (cos ↑(π / 2) + sin ↑(π / 2) * I)).re = 0 ∧ 0 < (↑(↑abs z) * (cos ↑(π / 2) + sin ↑(π / 2) * I)).im\n[PROOFSTEP]\nsimp [h₀]\n[GOAL]\ncase neg.mpr\nz : ℂ\nh₀ : ¬z = 0\n⊢ z.re = 0 ∧ 0 < z.im → arg z = π / 2\n[PROOFSTEP]\ncases' z with x y\n[GOAL]\ncase neg.mpr.mk\nx y : ℝ\nh₀ : ¬{ re := x, im := y } = 0\n⊢ { re := x, im := y }.re = 0 ∧ 0 < { re := x, im := y }.im → arg { re := x, im := y } = π / 2\n[PROOFSTEP]\nrintro ⟨rfl : x = 0, hy : 0 < y⟩\n[GOAL]\ncase neg.mpr.mk.intro\ny : ℝ\nh₀ : ¬{ re := 0, im := y } = 0\nhy : 0 < y\n⊢ arg { re := 0, im := y } = π / 2\n[PROOFSTEP]\nrw [← arg_I, ← arg_real_mul I hy, ofReal_mul', I_re, I_im, mul_zero, mul_one]\n[GOAL]\nz : ℂ\n⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0\n[PROOFSTEP]\nby_cases h₀ : z = 0\n[GOAL]\ncase pos\nz : ℂ\nh₀ : z = 0\n⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0\n[PROOFSTEP]\nsimp [h₀, lt_irrefl, Real.pi_ne_zero]\n[GOAL]\ncase neg\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\n⊢ arg z = -(π / 2) → z.re = 0 ∧ z.im < 0\n[PROOFSTEP]\nintro h\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = -(π / 2)\n⊢ z.re = 0 ∧ z.im < 0\n[PROOFSTEP]\nrw [← abs_mul_cos_add_sin_mul_I z, h]\n[GOAL]\ncase neg.mp\nz : ℂ\nh₀ : ¬z = 0\nh : arg z = -(π / 2)\n⊢ (↑(↑abs z) * (cos ↑(-(π / 2)) + sin ↑(-(π / 2)) * I)).re = 0 ∧\n (↑(↑abs z) * (cos ↑(-(π / 2)) + sin ↑(-(π / 2)) * I)).im < 0\n[PROOFSTEP]\nsimp [h₀]\n[GOAL]\ncase neg.mpr\nz : ℂ\nh₀ : ¬z = 0\n⊢ z.re = 0 ∧ z.im < 0 → arg z = -(π / 2)\n[PROOFSTEP]\ncases' z with x y\n[GOAL]\ncase neg.mpr.mk\nx y : ℝ\nh₀ : ¬{ re := x, im := y } = 0\n⊢ { re := x, im := y }.re = 0 ∧ { re := x, im := y }.im < 0 → arg { re := x, im := y } = -(π / 2)\n[PROOFSTEP]\nrintro ⟨rfl : x = 0, hy : y < 0⟩\n[GOAL]\ncase neg.mpr.mk.intro\ny : ℝ\nh₀ : ¬{ re := 0, im := y } = 0\nhy : y < 0\n⊢ arg { re := 0, im := y } = -(π / 2)\n[PROOFSTEP]\nrw [← arg_neg_I, ← arg_real_mul (-I) (neg_pos.2 hy), mk_eq_add_mul_I]\n[GOAL]\ncase neg.mpr.mk.intro\ny : ℝ\nh₀ : ¬{ re := 0, im := y } = 0\nhy : y < 0\n⊢ arg (↑0 + ↑y * I) = arg (↑(-y) * -I)\n[PROOFSTEP]\nsimp\n[GOAL]\nx : ℂ\nhx_re : x.re < 0\nhx_im : 0 ≤ x.im\n⊢ arg x = arcsin ((-x).im / ↑abs x) + π\n[PROOFSTEP]\nsimp only [arg, hx_re.not_le, hx_im, if_true, if_false]\n[GOAL]\nx : ℂ\nhx_re : x.re < 0\nhx_im : x.im < 0\n⊢ arg x = arcsin ((-x).im / ↑abs x) - π\n[PROOFSTEP]\nsimp only [arg, hx_re.not_le, hx_im.not_le, if_false]\n[GOAL]\nz : ℂ\nh₁ : 0 ≤ z.im\nh₂ : z ≠ 0\n⊢ arg z = arccos (z.re / ↑abs z)\n[PROOFSTEP]\nrw [← cos_arg h₂, Real.arccos_cos (arg_nonneg_iff.2 h₁) (arg_le_pi _)]\n[GOAL]\nz : ℂ\nhz : z.im < 0\n⊢ arg z = -arccos (z.re / ↑abs z)\n[PROOFSTEP]\nhave h₀ : z ≠ 0 := mt (congr_arg im) hz.ne\n[GOAL]\nz : ℂ\nhz : z.im < 0\nh₀ : z ≠ 0\n⊢ arg z = -arccos (z.re / ↑abs z)\n[PROOFSTEP]\nrw [← cos_arg h₀, ← Real.cos_neg, Real.arccos_cos, neg_neg]\n[GOAL]\ncase hx₁\nz : ℂ\nhz : z.im < 0\nh₀ : z ≠ 0\n⊢ 0 ≤ -arg z\ncase hx₂ z : ℂ hz : z.im < 0 h₀ : z ≠ 0 ⊢ -arg z ≤ π\n[PROOFSTEP]\nexacts [neg_nonneg.2 (arg_neg_iff.2 hz).le, neg_le.2 (neg_pi_lt_arg z).le]\n[GOAL]\nx : ℂ\n⊢ arg (↑(starRingEnd ℂ) x) = if arg x = π then π else -arg x\n[PROOFSTEP]\nsimp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg, Real.arcsin_neg]\n[GOAL]\nx : ℂ\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nrcases lt_trichotomy x.re 0 with (hr | hr | hr)\n[GOAL]\ncase inl\nx : ℂ\nhr : x.re < 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inr.inl\nx : ℂ\nhr : x.re = 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inr.inr\nx : ℂ\nhr : 0 < x.re\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inl.inl\nx : ℂ\nhr : x.re < 0\nhi : x.im < 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]\n[GOAL]\ncase inl.inr.inl\nx : ℂ\nhr : x.re < 0\nhi : x.im = 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.not_le, hi]\n[GOAL]\ncase inl.inr.inr\nx : ℂ\nhr : x.re < 0\nhi : 0 < x.im\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhr : x.re = 0\nhi : x.im < 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr]\n[GOAL]\ncase inr.inl.inr.inl\nx : ℂ\nhr : x.re = 0\nhi : x.im = 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr]\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhr : x.re = 0\nhi : 0 < x.im\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr]\n[GOAL]\ncase inr.inr.inl\nx : ℂ\nhr : 0 < x.re\nhi : x.im < 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.le, hi.ne]\n[GOAL]\ncase inr.inr.inr.inl\nx : ℂ\nhr : 0 < x.re\nhi : x.im = 0\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.le, hr.le.not_lt]\n[GOAL]\ncase inr.inr.inr.inr\nx : ℂ\nhr : 0 < x.re\nhi : 0 < x.im\n⊢ (if 0 ≤ x.re then -arcsin (x.im / ↑abs x)\n else if 0 ≤ -x.im then arcsin (x.im / ↑abs x) + π else arcsin (x.im / ↑abs x) - π) =\n if x.re < 0 ∧ x.im = 0 then π\n else\n -if 0 ≤ x.re then arcsin (x.im / ↑abs x)\n else if 0 ≤ x.im then -arcsin (x.im / ↑abs x) + π else -arcsin (x.im / ↑abs x) - π\n[PROOFSTEP]\nsimp [hr, hr.le, hr.le.not_lt]\n[GOAL]\nx : ℂ\n⊢ arg x⁻¹ = if arg x = π then π else -arg x\n[PROOFSTEP]\nrw [← arg_conj, inv_def, mul_comm]\n[GOAL]\nx : ℂ\n⊢ arg (↑(↑normSq x)⁻¹ * ↑(starRingEnd ℂ) x) = arg (↑(starRingEnd ℂ) x)\n[PROOFSTEP]\nby_cases hx : x = 0\n[GOAL]\ncase pos\nx : ℂ\nhx : x = 0\n⊢ arg (↑(↑normSq x)⁻¹ * ↑(starRingEnd ℂ) x) = arg (↑(starRingEnd ℂ) x)\n[PROOFSTEP]\nsimp [hx]\n[GOAL]\ncase neg\nx : ℂ\nhx : ¬x = 0\n⊢ arg (↑(↑normSq x)⁻¹ * ↑(starRingEnd ℂ) x) = arg (↑(starRingEnd ℂ) x)\n[PROOFSTEP]\nexact arg_real_mul (conj x) (by simp [hx])\n[GOAL]\nx : ℂ\nhx : ¬x = 0\n⊢ 0 < (↑normSq x)⁻¹\n[PROOFSTEP]\nsimp [hx]\n[GOAL]\nz : ℂ\n⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0\n[PROOFSTEP]\ncases' le_or_lt 0 (re z) with hre hre\n[GOAL]\ncase inl\nz : ℂ\nhre : 0 ≤ z.re\n⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0\n[PROOFSTEP]\nsimp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]\n[GOAL]\ncase inr\nz : ℂ\nhre : z.re < 0\n⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0\n[PROOFSTEP]\nsimp only [hre.not_le, false_or_iff]\n[GOAL]\ncase inr\nz : ℂ\nhre : z.re < 0\n⊢ arg z ≤ π / 2 ↔ z.im < 0\n[PROOFSTEP]\ncases' le_or_lt 0 (im z) with him him\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ arg z ≤ π / 2 ↔ z.im < 0\n[PROOFSTEP]\nsimp only [him.not_lt]\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ arg z ≤ π / 2 ↔ False\n[PROOFSTEP]\nrw [iff_false_iff, not_le, arg_of_re_neg_of_im_nonneg hre him, ← sub_lt_iff_lt_add, half_sub,\n Real.neg_pi_div_two_lt_arcsin, neg_im, neg_div, neg_lt_neg_iff, div_lt_one, ← _root_.abs_of_nonneg him, abs_im_lt_abs]\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ z.re ≠ 0\ncase inr.inl z : ℂ hre : z.re < 0 him : 0 ≤ z.im ⊢ 0 < ↑abs z\n[PROOFSTEP]\nexacts [hre.ne, abs.pos <| ne_of_apply_ne re hre.ne]\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ arg z ≤ π / 2 ↔ z.im < 0\n[PROOFSTEP]\nsimp only [him]\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ arg z ≤ π / 2 ↔ True\n[PROOFSTEP]\nrw [iff_true_iff, arg_of_re_neg_of_im_neg hre him]\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ arcsin ((-z).im / ↑abs z) - π ≤ π / 2\n[PROOFSTEP]\nexact (sub_le_self _ Real.pi_pos.le).trans (Real.arcsin_le_pi_div_two _)\n[GOAL]\nz : ℂ\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.re ∨ 0 ≤ z.im\n[PROOFSTEP]\ncases' le_or_lt 0 (re z) with hre hre\n[GOAL]\ncase inl\nz : ℂ\nhre : 0 ≤ z.re\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.re ∨ 0 ≤ z.im\n[PROOFSTEP]\nsimp only [hre, arg_of_re_nonneg hre, Real.neg_pi_div_two_le_arcsin, true_or_iff]\n[GOAL]\ncase inr\nz : ℂ\nhre : z.re < 0\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.re ∨ 0 ≤ z.im\n[PROOFSTEP]\nsimp only [hre.not_le, false_or_iff]\n[GOAL]\ncase inr\nz : ℂ\nhre : z.re < 0\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.im\n[PROOFSTEP]\ncases' le_or_lt 0 (im z) with him him\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.im\n[PROOFSTEP]\nsimp only [him]\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ -(π / 2) ≤ arg z ↔ True\n[PROOFSTEP]\nrw [iff_true_iff, arg_of_re_neg_of_im_nonneg hre him]\n[GOAL]\ncase inr.inl\nz : ℂ\nhre : z.re < 0\nhim : 0 ≤ z.im\n⊢ -(π / 2) ≤ arcsin ((-z).im / ↑abs z) + π\n[PROOFSTEP]\nexact (Real.neg_pi_div_two_le_arcsin _).trans (le_add_of_nonneg_right Real.pi_pos.le)\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ -(π / 2) ≤ arg z ↔ 0 ≤ z.im\n[PROOFSTEP]\nsimp only [him.not_le]\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ -(π / 2) ≤ arg z ↔ False\n[PROOFSTEP]\nrw [iff_false_iff, not_le, arg_of_re_neg_of_im_neg hre him, sub_lt_iff_lt_add', ← sub_eq_add_neg, sub_half,\n Real.arcsin_lt_pi_div_two, div_lt_one, neg_im, ← abs_of_neg him, abs_im_lt_abs]\n[GOAL]\ncase inr.inr\nz : ℂ\nhre : z.re < 0\nhim : z.im < 0\n⊢ z.re ≠ 0\ncase inr.inr z : ℂ hre : z.re < 0 him : z.im < 0 ⊢ 0 < ↑abs z\n[PROOFSTEP]\nexacts [hre.ne, abs.pos <| ne_of_apply_ne re hre.ne]\n[GOAL]\nz : ℂ\n⊢ |arg z| ≤ π / 2 ↔ 0 ≤ z.re\n[PROOFSTEP]\nrw [abs_le, arg_le_pi_div_two_iff, neg_pi_div_two_le_arg_iff, ← or_and_left, ← not_le, and_not_self_iff, or_false_iff]\n[GOAL]\nx : ℂ\n⊢ ↑(arg (↑(starRingEnd ℂ) x)) = -↑(arg x)\n[PROOFSTEP]\nby_cases h : arg x = π\n[GOAL]\ncase pos\nx : ℂ\nh : arg x = π\n⊢ ↑(arg (↑(starRingEnd ℂ) x)) = -↑(arg x)\n[PROOFSTEP]\nsimp [arg_conj, h]\n[GOAL]\ncase neg\nx : ℂ\nh : ¬arg x = π\n⊢ ↑(arg (↑(starRingEnd ℂ) x)) = -↑(arg x)\n[PROOFSTEP]\nsimp [arg_conj, h]\n[GOAL]\nx : ℂ\n⊢ ↑(arg x⁻¹) = -↑(arg x)\n[PROOFSTEP]\nby_cases h : arg x = π\n[GOAL]\ncase pos\nx : ℂ\nh : arg x = π\n⊢ ↑(arg x⁻¹) = -↑(arg x)\n[PROOFSTEP]\nsimp [arg_inv, h]\n[GOAL]\ncase neg\nx : ℂ\nh : ¬arg x = π\n⊢ ↑(arg x⁻¹) = -↑(arg x)\n[PROOFSTEP]\nsimp [arg_inv, h]\n[GOAL]\nx : ℂ\nhi : 0 < x.im\n⊢ arg (-x) = arg x - π\n[PROOFSTEP]\nrw [arg_of_im_pos hi, arg_of_im_neg (show (-x).im < 0 from Left.neg_neg_iff.2 hi)]\n[GOAL]\nx : ℂ\nhi : 0 < x.im\n⊢ -arccos ((-x).re / ↑abs (-x)) = arccos (x.re / ↑abs x) - π\n[PROOFSTEP]\nsimp [neg_div, Real.arccos_neg]\n[GOAL]\nx : ℂ\nhi : x.im < 0\n⊢ arg (-x) = arg x + π\n[PROOFSTEP]\nrw [arg_of_im_neg hi, arg_of_im_pos (show 0 < (-x).im from Left.neg_pos_iff.2 hi)]\n[GOAL]\nx : ℂ\nhi : x.im < 0\n⊢ arccos ((-x).re / ↑abs (-x)) = -arccos (x.re / ↑abs x) + π\n[PROOFSTEP]\nsimp [neg_div, Real.arccos_neg, add_comm, ← sub_eq_add_neg]\n[GOAL]\nx : ℂ\n⊢ arg (-x) = arg x - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inl\nx : ℂ\nhi : x.im < 0\n⊢ arg (-x) = arg x - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0\n[PROOFSTEP]\nsimp [hi, hi.ne, hi.not_lt, arg_neg_eq_arg_add_pi_of_im_neg, sub_eq_add_neg, ← add_eq_zero_iff_eq_neg, Real.pi_ne_zero]\n[GOAL]\ncase inr.inl\nx : ℂ\nhi : x.im = 0\n⊢ arg (-x) = arg x - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0\n[PROOFSTEP]\nrw [(ext rfl hi : x = x.re)]\n[GOAL]\ncase inr.inl\nx : ℂ\nhi : x.im = 0\n⊢ arg (-↑x.re) = arg ↑x.re - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nrcases lt_trichotomy x.re 0 with (hr | hr | hr)\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re < 0\n⊢ arg (-↑x.re) = arg ↑x.re - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nrw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le]\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re < 0\n⊢ 0 = π - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nsimp [hr]\n[GOAL]\ncase inr.inl.inr.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re = 0\n⊢ arg (-↑x.re) = arg ↑x.re - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nsimp [hr, hi, Real.pi_ne_zero]\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhi : x.im = 0\nhr : 0 < x.re\n⊢ arg (-↑x.re) = arg ↑x.re - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nrw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr)]\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhi : x.im = 0\nhr : 0 < x.re\n⊢ π = 0 - π ↔ 0 < (↑x.re).im ∨ (↑x.re).im = 0 ∧ (↑x.re).re < 0\n[PROOFSTEP]\nsimp [hr.not_lt, ← add_eq_zero_iff_eq_neg, Real.pi_ne_zero]\n[GOAL]\ncase inr.inr\nx : ℂ\nhi : 0 < x.im\n⊢ arg (-x) = arg x - π ↔ 0 < x.im ∨ x.im = 0 ∧ x.re < 0\n[PROOFSTEP]\nsimp [hi, arg_neg_eq_arg_sub_pi_of_im_pos]\n[GOAL]\nx : ℂ\n⊢ arg (-x) = arg x + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inl\nx : ℂ\nhi : x.im < 0\n⊢ arg (-x) = arg x + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re\n[PROOFSTEP]\nsimp [hi, arg_neg_eq_arg_add_pi_of_im_neg]\n[GOAL]\ncase inr.inl\nx : ℂ\nhi : x.im = 0\n⊢ arg (-x) = arg x + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re\n[PROOFSTEP]\nrw [(ext rfl hi : x = x.re)]\n[GOAL]\ncase inr.inl\nx : ℂ\nhi : x.im = 0\n⊢ arg (-↑x.re) = arg ↑x.re + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nrcases lt_trichotomy x.re 0 with (hr | hr | hr)\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re < 0\n⊢ arg (-↑x.re) = arg ↑x.re + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nrw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le]\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re < 0\n⊢ 0 = π + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nsimp [hr.not_lt, ← two_mul, Real.pi_ne_zero]\n[GOAL]\ncase inr.inl.inr.inl\nx : ℂ\nhi : x.im = 0\nhr : x.re = 0\n⊢ arg (-↑x.re) = arg ↑x.re + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nsimp [hr, hi, Real.pi_ne_zero.symm]\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhi : x.im = 0\nhr : 0 < x.re\n⊢ arg (-↑x.re) = arg ↑x.re + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nrw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr)]\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhi : x.im = 0\nhr : 0 < x.re\n⊢ π = 0 + π ↔ (↑x.re).im < 0 ∨ (↑x.re).im = 0 ∧ 0 < (↑x.re).re\n[PROOFSTEP]\nsimp [hr]\n[GOAL]\ncase inr.inr\nx : ℂ\nhi : 0 < x.im\n⊢ arg (-x) = arg x + π ↔ x.im < 0 ∨ x.im = 0 ∧ 0 < x.re\n[PROOFSTEP]\nsimp [hi, hi.ne.symm, hi.not_lt, arg_neg_eq_arg_sub_pi_of_im_pos, sub_eq_add_neg, ← add_eq_zero_iff_neg_eq,\n Real.pi_ne_zero]\n[GOAL]\nx : ℂ\nhx : x ≠ 0\n⊢ ↑(arg (-x)) = ↑(arg x) + ↑π\n[PROOFSTEP]\nrcases lt_trichotomy x.im 0 with (hi | hi | hi)\n[GOAL]\ncase inl\nx : ℂ\nhx : x ≠ 0\nhi : x.im < 0\n⊢ ↑(arg (-x)) = ↑(arg x) + ↑π\n[PROOFSTEP]\nrw [arg_neg_eq_arg_add_pi_of_im_neg hi, Real.Angle.coe_add]\n[GOAL]\ncase inr.inl\nx : ℂ\nhx : x ≠ 0\nhi : x.im = 0\n⊢ ↑(arg (-x)) = ↑(arg x) + ↑π\n[PROOFSTEP]\nrw [(ext rfl hi : x = x.re)]\n[GOAL]\ncase inr.inl\nx : ℂ\nhx : x ≠ 0\nhi : x.im = 0\n⊢ ↑(arg (-↑x.re)) = ↑(arg ↑x.re) + ↑π\n[PROOFSTEP]\nrcases lt_trichotomy x.re 0 with (hr | hr | hr)\n[GOAL]\ncase inr.inl.inl\nx : ℂ\nhx : x ≠ 0\nhi : x.im = 0\nhr : x.re < 0\n⊢ ↑(arg (-↑x.re)) = ↑(arg ↑x.re) + ↑π\n[PROOFSTEP]\nrw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le, ← Real.Angle.coe_add, ←\n two_mul, Real.Angle.coe_two_pi, Real.Angle.coe_zero]\n[GOAL]\ncase inr.inl.inr.inl\nx : ℂ\nhx : x ≠ 0\nhi : x.im = 0\nhr : x.re = 0\n⊢ ↑(arg (-↑x.re)) = ↑(arg ↑x.re) + ↑π\n[PROOFSTEP]\nexact False.elim (hx (ext hr hi))\n[GOAL]\ncase inr.inl.inr.inr\nx : ℂ\nhx : x ≠ 0\nhi : x.im = 0\nhr : 0 < x.re\n⊢ ↑(arg (-↑x.re)) = ↑(arg ↑x.re) + ↑π\n[PROOFSTEP]\nrw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr), Real.Angle.coe_zero, zero_add]\n[GOAL]\ncase inr.inr\nx : ℂ\nhx : x ≠ 0\nhi : 0 < x.im\n⊢ ↑(arg (-x)) = ↑(arg x) + ↑π\n[PROOFSTEP]\nrw [arg_neg_eq_arg_sub_pi_of_im_pos hi, Real.Angle.coe_sub, Real.Angle.sub_coe_pi_eq_add_coe_pi]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) = toIocMod two_pi_pos (-π) θ\n[PROOFSTEP]\nhave hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π :=\n by\n convert toIocMod_mem_Ioc _ _ θ\n ring\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nconvert toIocMod_mem_Ioc _ _ θ\n[GOAL]\ncase h.e'_5.h.e'_4\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ π = -π + 2 * π\n[PROOFSTEP]\nring\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhi : toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π\n⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) = toIocMod two_pi_pos (-π) θ\n[PROOFSTEP]\nconvert arg_mul_cos_add_sin_mul_I hr hi using 3\n[GOAL]\ncase h.e'_2.h.e'_1.h.e'_6\nr : ℝ\nhr : 0 < r\nθ : ℝ\nhi : toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π\n⊢ cos ↑θ + sin ↑θ * I = cos ↑(toIocMod two_pi_pos (-π) θ) + sin ↑(toIocMod two_pi_pos (-π) θ) * I\n[PROOFSTEP]\nsimp [toIocMod, cos_sub_int_mul_two_pi, sin_sub_int_mul_two_pi]\n[GOAL]\nθ : ℝ\n⊢ arg (cos ↑θ + sin ↑θ * I) = toIocMod two_pi_pos (-π) θ\n[PROOFSTEP]\nrw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_eq_toIocMod zero_lt_one]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋\n[PROOFSTEP]\nrw [arg_mul_cos_add_sin_mul_I_eq_toIocMod hr, toIocMod_sub_self, toIocDiv_eq_neg_floor, zsmul_eq_mul]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ ↑(- -⌊(-π + 2 * π - θ) / (2 * π)⌋) * (2 * π) = 2 * π * ↑⌊(π - θ) / (2 * π)⌋\n[PROOFSTEP]\nring_nf\n[GOAL]\nθ : ℝ\n⊢ arg (cos ↑θ + sin ↑θ * I) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋\n[PROOFSTEP]\nrw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_sub zero_lt_one]\n[GOAL]\nr : ℝ\nhr : 0 < r\nθ : Angle\n⊢ ↑(arg (↑r * (↑(Angle.cos θ) + ↑(Angle.sin θ) * I))) = θ\n[PROOFSTEP]\ninduction' θ using Real.Angle.induction_on with θ\n[GOAL]\ncase h\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ ↑(arg (↑r * (↑(Angle.cos ↑θ) + ↑(Angle.sin ↑θ) * I))) = ↑θ\n[PROOFSTEP]\nrw [Real.Angle.cos_coe, Real.Angle.sin_coe, Real.Angle.angle_eq_iff_two_pi_dvd_sub]\n[GOAL]\ncase h\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ ∃ k, arg (↑r * (↑(Real.cos θ) + ↑(Real.sin θ) * I)) - θ = 2 * π * ↑k\n[PROOFSTEP]\nuse⌊(π - θ) / (2 * π)⌋\n[GOAL]\ncase h\nr : ℝ\nhr : 0 < r\nθ : ℝ\n⊢ arg (↑r * (↑(Real.cos θ) + ↑(Real.sin θ) * I)) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋\n[PROOFSTEP]\nexact_mod_cast arg_mul_cos_add_sin_mul_I_sub hr θ\n[GOAL]\nθ : Angle\n⊢ ↑(arg (↑(Angle.cos θ) + ↑(Angle.sin θ) * I)) = θ\n[PROOFSTEP]\nrw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_coe_angle zero_lt_one]\n[GOAL]\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ ↑(arg (x * y)) = ↑(arg x) + ↑(arg y)\n[PROOFSTEP]\nconvert arg_mul_cos_add_sin_mul_I_coe_angle (mul_pos (abs.pos hx) (abs.pos hy)) (arg x + arg y : Real.Angle) using 3\n[GOAL]\ncase h.e'_2.h.e'_1.h.e'_1\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ x * y = ↑(↑abs x * ↑abs y) * (↑(Angle.cos (↑(arg x) + ↑(arg y))) + ↑(Angle.sin (↑(arg x) + ↑(arg y))) * I)\n[PROOFSTEP]\nsimp_rw [← Real.Angle.coe_add, Real.Angle.sin_coe, Real.Angle.cos_coe, ofReal_cos, ofReal_sin, cos_add_sin_I,\n ofReal_add, add_mul, exp_add, ofReal_mul]\n[GOAL]\ncase h.e'_2.h.e'_1.h.e'_1\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ x * y = ↑(↑abs x) * ↑(↑abs y) * (exp (↑(arg x) * I) * exp (↑(arg y) * I))\n[PROOFSTEP]\nrw [mul_assoc, mul_comm (exp _), ← mul_assoc (abs y : ℂ), abs_mul_exp_arg_mul_I, mul_comm y, ← mul_assoc,\n abs_mul_exp_arg_mul_I]\n[GOAL]\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ ↑(arg (x / y)) = ↑(arg x) - ↑(arg y)\n[PROOFSTEP]\nrw [div_eq_mul_inv, arg_mul_coe_angle hx (inv_ne_zero hy), arg_inv_coe_angle, sub_eq_add_neg]\n[GOAL]\nz : ℂ\n⊢ Angle.toReal ↑(arg z) = arg z\n[PROOFSTEP]\nrw [Real.Angle.toReal_coe_eq_self_iff_mem_Ioc]\n[GOAL]\nz : ℂ\n⊢ arg z ∈ Set.Ioc (-π) π\n[PROOFSTEP]\nexact arg_mem_Ioc _\n[GOAL]\nz : ℂ\nθ : Angle\n⊢ ↑(arg z) = θ ↔ arg z = Angle.toReal θ\n[PROOFSTEP]\nrw [← Real.Angle.toReal_inj, arg_coe_angle_toReal_eq_arg]\n[GOAL]\nx y : ℂ\n⊢ ↑(arg x) = ↑(arg y) ↔ arg x = arg y\n[PROOFSTEP]\nsimp_rw [← Real.Angle.toReal_inj, arg_coe_angle_toReal_eq_arg]\n[GOAL]\nx z : ℂ\nhx_re : x.re < 0\nhx_im : 0 < x.im\n⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / ↑abs x) + π\n[PROOFSTEP]\nsuffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ 0 < y.im\n[GOAL]\nx z : ℂ\nhx_re : x.re < 0\nhx_im : 0 < x.im\nh_forall_nhds : ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im\n⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / ↑abs x) + π\ncase h_forall_nhds x z : ℂ hx_re : x.re < 0 hx_im : 0 < x.im ⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im\n[PROOFSTEP]\nexact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_nonneg hy.1 hy.2.le\n[GOAL]\ncase h_forall_nhds\nx z : ℂ\nhx_re : x.re < 0\nhx_im : 0 < x.im\n⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im\n[PROOFSTEP]\nrefine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ 0 < x.im)\n[GOAL]\ncase h_forall_nhds\nx z : ℂ\nhx_re : x.re < 0\nhx_im : 0 < x.im\n⊢ IsOpen fun y => y.re < 0 ∧ 0 < y.im\n[PROOFSTEP]\nexact IsOpen.and (isOpen_lt continuous_re continuous_zero) (isOpen_lt continuous_zero continuous_im)\n[GOAL]\nx z : ℂ\nhx_re : x.re < 0\nhx_im : x.im < 0\n⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / ↑abs x) - π\n[PROOFSTEP]\nsuffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ y.im < 0\n[GOAL]\nx z : ℂ\nhx_re : x.re < 0\nhx_im : x.im < 0\nh_forall_nhds : ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0\n⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / ↑abs x) - π\ncase h_forall_nhds x z : ℂ hx_re : x.re < 0 hx_im : x.im < 0 ⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0\n[PROOFSTEP]\nexact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_neg hy.1 hy.2\n[GOAL]\ncase h_forall_nhds\nx z : ℂ\nhx_re : x.re < 0\nhx_im : x.im < 0\n⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0\n[PROOFSTEP]\nrefine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ x.im < 0)\n[GOAL]\ncase h_forall_nhds\nx z : ℂ\nhx_re : x.re < 0\nhx_im : x.im < 0\n⊢ IsOpen fun y => y.re < 0 ∧ y.im < 0\n[PROOFSTEP]\nexact IsOpen.and (isOpen_lt continuous_re continuous_zero) (isOpen_lt continuous_im continuous_zero)\n[GOAL]\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\n⊢ ContinuousAt arg x\n[PROOFSTEP]\nhave h₀ : abs x ≠ 0 := by\n rw [abs.ne_zero_iff]\n rintro rfl\n simp at h \n[GOAL]\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\n⊢ ↑abs x ≠ 0\n[PROOFSTEP]\nrw [abs.ne_zero_iff]\n[GOAL]\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\n⊢ x ≠ 0\n[PROOFSTEP]\nrintro rfl\n[GOAL]\nz : ℂ\nh : 0 < 0.re ∨ 0.im ≠ 0\n⊢ False\n[PROOFSTEP]\nsimp at h \n[GOAL]\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\nh₀ : ↑abs x ≠ 0\n⊢ ContinuousAt arg x\n[PROOFSTEP]\nrw [← lt_or_lt_iff_ne] at h \n[GOAL]\nx z : ℂ\nh✝ : 0 < x.re ∨ x.im ≠ 0\nh : 0 < x.re ∨ x.im < 0 ∨ 0 < x.im\nh₀ : ↑abs x ≠ 0\n⊢ ContinuousAt arg x\n[PROOFSTEP]\nrcases h with (hx_re | hx_im | hx_im)\n[GOAL]\ncase inl\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\nh₀ : ↑abs x ≠ 0\nhx_re : 0 < x.re\n⊢ ContinuousAt arg x\ncase inr.inl\nx z : ℂ\nh : 0 < x.re ∨ x.im ≠ 0\nh₀ : ↑abs x ≠ 0\nhx_im : x.im < 0\n⊢ ContinuousAt arg x\ncase inr.inr x z : ℂ h : 0 < x.re ∨ x.im ≠ 0 h₀ : ↑abs x ≠ 0 hx_im : 0 < x.im ⊢ ContinuousAt arg x\n[PROOFSTEP]\nexacts\n [(Real.continuousAt_arcsin.comp (continuous_im.continuousAt.div continuous_abs.continuousAt h₀)).congr\n (arg_eq_nhds_of_re_pos hx_re).symm,\n (Real.continuous_arccos.continuousAt.comp (continuous_re.continuousAt.div continuous_abs.continuousAt h₀)).neg.congr\n (arg_eq_nhds_of_im_neg hx_im).symm,\n (Real.continuous_arccos.continuousAt.comp (continuous_re.continuousAt.div continuous_abs.continuousAt h₀)).congr\n (arg_eq_nhds_of_im_pos hx_im).symm]\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ Tendsto arg (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\n[PROOFSTEP]\nsuffices H : Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{z : ℂ | z.im < 0}] z) (𝓝 (-π))\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nH : Tendsto (fun x => arcsin ((-x).im / ↑abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\n⊢ Tendsto arg (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\n[PROOFSTEP]\nrefine' H.congr' _\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nH : Tendsto (fun x => arcsin ((-x).im / ↑abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\n⊢ (fun x => arcsin ((-x).im / ↑abs x) - π) =ᶠ[𝓝[{z | z.im < 0}] z] arg\n[PROOFSTEP]\nhave : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 :=\n continuous_re.tendsto z\n (gt_mem_nhds hre)\n -- Porting note: need to specify the `nhdsWithin` set\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nH : Tendsto (fun x => arcsin ((-x).im / ↑abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\nthis : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0\n⊢ (fun x => arcsin ((-x).im / ↑abs x) - π) =ᶠ[𝓝[{z | z.im < 0}] z] arg\n[PROOFSTEP]\nfilter_upwards [self_mem_nhdsWithin (s := {z : ℂ | z.im < 0}), mem_nhdsWithin_of_mem_nhds this] with _ him hre\n[GOAL]\ncase h\nx z✝ z : ℂ\nhre✝ : z.re < 0\nhim✝ : z.im = 0\nH : Tendsto (fun x => arcsin ((-x).im / ↑abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\nthis : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0\na✝ : ℂ\nhim : a✝.im < 0\nhre : a✝.re < 0\n⊢ arcsin ((-a✝).im / ↑abs a✝) - π = arg a✝\n[PROOFSTEP]\nrw [arg, if_neg hre.not_le, if_neg him.not_le]\n[GOAL]\ncase H\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ Tendsto (fun x => arcsin ((-x).im / ↑abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))\n[PROOFSTEP]\nconvert\n (Real.continuousAt_arcsin.comp_continuousWithinAt\n ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div\n continuous_abs.continuousWithinAt (s := {z : ℂ | z.im < 0}) (_ : abs z ≠ 0))\n -- Porting note: specify constant precisely to assist in goal below).sub_const\n π using\n 1\n[GOAL]\ncase h.e'_5\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ 𝓝 (-π) = 𝓝 ((arcsin ∘ (im ∘ Neg.neg / ↑abs)) z - π)\n[PROOFSTEP]\nsimp [him]\n[GOAL]\ncase H\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ ↑abs z ≠ 0\n[PROOFSTEP]\nlift z to ℝ using him\n[GOAL]\ncase H.intro\nx z✝ : ℂ\nz : ℝ\nhre : (↑z).re < 0\n⊢ ↑abs ↑z ≠ 0\n[PROOFSTEP]\nsimpa using hre.ne\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ ContinuousWithinAt arg {z | 0 ≤ z.im} z\n[PROOFSTEP]\nhave : arg =ᶠ[𝓝[{z : ℂ | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π :=\n by\n have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)\n filter_upwards [self_mem_nhdsWithin (s := {z : ℂ | 0 ≤ z.im}), mem_nhdsWithin_of_mem_nhds this] with _ him hre\n rw [arg, if_neg hre.not_le, if_pos him]\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n[PROOFSTEP]\nhave : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nthis : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0\n⊢ arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n[PROOFSTEP]\nfilter_upwards [self_mem_nhdsWithin (s := {z : ℂ | 0 ≤ z.im}), mem_nhdsWithin_of_mem_nhds this] with _ him hre\n[GOAL]\ncase h\nx z✝ z : ℂ\nhre✝ : z.re < 0\nhim✝ : z.im = 0\nthis : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0\na✝ : ℂ\nhim : 0 ≤ a✝.im\nhre : a✝.re < 0\n⊢ arg a✝ = arcsin ((-a✝).im / ↑abs a✝) + π\n[PROOFSTEP]\nrw [arg, if_neg hre.not_le, if_pos him]\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nthis : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n⊢ ContinuousWithinAt arg {z | 0 ≤ z.im} z\n[PROOFSTEP]\nrefine' ContinuousWithinAt.congr_of_eventuallyEq _ this _\n[GOAL]\ncase refine'_1\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nthis : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n⊢ ContinuousWithinAt (fun x => arcsin ((-x).im / ↑abs x) + π) {z | 0 ≤ z.im} z\n[PROOFSTEP]\nrefine'\n (Real.continuousAt_arcsin.comp_continuousWithinAt\n ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div\n continuous_abs.continuousWithinAt _)).add\n tendsto_const_nhds\n[GOAL]\ncase refine'_1\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nthis : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n⊢ ↑abs z ≠ 0\n[PROOFSTEP]\nlift z to ℝ using him\n[GOAL]\ncase refine'_1.intro\nx z✝ : ℂ\nz : ℝ\nhre : (↑z).re < 0\nthis : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] ↑z] fun x => arcsin ((-x).im / ↑abs x) + π\n⊢ ↑abs ↑z ≠ 0\n[PROOFSTEP]\nsimpa using hre.ne\n[GOAL]\ncase refine'_2\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\nthis : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => arcsin ((-x).im / ↑abs x) + π\n⊢ arg z = arcsin ((-z).im / ↑abs z) + π\n[PROOFSTEP]\nrw [arg, if_neg hre.not_le, if_pos him.ge]\n[GOAL]\nx z✝ z : ℂ\nhre : z.re < 0\nhim : z.im = 0\n⊢ Tendsto arg (𝓝[{z | 0 ≤ z.im}] z) (𝓝 π)\n[PROOFSTEP]\nsimpa only [arg_eq_pi_iff.2 ⟨hre, him⟩] using (continuousWithinAt_arg_of_re_neg_of_im_zero hre him).tendsto\n[GOAL]\nx z : ℂ\nh : x ≠ 0\n⊢ ContinuousAt (Angle.coe ∘ arg) x\n[PROOFSTEP]\nby_cases hs : 0 < x.re ∨ x.im ≠ 0\n[GOAL]\ncase pos\nx z : ℂ\nh : x ≠ 0\nhs : 0 < x.re ∨ x.im ≠ 0\n⊢ ContinuousAt (Angle.coe ∘ arg) x\n[PROOFSTEP]\nexact Real.Angle.continuous_coe.continuousAt.comp (continuousAt_arg hs)\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ContinuousAt (Angle.coe ∘ arg) x\n[PROOFSTEP]\nrw [← Function.comp.right_id (((↑) : ℝ → Real.Angle) ∘ arg),\n (Function.funext_iff.2 fun _ => (neg_neg _).symm : (id : ℂ → ℂ) = Neg.neg ∘ Neg.neg), ← Function.comp.assoc]\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ContinuousAt (((Angle.coe ∘ arg) ∘ Neg.neg) ∘ Neg.neg) x\n[PROOFSTEP]\nrefine' ContinuousAt.comp _ continuous_neg.continuousAt\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ContinuousAt ((Angle.coe ∘ arg) ∘ Neg.neg) (-x)\n[PROOFSTEP]\nsuffices ContinuousAt (Function.update (((↑) ∘ arg) ∘ Neg.neg : ℂ → Real.Angle) 0 π) (-x) by\n rwa [continuousAt_update_of_ne (neg_ne_zero.2 h)] at this \n[GOAL]\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\nthis : ContinuousAt (Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)\n⊢ ContinuousAt ((Angle.coe ∘ arg) ∘ Neg.neg) (-x)\n[PROOFSTEP]\nrwa [continuousAt_update_of_ne (neg_ne_zero.2 h)] at this \n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ContinuousAt (Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)\n[PROOFSTEP]\nhave ha : Function.update (((↑) ∘ arg) ∘ Neg.neg : ℂ → Real.Angle) 0 π = fun z => (arg z : Real.Angle) + π :=\n by\n rw [Function.update_eq_iff]\n exact ⟨by simp, fun z hz => arg_neg_coe_angle hz⟩\n[GOAL]\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\n[PROOFSTEP]\nrw [Function.update_eq_iff]\n[GOAL]\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ↑π = ↑(arg 0) + ↑π ∧ ∀ (x : ℂ), x ≠ 0 → ((Angle.coe ∘ arg) ∘ Neg.neg) x = ↑(arg x) + ↑π\n[PROOFSTEP]\nexact ⟨by simp, fun z hz => arg_neg_coe_angle hz⟩\n[GOAL]\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\n⊢ ↑π = ↑(arg 0) + ↑π\n[PROOFSTEP]\nsimp\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\nha : Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\n⊢ ContinuousAt (Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)\n[PROOFSTEP]\nrw [ha]\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nhs : ¬(0 < x.re ∨ x.im ≠ 0)\nha : Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\n⊢ ContinuousAt (fun z => ↑(arg z) + ↑π) (-x)\n[PROOFSTEP]\npush_neg at hs \n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nha : Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\nhs : x.re ≤ 0 ∧ x.im = 0\n⊢ ContinuousAt (fun z => ↑(arg z) + ↑π) (-x)\n[PROOFSTEP]\nrefine' (Real.Angle.continuous_coe.continuousAt.comp (continuousAt_arg (Or.inl _))).add continuousAt_const\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nha : Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\nhs : x.re ≤ 0 ∧ x.im = 0\n⊢ 0 < (-x).re\n[PROOFSTEP]\nrw [neg_re, neg_pos]\n[GOAL]\ncase neg\nx z : ℂ\nh : x ≠ 0\nha : Function.update ((Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑(arg z) + ↑π\nhs : x.re ≤ 0 ∧ x.im = 0\n⊢ x.re < 0\n[PROOFSTEP]\nexact hs.1.lt_of_ne fun h0 => h (ext_iff.2 ⟨h0, hs.2⟩)\n", "meta": {"mathlib_filename": "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "llama_tokens": 31299, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8933094117351309, "lm_q2_score": 0.7690802264851918, "lm_q1q2_score": 0.6870266046986079}} {"text": "[GOAL]\nα : Type u_1\ns : Finset α\nf : α → ℕ\n⊢ ∏ i in s, (f i)! ∣ (∑ i in s, f i)!\n[PROOFSTEP]\nclassical\ninduction' s using Finset.induction with a' s' has ih\n· simp only [Finset.sum_empty, Finset.prod_empty, factorial]\n· simp only [Finset.prod_insert has, Finset.sum_insert has]\n refine' dvd_trans (mul_dvd_mul_left (f a')! ih) _\n apply Nat.factorial_mul_factorial_dvd_factorial_add\n[GOAL]\nα : Type u_1\ns : Finset α\nf : α → ℕ\n⊢ ∏ i in s, (f i)! ∣ (∑ i in s, f i)!\n[PROOFSTEP]\ninduction' s using Finset.induction with a' s' has ih\n[GOAL]\ncase empty\nα : Type u_1\ns : Finset α\nf : α → ℕ\n⊢ ∏ i in ∅, (f i)! ∣ (∑ i in ∅, f i)!\n[PROOFSTEP]\nsimp only [Finset.sum_empty, Finset.prod_empty, factorial]\n[GOAL]\ncase insert\nα : Type u_1\ns : Finset α\nf : α → ℕ\na' : α\ns' : Finset α\nhas : ¬a' ∈ s'\nih : ∏ i in s', (f i)! ∣ (∑ i in s', f i)!\n⊢ ∏ i in insert a' s', (f i)! ∣ (∑ i in insert a' s', f i)!\n[PROOFSTEP]\nsimp only [Finset.prod_insert has, Finset.sum_insert has]\n[GOAL]\ncase insert\nα : Type u_1\ns : Finset α\nf : α → ℕ\na' : α\ns' : Finset α\nhas : ¬a' ∈ s'\nih : ∏ i in s', (f i)! ∣ (∑ i in s', f i)!\n⊢ (f a')! * ∏ i in s', (f i)! ∣ (f a' + ∑ i in s', f i)!\n[PROOFSTEP]\nrefine' dvd_trans (mul_dvd_mul_left (f a')! ih) _\n[GOAL]\ncase insert\nα : Type u_1\ns : Finset α\nf : α → ℕ\na' : α\ns' : Finset α\nhas : ¬a' ∈ s'\nih : ∏ i in s', (f i)! ∣ (∑ i in s', f i)!\n⊢ (f a')! * (∑ i in s', f i)! ∣ (f a' + ∑ i in s', f i)!\n[PROOFSTEP]\napply Nat.factorial_mul_factorial_dvd_factorial_add\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Factorial.BigOperators", "llama_tokens": 741, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8962513731336202, "lm_q2_score": 0.7662936484231889, "lm_q1q2_score": 0.6867917346228547}} {"text": "[GOAL]\nR : Type u_1\nS : Type u_2\nM : Type u_3\nN : Type u_4\nr : Semiring R\ninst✝⁵ : AddCommMonoid M\ninst✝⁴ : AddCommMonoid N\ninst✝³ : Module R M\ninst✝² : Module R N\ninst✝¹ : NoZeroSMulDivisors R M\ninst✝ : NoZeroSMulDivisors R N\n⊢ ∀ {c : R} {x : M × N}, c • x = 0 → c = 0 ∨ x = 0\n[PROOFSTEP]\nintro c ⟨x, y⟩ h\n[GOAL]\nR : Type u_1\nS : Type u_2\nM : Type u_3\nN : Type u_4\nr : Semiring R\ninst✝⁵ : AddCommMonoid M\ninst✝⁴ : AddCommMonoid N\ninst✝³ : Module R M\ninst✝² : Module R N\ninst✝¹ : NoZeroSMulDivisors R M\ninst✝ : NoZeroSMulDivisors R N\nc : R\nx : M\ny : N\nh : c • (x, y) = 0\n⊢ c = 0 ∨ (x, y) = 0\n[PROOFSTEP]\nexact\n or_iff_not_imp_left.mpr fun hc =>\n mk.inj_iff.mpr\n ⟨(smul_eq_zero.mp (congr_arg fst h)).resolve_left hc, (smul_eq_zero.mp (congr_arg snd h)).resolve_left hc⟩\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Module.Prod", "llama_tokens": 413, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8791467548438124, "lm_q2_score": 0.7799928951399098, "lm_q1q2_score": 0.6857282225634818}} {"text": "[GOAL]\nm k : ℕ\n⊢ hyperoperation 0 m k = Nat.succ k\n[PROOFSTEP]\nrw [hyperoperation, Nat.succ_eq_add_one]\n[GOAL]\nn m : ℕ\n⊢ hyperoperation (n + 3) m 0 = 1\n[PROOFSTEP]\nrw [hyperoperation]\n[GOAL]\nn m k : ℕ\n⊢ hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k)\n[PROOFSTEP]\nrw [hyperoperation]\n[GOAL]\n⊢ hyperoperation 1 = fun x x_1 => x + x_1\n[PROOFSTEP]\next m k\n[GOAL]\ncase h.h\nm k : ℕ\n⊢ hyperoperation 1 m k = m + k\n[PROOFSTEP]\ninduction' k with bn bih\n[GOAL]\ncase h.h.zero\nm : ℕ\n⊢ hyperoperation 1 m Nat.zero = m + Nat.zero\n[PROOFSTEP]\nrw [Nat.add_zero m, hyperoperation]\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 1 m bn = m + bn\n⊢ hyperoperation 1 m (Nat.succ bn) = m + Nat.succ bn\n[PROOFSTEP]\nrw [hyperoperation_recursion, bih, hyperoperation_zero]\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 1 m bn = m + bn\n⊢ Nat.succ (m + bn) = m + Nat.succ bn\n[PROOFSTEP]\nexact Nat.add_assoc m bn 1\n[GOAL]\n⊢ hyperoperation 2 = fun x x_1 => x * x_1\n[PROOFSTEP]\next m k\n[GOAL]\ncase h.h\nm k : ℕ\n⊢ hyperoperation 2 m k = m * k\n[PROOFSTEP]\ninduction' k with bn bih\n[GOAL]\ncase h.h.zero\nm : ℕ\n⊢ hyperoperation 2 m Nat.zero = m * Nat.zero\n[PROOFSTEP]\nrw [hyperoperation]\n[GOAL]\ncase h.h.zero\nm : ℕ\n⊢ 0 = m * Nat.zero\n[PROOFSTEP]\nexact (Nat.mul_zero m).symm\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 2 m bn = m * bn\n⊢ hyperoperation 2 m (Nat.succ bn) = m * Nat.succ bn\n[PROOFSTEP]\nrw [hyperoperation_recursion, hyperoperation_one, bih]\n -- porting note: was `ring`\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 2 m bn = m * bn\n⊢ (fun x x_1 => x + x_1) m (m * bn) = m * Nat.succ bn\n[PROOFSTEP]\ndsimp only\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 2 m bn = m * bn\n⊢ m + m * bn = m * Nat.succ bn\n[PROOFSTEP]\nnth_rewrite 1 [← mul_one m]\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 2 m bn = m * bn\n⊢ m * 1 + m * bn = m * Nat.succ bn\n[PROOFSTEP]\nrw [← mul_add, add_comm, Nat.succ_eq_add_one]\n[GOAL]\n⊢ hyperoperation 3 = fun x x_1 => x ^ x_1\n[PROOFSTEP]\next m k\n[GOAL]\ncase h.h\nm k : ℕ\n⊢ hyperoperation 3 m k = m ^ k\n[PROOFSTEP]\ninduction' k with bn bih\n[GOAL]\ncase h.h.zero\nm : ℕ\n⊢ hyperoperation 3 m Nat.zero = m ^ Nat.zero\n[PROOFSTEP]\nrw [hyperoperation_ge_three_eq_one]\n[GOAL]\ncase h.h.zero\nm : ℕ\n⊢ 1 = m ^ Nat.zero\n[PROOFSTEP]\nexact (pow_zero m).symm\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 3 m bn = m ^ bn\n⊢ hyperoperation 3 m (Nat.succ bn) = m ^ Nat.succ bn\n[PROOFSTEP]\nrw [hyperoperation_recursion, hyperoperation_two, bih]\n[GOAL]\ncase h.h.succ\nm bn : ℕ\nbih : hyperoperation 3 m bn = m ^ bn\n⊢ (fun x x_1 => x * x_1) m (m ^ bn) = m ^ Nat.succ bn\n[PROOFSTEP]\nexact (pow_succ m bn).symm\n[GOAL]\nn m : ℕ\n⊢ hyperoperation (n + 2) m 1 = m\n[PROOFSTEP]\ninduction' n with nn nih\n[GOAL]\ncase zero\nm : ℕ\n⊢ hyperoperation (Nat.zero + 2) m 1 = m\n[PROOFSTEP]\nrw [hyperoperation_two]\n[GOAL]\ncase zero\nm : ℕ\n⊢ (fun x x_1 => x * x_1) m 1 = m\n[PROOFSTEP]\nring\n[GOAL]\ncase succ\nm nn : ℕ\nnih : hyperoperation (nn + 2) m 1 = m\n⊢ hyperoperation (Nat.succ nn + 2) m 1 = m\n[PROOFSTEP]\nrw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih]\n[GOAL]\nn : ℕ\n⊢ hyperoperation (n + 1) 2 2 = 4\n[PROOFSTEP]\ninduction' n with nn nih\n[GOAL]\ncase zero\n⊢ hyperoperation (Nat.zero + 1) 2 2 = 4\n[PROOFSTEP]\nrw [hyperoperation_one]\n[GOAL]\ncase succ\nnn : ℕ\nnih : hyperoperation (nn + 1) 2 2 = 4\n⊢ hyperoperation (Nat.succ nn + 1) 2 2 = 4\n[PROOFSTEP]\nrw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih]\n[GOAL]\nn : ℕ\n⊢ ∀ (k : ℕ), hyperoperation (n + 3) 1 k = 1\n[PROOFSTEP]\ninduction' n with nn nih\n[GOAL]\ncase zero\n⊢ ∀ (k : ℕ), hyperoperation (Nat.zero + 3) 1 k = 1\n[PROOFSTEP]\nintro k\n[GOAL]\ncase zero\nk : ℕ\n⊢ hyperoperation (Nat.zero + 3) 1 k = 1\n[PROOFSTEP]\nrw [hyperoperation_three]\n[GOAL]\ncase zero\nk : ℕ\n⊢ (fun x x_1 => x ^ x_1) 1 k = 1\n[PROOFSTEP]\ndsimp\n[GOAL]\ncase zero\nk : ℕ\n⊢ 1 ^ k = 1\n[PROOFSTEP]\nrw [one_pow]\n[GOAL]\ncase succ\nnn : ℕ\nnih : ∀ (k : ℕ), hyperoperation (nn + 3) 1 k = 1\n⊢ ∀ (k : ℕ), hyperoperation (Nat.succ nn + 3) 1 k = 1\n[PROOFSTEP]\nintro k\n[GOAL]\ncase succ\nnn : ℕ\nnih : ∀ (k : ℕ), hyperoperation (nn + 3) 1 k = 1\nk : ℕ\n⊢ hyperoperation (Nat.succ nn + 3) 1 k = 1\n[PROOFSTEP]\ncases k\n[GOAL]\ncase succ.zero\nnn : ℕ\nnih : ∀ (k : ℕ), hyperoperation (nn + 3) 1 k = 1\n⊢ hyperoperation (Nat.succ nn + 3) 1 Nat.zero = 1\n[PROOFSTEP]\nrw [hyperoperation_ge_three_eq_one]\n[GOAL]\ncase succ.succ\nnn : ℕ\nnih : ∀ (k : ℕ), hyperoperation (nn + 3) 1 k = 1\nn✝ : ℕ\n⊢ hyperoperation (Nat.succ nn + 3) 1 (Nat.succ n✝) = 1\n[PROOFSTEP]\nrw [hyperoperation_recursion, nih]\n[GOAL]\nn k : ℕ\n⊢ hyperoperation (n + 4) 0 k = if Even k then 1 else 0\n[PROOFSTEP]\ninduction' k with kk kih\n[GOAL]\ncase zero\nn : ℕ\n⊢ hyperoperation (n + 4) 0 Nat.zero = if Even Nat.zero then 1 else 0\n[PROOFSTEP]\nrw [hyperoperation_ge_three_eq_one]\n[GOAL]\ncase zero\nn : ℕ\n⊢ 1 = if Even Nat.zero then 1 else 0\n[PROOFSTEP]\nsimp only [even_zero, if_true]\n[GOAL]\ncase succ\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\n⊢ hyperoperation (n + 4) 0 (Nat.succ kk) = if Even (Nat.succ kk) then 1 else 0\n[PROOFSTEP]\nrw [hyperoperation_recursion]\n[GOAL]\ncase succ\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\n⊢ hyperoperation (n + 3) 0 (hyperoperation (n + 3 + 1) 0 kk) = if Even (Nat.succ kk) then 1 else 0\n[PROOFSTEP]\nrw [kih]\n[GOAL]\ncase succ\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\n⊢ hyperoperation (n + 3) 0 (if Even kk then 1 else 0) = if Even (Nat.succ kk) then 1 else 0\n[PROOFSTEP]\nsimp_rw [Nat.even_add_one]\n[GOAL]\ncase succ\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\n⊢ hyperoperation (n + 3) 0 (if Even kk then 1 else 0) = if ¬Even kk then 1 else 0\n[PROOFSTEP]\nsplit_ifs\n[GOAL]\ncase pos\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\nh✝ : Even kk\n⊢ hyperoperation (n + 3) 0 1 = 0\n[PROOFSTEP]\nexact hyperoperation_ge_two_eq_self (n + 1) 0\n[GOAL]\ncase neg\nn kk : ℕ\nkih : hyperoperation (n + 4) 0 kk = if Even kk then 1 else 0\nh✝ : ¬Even kk\n⊢ hyperoperation (n + 3) 0 0 = 1\n[PROOFSTEP]\nexact hyperoperation_ge_three_eq_one n 0\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Hyperoperation", "llama_tokens": 2990, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8670357666736772, "lm_q2_score": 0.7905303087996143, "lm_q1q2_score": 0.6854180523688523}} {"text": "[GOAL]\na : ℕ\n⊢ Periodic (gcd a) a\n[PROOFSTEP]\nsimp only [forall_const, gcd_add_self_right, eq_self_iff_true, Periodic]\n[GOAL]\na : ℕ\n⊢ Periodic (coprime a) a\n[PROOFSTEP]\nsimp only [coprime_add_self_right, forall_const, iff_self_iff, eq_iff_iff, Periodic]\n[GOAL]\na : ℕ\n⊢ Periodic (fun n => n % a) a\n[PROOFSTEP]\nsimp only [forall_const, eq_self_iff_true, add_mod_right, Periodic]\n[GOAL]\nα : Type u_1\nf : ℕ → α\na : ℕ\nhf : Periodic f a\nn : ℕ\n⊢ f (n % a) = f n\n[PROOFSTEP]\nconv_rhs => rw [← Nat.mod_add_div n a, mul_comm, ← Nat.nsmul_eq_mul, hf.nsmul]\n[GOAL]\nα : Type u_1\nf : ℕ → α\na : ℕ\nhf : Periodic f a\nn : ℕ\n| f n\n[PROOFSTEP]\nrw [← Nat.mod_add_div n a, mul_comm, ← Nat.nsmul_eq_mul, hf.nsmul]\n[GOAL]\nα : Type u_1\nf : ℕ → α\na : ℕ\nhf : Periodic f a\nn : ℕ\n| f n\n[PROOFSTEP]\nrw [← Nat.mod_add_div n a, mul_comm, ← Nat.nsmul_eq_mul, hf.nsmul]\n[GOAL]\nα : Type u_1\nf : ℕ → α\na : ℕ\nhf : Periodic f a\nn : ℕ\n| f n\n[PROOFSTEP]\nrw [← Nat.mod_add_div n a, mul_comm, ← Nat.nsmul_eq_mul, hf.nsmul]\n[GOAL]\nn a : ℕ\np : ℕ → Prop\ninst✝ : DecidablePred p\npp : Periodic p a\n⊢ ↑card (filter p (Ico n (n + a))) = count p a\n[PROOFSTEP]\nrw [count_eq_card_filter_range, Finset.card, Finset.filter_val, Finset.range_val, ← multiset_Ico_map_mod n, ←\n map_count_True_eq_filter_card, ← map_count_True_eq_filter_card, map_map]\n[GOAL]\nn a : ℕ\np : ℕ → Prop\ninst✝ : DecidablePred p\npp : Periodic p a\n⊢ Multiset.count True (map p (Ico n (n + a))) = Multiset.count True (map (p ∘ fun x => x % a) (Ico n (n + a)))\n[PROOFSTEP]\ncongr\n[GOAL]\ncase e_a.e_f\nn a : ℕ\np : ℕ → Prop\ninst✝ : DecidablePred p\npp : Periodic p a\n⊢ p = p ∘ fun x => x % a\n[PROOFSTEP]\nfunext n\n[GOAL]\ncase e_a.e_f.h\nn✝ a : ℕ\np : ℕ → Prop\ninst✝ : DecidablePred p\npp : Periodic p a\nn : ℕ\n⊢ p n = (p ∘ fun x => x % a) n\n[PROOFSTEP]\nexact (Function.Periodic.map_mod_nat pp n).symm\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Periodic", "llama_tokens": 923, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8774767970940974, "lm_q2_score": 0.7799929053683038, "lm_q1q2_score": 0.6844256763586987}} {"text": "[GOAL]\nE : Type u_1\nF : Type u_2\ninst✝³ : NormedAddCommGroup E\ninst✝² : NormedAddCommGroup F\ninst✝¹ : InnerProductSpace ℝ E\ninst✝ : InnerProductSpace ℝ F\nf : E → F\nx : E\n⊢ ConformalAt f x ↔ ∃ c, 0 < c ∧ ∀ (u v : E), inner (↑(fderiv ℝ f x) u) (↑(fderiv ℝ f x) v) = c * inner u v\n[PROOFSTEP]\nrw [conformalAt_iff_isConformalMap_fderiv, isConformalMap_iff]\n[GOAL]\nE : Type u_1\nF : Type u_2\ninst✝³ : NormedAddCommGroup E\ninst✝² : NormedAddCommGroup F\ninst✝¹ : InnerProductSpace ℝ E\ninst✝ : InnerProductSpace ℝ F\nf : E → F\nx : E\nf' : E →L[ℝ] F\nh : HasFDerivAt f f' x\n⊢ ConformalAt f x ↔ ∃ c, 0 < c ∧ ∀ (u v : E), inner (↑f' u) (↑f' v) = c * inner u v\n[PROOFSTEP]\nsimp only [conformalAt_iff', h.fderiv]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Calculus.Conformal.InnerProduct", "llama_tokens": 350, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9019206870747658, "lm_q2_score": 0.7577943658046609, "lm_q1q2_score": 0.6834704150679262}} {"text": "[GOAL]\nx : ℚ\n⊢ 0 ≤ x ↔ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)\n[PROOFSTEP]\nrefine'\n ⟨fun hx => _, fun hx =>\n AddSubmonoid.closure_induction hx (by rintro - ⟨s, rfl⟩; exact mul_self_nonneg s) le_rfl fun _ _ => add_nonneg⟩\n /- If `x = p / q`, then, since `0 ≤ x`, we have `p q : ℕ`, and `p / q` is the sum of `p * q`\n copies of `(1 / q) ^ 2`, and so `x` lies in the `AddSubmonoid` generated by square elements.\n \n Note: it's possible to rephrase this argument as `x = (p * q) • (1 / q) ^ 2`, but this would\n be somewhat challenging without increasing import requirements. -/\n -- Porting note: rewrote proof to avoid removed constructor rat.mk_pnat\n[GOAL]\nx : ℚ\nhx : x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)\n⊢ ∀ (x : ℚ), (x ∈ Set.range fun s => star s * s) → 0 ≤ x\n[PROOFSTEP]\nrintro - ⟨s, rfl⟩\n[GOAL]\ncase intro\nx : ℚ\nhx : x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)\ns : ℚ\n⊢ 0 ≤ (fun s => star s * s) s\n[PROOFSTEP]\nexact mul_self_nonneg s\n[GOAL]\nx : ℚ\nhx : 0 ≤ x\n⊢ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)\n[PROOFSTEP]\nsuffices (Finset.range (x.num.natAbs * x.den)).sum (Function.const ℕ ((1 : ℚ) / x.den * ((1 : ℚ) / x.den))) = x by\n exact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩\n[GOAL]\nx : ℚ\nhx : 0 ≤ x\nthis : Finset.sum (Finset.range (Int.natAbs x.num * x.den)) (Function.const ℕ (1 / ↑x.den * (1 / ↑x.den))) = x\n⊢ x ∈ AddSubmonoid.closure (Set.range fun s => star s * s)\n[PROOFSTEP]\nexact this ▸ sum_mem fun n _ => AddSubmonoid.subset_closure ⟨_, rfl⟩\n[GOAL]\nx : ℚ\nhx : 0 ≤ x\n⊢ Finset.sum (Finset.range (Int.natAbs x.num * x.den)) (Function.const ℕ (1 / ↑x.den * (1 / ↑x.den))) = x\n[PROOFSTEP]\nsimp only [Function.const_apply, Finset.sum_const, Finset.card_range, nsmul_eq_mul]\n[GOAL]\nx : ℚ\nhx : 0 ≤ x\n⊢ ↑(Int.natAbs x.num * x.den) * (1 / ↑x.den * (1 / ↑x.den)) = x\n[PROOFSTEP]\nrw [← Int.cast_ofNat, Int.ofNat_mul, Int.coe_natAbs, abs_of_nonneg (num_nonneg_iff_zero_le.mpr hx), Int.cast_mul,\n Int.cast_ofNat]\n[GOAL]\nx : ℚ\nhx : 0 ≤ x\n⊢ ↑x.num * ↑x.den * (1 / ↑x.den * (1 / ↑x.den)) = x\n[PROOFSTEP]\nrw [← mul_assoc, mul_assoc (x.num : ℚ), mul_one_div_cancel (Nat.cast_ne_zero.mpr x.pos.ne'), mul_one, mul_one_div,\n Rat.num_div_den]\n", "meta": {"mathlib_filename": "Mathlib.Data.Rat.Star", "llama_tokens": 1058, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8740772253241803, "lm_q2_score": 0.7799929104825006, "lm_q1q2_score": 0.6817740389670759}} {"text": "[GOAL]\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝² : DivisionSemiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nf : α → α\ng : α → M\nx : α\n⊢ birkhoffAverage R f g 0 x = 0\n[PROOFSTEP]\nsimp [birkhoffAverage]\n[GOAL]\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝² : DivisionSemiring R\ninst✝¹ : AddCommMonoid M\ninst✝ : Module R M\nf : α → α\ng : α → M\nx : α\n⊢ birkhoffAverage R f g 1 x = g x\n[PROOFSTEP]\nsimp [birkhoffAverage]\n[GOAL]\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝⁶ : DivisionSemiring R\ninst✝⁵ : AddCommMonoid M\ninst✝⁴ : Module R M\nS : Type u_4\nF : Type u_5\nN : Type u_6\ninst✝³ : DivisionSemiring S\ninst✝² : AddCommMonoid N\ninst✝¹ : Module S N\ninst✝ : AddMonoidHomClass F M N\ng' : F\nf : α → α\ng : α → M\nn : ℕ\nx : α\n⊢ ↑g' (birkhoffAverage R f g n x) = birkhoffAverage S f (↑g' ∘ g) n x\n[PROOFSTEP]\nsimp only [birkhoffAverage, map_inv_nat_cast_smul g' R S, map_birkhoffSum]\n[GOAL]\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝⁴ : DivisionSemiring R\ninst✝³ : AddCommMonoid M\ninst✝² : Module R M\nS : Type u_4\ninst✝¹ : DivisionSemiring S\ninst✝ : Module S M\n⊢ birkhoffAverage R = birkhoffAverage S\n[PROOFSTEP]\next\n[GOAL]\ncase h.h.h.h\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝⁴ : DivisionSemiring R\ninst✝³ : AddCommMonoid M\ninst✝² : Module R M\nS : Type u_4\ninst✝¹ : DivisionSemiring S\ninst✝ : Module S M\nx✝³ : α → α\nx✝² : α → M\nx✝¹ : ℕ\nx✝ : α\n⊢ birkhoffAverage R x✝³ x✝² x✝¹ x✝ = birkhoffAverage S x✝³ x✝² x✝¹ x✝\n[PROOFSTEP]\napply birkhoffAverage_congr_ring\n[GOAL]\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝³ : DivisionSemiring R\ninst✝² : AddCommMonoid M\ninst✝¹ : Module R M\ninst✝ : CharZero R\nf : α → α\nx : α\nh : IsFixedPt f x\ng : α → M\nn : ℕ\nhn : n ≠ 0\n⊢ birkhoffAverage R f g n x = g x\n[PROOFSTEP]\nrw [birkhoffAverage, h.birkhoffSum_eq, nsmul_eq_smul_cast R, inv_smul_smul₀]\n[GOAL]\ncase hc\nR : Type u_1\nα : Type u_2\nM : Type u_3\ninst✝³ : DivisionSemiring R\ninst✝² : AddCommMonoid M\ninst✝¹ : Module R M\ninst✝ : CharZero R\nf : α → α\nx : α\nh : IsFixedPt f x\ng : α → M\nn : ℕ\nhn : n ≠ 0\n⊢ ↑n ≠ 0\n[PROOFSTEP]\nrwa [Nat.cast_ne_zero]\n[GOAL]\nM : Type u_2\nα : Type u_3\nR : Type u_1\ninst✝² : DivisionRing R\ninst✝¹ : AddCommGroup M\ninst✝ : Module R M\nf : α → α\ng : α → M\nn : ℕ\nx : α\n⊢ birkhoffAverage R f g n (f x) - birkhoffAverage R f g n x = (↑n)⁻¹ • (g (f^[n] x) - g x)\n[PROOFSTEP]\nsimp only [birkhoffAverage, birkhoffSum_apply_sub_birkhoffSum, ← smul_sub]\n", "meta": {"mathlib_filename": "Mathlib.Dynamics.BirkhoffSum.Average", "llama_tokens": 1232, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8652240895276223, "lm_q2_score": 0.7879311956428947, "lm_q1q2_score": 0.6817370513605344}} {"text": "[GOAL]\na b : ℕ+\n⊢ card (Icc a b) = ↑b + 1 - ↑a\n[PROOFSTEP]\nrw [← Nat.card_Icc]\n -- porting note: I had to change this to `erw` *and* provide the proof, yuck.\n -- https://github.com/leanprover-community/mathlib4/issues/5164\n[GOAL]\na b : ℕ+\n⊢ card (Icc a b) = card (Icc ↑a ↑b)\n[PROOFSTEP]\nerw [← Finset.map_subtype_embedding_Icc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]\n[GOAL]\na b : ℕ+\n⊢ card (Icc a b) = card (map (Embedding.subtype fun n => 0 < n) (Icc a b))\n[PROOFSTEP]\nrw [card_map]\n[GOAL]\na b : ℕ+\n⊢ card (Ico a b) = ↑b - ↑a\n[PROOFSTEP]\nrw [← Nat.card_Ico]\n -- porting note: I had to change this to `erw` *and* provide the proof, yuck.\n -- https://github.com/leanprover-community/mathlib4/issues/5164\n[GOAL]\na b : ℕ+\n⊢ card (Ico a b) = card (Ico ↑a ↑b)\n[PROOFSTEP]\nerw [← Finset.map_subtype_embedding_Ico _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]\n[GOAL]\na b : ℕ+\n⊢ card (Ico a b) = card (map (Embedding.subtype fun n => 0 < n) (Ico a b))\n[PROOFSTEP]\nrw [card_map]\n[GOAL]\na b : ℕ+\n⊢ card (Ioc a b) = ↑b - ↑a\n[PROOFSTEP]\nrw [← Nat.card_Ioc]\n -- porting note: I had to change this to `erw` *and* provide the proof, yuck.\n -- https://github.com/leanprover-community/mathlib4/issues/5164\n[GOAL]\na b : ℕ+\n⊢ card (Ioc a b) = card (Ioc ↑a ↑b)\n[PROOFSTEP]\nerw [← Finset.map_subtype_embedding_Ioc _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]\n[GOAL]\na b : ℕ+\n⊢ card (Ioc a b) = card (map (Embedding.subtype fun n => 0 < n) (Ioc a b))\n[PROOFSTEP]\nrw [card_map]\n[GOAL]\na b : ℕ+\n⊢ card (Ioo a b) = ↑b - ↑a - 1\n[PROOFSTEP]\nrw [← Nat.card_Ioo]\n -- porting note: I had to change this to `erw` *and* provide the proof, yuck.\n -- https://github.com/leanprover-community/mathlib4/issues/5164\n[GOAL]\na b : ℕ+\n⊢ card (Ioo a b) = card (Ioo ↑a ↑b)\n[PROOFSTEP]\nerw [← Finset.map_subtype_embedding_Ioo _ a b (fun c x _ hx _ hc _ => hc.trans_le hx)]\n[GOAL]\na b : ℕ+\n⊢ card (Ioo a b) = card (map (Embedding.subtype fun n => 0 < n) (Ioo a b))\n[PROOFSTEP]\nrw [card_map]\n[GOAL]\na b : ℕ+\n⊢ card (uIcc a b) = Int.natAbs (↑↑b - ↑↑a) + 1\n[PROOFSTEP]\nrw [← Nat.card_uIcc, ← map_subtype_embedding_uIcc, card_map]\n[GOAL]\na b : ℕ+\n⊢ Fintype.card ↑(Set.Icc a b) = ↑b + 1 - ↑a\n[PROOFSTEP]\nrw [← card_Icc, Fintype.card_ofFinset]\n[GOAL]\na b : ℕ+\n⊢ Fintype.card ↑(Set.Ico a b) = ↑b - ↑a\n[PROOFSTEP]\nrw [← card_Ico, Fintype.card_ofFinset]\n[GOAL]\na b : ℕ+\n⊢ Fintype.card ↑(Set.Ioc a b) = ↑b - ↑a\n[PROOFSTEP]\nrw [← card_Ioc, Fintype.card_ofFinset]\n[GOAL]\na b : ℕ+\n⊢ Fintype.card ↑(Set.Ioo a b) = ↑b - ↑a - 1\n[PROOFSTEP]\nrw [← card_Ioo, Fintype.card_ofFinset]\n[GOAL]\na b : ℕ+\n⊢ Fintype.card ↑(Set.uIcc a b) = Int.natAbs (↑↑b - ↑↑a) + 1\n[PROOFSTEP]\nrw [← card_uIcc, Fintype.card_ofFinset]\n", "meta": {"mathlib_filename": "Mathlib.Data.PNat.Interval", "llama_tokens": 1382, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8670357563664174, "lm_q2_score": 0.785308580887758, "lm_q1q2_score": 0.6808906194110551}} {"text": "[GOAL]\nx : ℝ\nh₁ : -π < x\nh₂ : x ≤ π\n⊢ arg ↑(↑expMapCircle x) = x\n[PROOFSTEP]\nrw [expMapCircle_apply, exp_mul_I, arg_cos_add_sin_mul_I ⟨h₁, h₂⟩]\n[GOAL]\nx y : ℝ\n⊢ ↑expMapCircle x = ↑expMapCircle y ↔ ∃ m, x = y + ↑m * (2 * π)\n[PROOFSTEP]\nrw [Subtype.ext_iff, expMapCircle_apply, expMapCircle_apply, exp_eq_exp_iff_exists_int]\n[GOAL]\nx y : ℝ\n⊢ (∃ n, ↑x * I = ↑y * I + ↑n * (2 * ↑π * I)) ↔ ∃ m, x = y + ↑m * (2 * π)\n[PROOFSTEP]\nrefine' exists_congr fun n => _\n[GOAL]\nx y : ℝ\nn : ℤ\n⊢ ↑x * I = ↑y * I + ↑n * (2 * ↑π * I) ↔ x = y + ↑n * (2 * π)\n[PROOFSTEP]\nrw [← mul_assoc, ← add_mul, mul_left_inj' I_ne_zero]\n[GOAL]\nx y : ℝ\nn : ℤ\n⊢ ↑x = ↑y + ↑n * (2 * ↑π) ↔ x = y + ↑n * (2 * π)\n[PROOFSTEP]\nnorm_cast\n[GOAL]\nz : ℝ\n⊢ z + 2 * π = z + ↑1 * (2 * π)\n[PROOFSTEP]\nrw [Int.cast_one, one_mul]\n[GOAL]\nθ : Angle\n⊢ ↑(expMapCircle θ) = ↑(cos θ) + ↑(sin θ) * I\n[PROOFSTEP]\ninduction θ using Real.Angle.induction_on\n[GOAL]\ncase h\nx✝ : ℝ\n⊢ ↑(expMapCircle ↑x✝) = ↑(cos ↑x✝) + ↑(sin ↑x✝) * I\n[PROOFSTEP]\nsimp [Complex.exp_mul_I]\n[GOAL]\n⊢ expMapCircle 0 = 1\n[PROOFSTEP]\nrw [← Real.Angle.coe_zero, Real.Angle.expMapCircle_coe, _root_.expMapCircle_zero]\n[GOAL]\nθ : Angle\n⊢ expMapCircle (-θ) = (expMapCircle θ)⁻¹\n[PROOFSTEP]\ninduction θ using Real.Angle.induction_on\n[GOAL]\ncase h\nx✝ : ℝ\n⊢ expMapCircle (-↑x✝) = (expMapCircle ↑x✝)⁻¹\n[PROOFSTEP]\nsimp_rw [← Real.Angle.coe_neg, Real.Angle.expMapCircle_coe, _root_.expMapCircle_neg]\n[GOAL]\nθ₁ θ₂ : Angle\n⊢ expMapCircle (θ₁ + θ₂) = expMapCircle θ₁ * expMapCircle θ₂\n[PROOFSTEP]\ninduction θ₁ using Real.Angle.induction_on\n[GOAL]\ncase h\nθ₂ : Angle\nx✝ : ℝ\n⊢ expMapCircle (↑x✝ + θ₂) = expMapCircle ↑x✝ * expMapCircle θ₂\n[PROOFSTEP]\ninduction θ₂ using Real.Angle.induction_on\n[GOAL]\ncase h.h\nx✝¹ x✝ : ℝ\n⊢ expMapCircle (↑x✝¹ + ↑x✝) = expMapCircle ↑x✝¹ * expMapCircle ↑x✝\n[PROOFSTEP]\nexact _root_.expMapCircle_add _ _\n[GOAL]\nθ : Angle\n⊢ ↑(arg ↑(expMapCircle θ)) = θ\n[PROOFSTEP]\ninduction θ using Real.Angle.induction_on\n[GOAL]\ncase h\nx✝ : ℝ\n⊢ ↑(arg ↑(expMapCircle ↑x✝)) = ↑x✝\n[PROOFSTEP]\nrw [Real.Angle.expMapCircle_coe, expMapCircle_apply, exp_mul_I, ← ofReal_cos, ← ofReal_sin, ← Real.Angle.cos_coe, ←\n Real.Angle.sin_coe, arg_cos_add_sin_mul_I_coe_angle]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.SpecialFunctions.Complex.Circle", "llama_tokens": 1218, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8633916170039421, "lm_q2_score": 0.7879312056025699, "lm_q1q2_score": 0.6802931976930684}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\n⊢ IsEquipartition P ↔\n ∀ (a : Finset α),\n a ∈ P.parts →\n Finset.card a = Finset.card s / Finset.card P.parts ∨ Finset.card a = Finset.card s / Finset.card P.parts + 1\n[PROOFSTEP]\nsimp_rw [IsEquipartition, Finset.equitableOn_iff, P.sum_card_parts]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhP : IsEquipartition P\nht : t ∈ P.parts\n⊢ Finset.card s / Finset.card P.parts ≤ Finset.card t\n[PROOFSTEP]\nrw [← P.sum_card_parts]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhP : IsEquipartition P\nht : t ∈ P.parts\n⊢ (Finset.sum P.parts fun i => Finset.card i) / Finset.card P.parts ≤ Finset.card t\n[PROOFSTEP]\nexact Finset.EquitableOn.le hP ht\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhP : IsEquipartition P\nht : t ∈ P.parts\n⊢ Finset.card t ≤ Finset.card s / Finset.card P.parts + 1\n[PROOFSTEP]\nrw [← P.sum_card_parts]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhP : IsEquipartition P\nht : t ∈ P.parts\n⊢ Finset.card t ≤ (Finset.sum P.parts fun i => Finset.card i) / Finset.card P.parts + 1\n[PROOFSTEP]\nexact Finset.EquitableOn.le_add_one hP ht\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\n⊢ ∀ (a : Finset α), a ∈ ↑⊥.parts → Finset.card a = 1 ∨ Finset.card a = 1 + 1\n[PROOFSTEP]\nsimp\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhs : s ≠ ∅\n⊢ IsEquipartition (indiscrete hs)\n[PROOFSTEP]\nrw [IsEquipartition, indiscrete_parts, coe_singleton]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Finset α\nP : Finpartition s\nhs : s ≠ ∅\n⊢ Set.EquitableOn {s} Finset.card\n[PROOFSTEP]\nexact Set.equitableOn_singleton s _\n", "meta": {"mathlib_filename": "Mathlib.Order.Partition.Equipartition", "llama_tokens": 811, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.86153820232079, "lm_q2_score": 0.7879311956428946, "lm_q1q2_score": 0.6788328258466502}} {"text": "[GOAL]\n⊢ CommSemigroup 𝔻\n[PROOFSTEP]\nunfold UnitDisc\n[GOAL]\n⊢ CommSemigroup ↑(ball 0 1)\n[PROOFSTEP]\ninfer_instance\n[GOAL]\n⊢ HasDistribNeg 𝔻\n[PROOFSTEP]\nunfold UnitDisc\n[GOAL]\n⊢ HasDistribNeg ↑(ball 0 1)\n[PROOFSTEP]\ninfer_instance\n[GOAL]\nz : 𝔻\n⊢ ↑normSq ↑z < 1\n[PROOFSTEP]\nconvert (Real.sqrt_lt' one_pos).1 z.abs_lt_one\n[GOAL]\ncase h.e'_4\nz : 𝔻\n⊢ 1 = 1 ^ 2\n[PROOFSTEP]\nexact (one_pow 2).symm\n[GOAL]\nz : 𝔻\n⊢ ↑abs ↑z ≠ ↑abs (-1)\n[PROOFSTEP]\nrw [abs.map_neg, map_one]\n[GOAL]\nz : 𝔻\n⊢ ↑abs ↑z ≠ 1\n[PROOFSTEP]\nexact z.abs_ne_one\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Complex.UnitDisc.Basic", "llama_tokens": 318, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8824278540866548, "lm_q2_score": 0.7690802370707281, "lm_q1q2_score": 0.6786578232187784}} {"text": "[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ q = p / (p - 1)\n[PROOFSTEP]\nhave := h.inv_add_inv_conj\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\nthis : 1 / p + 1 / q = 1\n⊢ q = p / (p - 1)\n[PROOFSTEP]\nrw [← eq_sub_iff_add_eq', one_div, inv_eq_iff_eq_inv] at this \n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\nthis : q = (1 - 1 / p)⁻¹\n⊢ q = p / (p - 1)\n[PROOFSTEP]\nfield_simp [this, h.ne_zero]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ p * q = p + q\n[PROOFSTEP]\nsimpa only [sub_mul, sub_eq_iff_eq_add, one_mul] using h.sub_one_mul_conj\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 < q\n[PROOFSTEP]\nrw [h.conj_eq]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 < p / (p - 1)\n[PROOFSTEP]\nexact (one_lt_div h.sub_one_pos).mpr (sub_one_lt p)\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 / q + 1 / p = 1\n[PROOFSTEP]\nsimpa [add_comm] using h.inv_add_inv_conj\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ p / q = p - 1\n[PROOFSTEP]\nfield_simp [h.symm.ne_zero]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ p = (p - 1) * q\n[PROOFSTEP]\nrw [h.sub_one_mul_conj]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 < toNNReal p\n[PROOFSTEP]\nrw [← Real.toNNReal_one, Real.toNNReal_lt_toNNReal_iff h.pos]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 < p\n[PROOFSTEP]\nexact h.one_lt\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 / toNNReal p + 1 / toNNReal q = 1\n[PROOFSTEP]\nrw [← Real.toNNReal_one, ← Real.toNNReal_div' h.nonneg, ← Real.toNNReal_div' h.symm.nonneg, ←\n Real.toNNReal_add h.one_div_nonneg h.symm.one_div_nonneg, h.inv_add_inv_conj]\n[GOAL]\np q : ℝ\nh : IsConjugateExponent p q\n⊢ 1 / ENNReal.ofReal p + 1 / ENNReal.ofReal q = 1\n[PROOFSTEP]\nrw [← ENNReal.ofReal_one, ← ENNReal.ofReal_div_of_pos h.pos, ← ENNReal.ofReal_div_of_pos h.symm.pos, ←\n ENNReal.ofReal_add h.one_div_nonneg h.symm.one_div_nonneg, h.inv_add_inv_conj]\n[GOAL]\np q : ℝ\nh : 1 < p\nH : q = p / (p - 1)\n⊢ 1 / p + 1 / q = 1\n[PROOFSTEP]\nfield_simp [H, ne_of_gt (lt_trans zero_lt_one h)]\n[GOAL]\na b : ℝ\nha : 0 < a\nhb : 0 < b\nhab : a + b = 1\n⊢ 1 < 1 / a\n[PROOFSTEP]\nrw [lt_div_iff ha, one_mul]\n[GOAL]\na b : ℝ\nha : 0 < a\nhb : 0 < b\nhab : a + b = 1\n⊢ a < 1\n[PROOFSTEP]\nlinarith\n[GOAL]\na b : ℝ\nha : 0 < a\nhb : 0 < b\nhab : a + b = 1\n⊢ 1 / (1 / a) + 1 / (1 / b) = 1\n[PROOFSTEP]\nsimp_rw [one_div_one_div]\n[GOAL]\na b : ℝ\nha : 0 < a\nhb : 0 < b\nhab : a + b = 1\n⊢ a + b = 1\n[PROOFSTEP]\nexact hab\n", "meta": {"mathlib_filename": "Mathlib.Data.Real.ConjugateExponents", "llama_tokens": 1303, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8791467738423873, "lm_q2_score": 0.7718434978390747, "lm_q1q2_score": 0.6785637210364461}} {"text": "[GOAL]\nn : ℕ\npn : NormNum.IsNat n 0\n⊢ List.range n = []\n[PROOFSTEP]\nrw [pn.out, Nat.cast_zero, List.range_zero]\n[GOAL]\nn nn n' : ℕ\npn : NormNum.IsNat n nn\npn' : nn = Nat.succ n'\n⊢ List.range n = 0 :: List.map Nat.succ (List.range n')\n[PROOFSTEP]\nrw [pn.out, Nat.cast_id, pn', List.range_succ_eq_map]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\na : α\ns : Multiset α\n⊢ insert a s = a ::ₘ s\n[PROOFSTEP]\next\n[GOAL]\ncase a\nα : Type u_1\ninst✝ : DecidableEq α\na : α\ns : Multiset α\na✝ : α\n⊢ Multiset.count a✝ (insert a s) = Multiset.count a✝ (a ::ₘ s)\n[PROOFSTEP]\nsimp\n[GOAL]\nn : ℕ\npn : NormNum.IsNat n 0\n⊢ Multiset.range n = 0\n[PROOFSTEP]\nrw [pn.out, Nat.cast_zero, Multiset.range_zero]\n[GOAL]\nn nn n' : ℕ\npn : NormNum.IsNat n nn\npn' : nn = Nat.succ n'\n⊢ Multiset.range n = n' ::ₘ Multiset.range n'\n[PROOFSTEP]\nrw [pn.out, Nat.cast_id, pn', Multiset.range_succ]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\na : α\ns : Finset α\nh : ¬a ∈ s\n⊢ insert a s = Finset.cons a s h\n[PROOFSTEP]\next\n[GOAL]\ncase a\nα : Type u_1\ninst✝ : DecidableEq α\na : α\ns : Finset α\nh : ¬a ∈ s\na✝ : α\n⊢ a✝ ∈ insert a s ↔ a✝ ∈ Finset.cons a s h\n[PROOFSTEP]\nsimp\n[GOAL]\nn : ℕ\npn : NormNum.IsNat n 0\n⊢ Finset.range n = ∅\n[PROOFSTEP]\nrw [pn.out, Nat.cast_zero, Finset.range_zero]\n[GOAL]\nn nn n' : ℕ\npn : NormNum.IsNat n nn\npn' : nn = Nat.succ n'\n⊢ Finset.range n = Finset.cons n' (Finset.range n') (_ : ¬n' ∈ Finset.range n')\n[PROOFSTEP]\nrw [pn.out, Nat.cast_id, pn', Finset.range_succ, Finset.insert_eq_cons]\n[GOAL]\nα : Type u_1\ninst✝ : Fintype α\nelems : Finset α\ncomplete : ∀ (x : α), x ∈ elems\n⊢ Finset.univ = elems\n[PROOFSTEP]\next x\n[GOAL]\ncase a\nα : Type u_1\ninst✝ : Fintype α\nelems : Finset α\ncomplete : ∀ (x : α), x ∈ elems\nx : α\n⊢ x ∈ Finset.univ ↔ x ∈ elems\n[PROOFSTEP]\nsimpa using complete x\n[GOAL]\nβ : Type u_1\nα : Type u_2\ninst✝ : CommSemiring β\nf : α → β\n⊢ Finset.sum ∅ f = ↑0\n[PROOFSTEP]\nsimp\n[GOAL]\nβ : Type u_1\nα : Type u_2\ninst✝ : CommSemiring β\nf : α → β\n⊢ Finset.prod ∅ f = ↑1\n[PROOFSTEP]\nsimp\n", "meta": {"mathlib_filename": "Mathlib.Tactic.NormNum.BigOperators", "llama_tokens": 1035, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8418256432832333, "lm_q2_score": 0.8056321796478255, "lm_q1q2_score": 0.6782018278817041}} {"text": "[GOAL]\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm n : ℕ\nh : ↑m = ↑n\n⊢ m = n\n[PROOFSTEP]\ninduction' m with m ih generalizing n\n[GOAL]\ncase zero\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm n✝ : ℕ\nh✝ : ↑m = ↑n✝\nn : ℕ\nh : ↑Nat.zero = ↑n\n⊢ Nat.zero = n\n[PROOFSTEP]\nrw [H n]\n[GOAL]\ncase zero\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm n✝ : ℕ\nh✝ : ↑m = ↑n✝\nn : ℕ\nh : ↑Nat.zero = ↑n\n⊢ ↑n = 0\n[PROOFSTEP]\nrw [← h, Nat.cast_zero]\n[GOAL]\ncase succ\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm✝ n✝ : ℕ\nh✝ : ↑m✝ = ↑n✝\nm : ℕ\nih : ∀ (n : ℕ), ↑m = ↑n → m = n\nn : ℕ\nh : ↑(Nat.succ m) = ↑n\n⊢ Nat.succ m = n\n[PROOFSTEP]\ncases' n with n\n[GOAL]\ncase succ.zero\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm✝ n : ℕ\nh✝ : ↑m✝ = ↑n\nm : ℕ\nih : ∀ (n : ℕ), ↑m = ↑n → m = n\nh : ↑(Nat.succ m) = ↑Nat.zero\n⊢ Nat.succ m = Nat.zero\n[PROOFSTEP]\napply H\n[GOAL]\ncase succ.zero.a\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm✝ n : ℕ\nh✝ : ↑m✝ = ↑n\nm : ℕ\nih : ∀ (n : ℕ), ↑m = ↑n → m = n\nh : ↑(Nat.succ m) = ↑Nat.zero\n⊢ ↑(Nat.succ m) = 0\n[PROOFSTEP]\nrw [h, Nat.cast_zero]\n[GOAL]\ncase succ.succ\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm✝ n✝ : ℕ\nh✝ : ↑m✝ = ↑n✝\nm : ℕ\nih : ∀ (n : ℕ), ↑m = ↑n → m = n\nn : ℕ\nh : ↑(Nat.succ m) = ↑(Nat.succ n)\n⊢ Nat.succ m = Nat.succ n\n[PROOFSTEP]\nsimp only [Nat.cast_succ, add_right_cancel_iff] at h \n[GOAL]\ncase succ.succ\nR : Type u_1\ninst✝ : AddGroupWithOne R\nH : ∀ (n : ℕ), ↑n = 0 → n = 0\nm✝ n✝ : ℕ\nh✝ : ↑m✝ = ↑n✝\nm : ℕ\nih : ∀ (n : ℕ), ↑m = ↑n → m = n\nn : ℕ\nh : ↑m = ↑n\n⊢ Nat.succ m = Nat.succ n\n[PROOFSTEP]\nrwa [ih]\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\n⊢ ↑n = 0 ↔ n = 0\n[PROOFSTEP]\nrw [← cast_zero, cast_inj]\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\n⊢ ↑n + 1 ≠ 0\n[PROOFSTEP]\nnorm_cast\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\n⊢ ¬n + 1 = 0\n[PROOFSTEP]\nexact n.succ_ne_zero\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\n⊢ ↑n = 1 ↔ n = 1\n[PROOFSTEP]\nrw [← cast_one, cast_inj]\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\nh : Nat.AtLeastTwo n\n⊢ ofNat n ≠ 1\n[PROOFSTEP]\nrw [← Nat.cast_eq_ofNat, ← @Nat.cast_one R, Ne.def, Nat.cast_inj]\n[GOAL]\nR : Type u_1\ninst✝¹ : AddMonoidWithOne R\ninst✝ : CharZero R\nn : ℕ\nh : Nat.AtLeastTwo n\n⊢ ¬n = 1\n[PROOFSTEP]\nexact ne_of_gt h.prop\n", "meta": {"mathlib_filename": "Mathlib.Algebra.CharZero.Defs", "llama_tokens": 1553, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8519528057272543, "lm_q2_score": 0.7956580952177051, "lm_q1q2_score": 0.6778631466203268}} {"text": "[GOAL]\nm n r : ℤ\n⊢ r ∈ range m n ↔ m ≤ r ∧ r < n\n[PROOFSTEP]\nsimp only [range, List.mem_map, List.mem_range, lt_toNat, lt_sub_iff_add_lt, add_comm]\n[GOAL]\nm n r : ℤ\n⊢ (∃ a, m + ↑a < n ∧ m + ↑a = r) ↔ m ≤ r ∧ r < n\n[PROOFSTEP]\nexact\n ⟨fun ⟨a, ha⟩ => ha.2 ▸ ⟨le_add_of_nonneg_right (Int.coe_nat_nonneg _), ha.1⟩, fun h =>\n ⟨toNat (r - m), by simp [toNat_of_nonneg (sub_nonneg.2 h.1), h.2]⟩⟩\n[GOAL]\nm n r : ℤ\nh : m ≤ r ∧ r < n\n⊢ m + ↑(toNat (r - m)) < n ∧ m + ↑(toNat (r - m)) = r\n[PROOFSTEP]\nsimp [toNat_of_nonneg (sub_nonneg.2 h.1), h.2]\n[GOAL]\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\n⊢ (∀ (r : ℤ), r ∈ range m n → P r) ↔ ∀ (r : ℤ), m ≤ r → r < n → P r\n[PROOFSTEP]\nsimp only [mem_range_iff, and_imp]\n[GOAL]\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\n⊢ Decidable (∀ (r : ℤ), m ≤ r → r ≤ n → P r)\n[PROOFSTEP]\napply decidable_of_iff (∀ r ∈ range m (n + 1), P r)\n[GOAL]\ncase h\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\n⊢ (∀ (r : ℤ), r ∈ range m (n + 1) → P r) ↔ ∀ (r : ℤ), m ≤ r → r ≤ n → P r\n[PROOFSTEP]\napply Iff.intro\n[GOAL]\ncase h.mp\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\n⊢ (∀ (r : ℤ), r ∈ range m (n + 1) → P r) → ∀ (r : ℤ), m ≤ r → r ≤ n → P r\n[PROOFSTEP]\nintros h _ _\n[GOAL]\ncase h.mpr\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\n⊢ (∀ (r : ℤ), m ≤ r → r ≤ n → P r) → ∀ (r : ℤ), r ∈ range m (n + 1) → P r\n[PROOFSTEP]\nintros h _ _\n[GOAL]\ncase h.mp\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\nh : ∀ (r : ℤ), r ∈ range m (n + 1) → P r\nr✝ : ℤ\na✝ : m ≤ r✝\n⊢ r✝ ≤ n → P r✝\n[PROOFSTEP]\nintro _\n[GOAL]\ncase h.mp\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\nh : ∀ (r : ℤ), r ∈ range m (n + 1) → P r\nr✝ : ℤ\na✝¹ : m ≤ r✝\na✝ : r✝ ≤ n\n⊢ P r✝\n[PROOFSTEP]\napply h\n[GOAL]\ncase h.mp.a\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\nh : ∀ (r : ℤ), r ∈ range m (n + 1) → P r\nr✝ : ℤ\na✝¹ : m ≤ r✝\na✝ : r✝ ≤ n\n⊢ r✝ ∈ range m (n + 1)\n[PROOFSTEP]\nsimp_all only [mem_range_iff, and_imp, lt_add_one_iff]\n[GOAL]\ncase h.mpr\nP : ℤ → Prop\ninst✝ : DecidablePred P\nm n : ℤ\nh : ∀ (r : ℤ), m ≤ r → r ≤ n → P r\nr✝ : ℤ\na✝ : r✝ ∈ range m (n + 1)\n⊢ P r✝\n[PROOFSTEP]\nsimp_all only [mem_range_iff, and_imp, lt_add_one_iff]\n", "meta": {"mathlib_filename": "Mathlib.Data.Int.Range", "llama_tokens": 1259, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8499711756575749, "lm_q2_score": 0.7956580976404296, "lm_q1q2_score": 0.6762864486729054}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns✝ t✝ s t x : Multiset α\n⊢ x ∈ (fun s t => Finset.map (Equiv.toEmbedding equivDFinsupp.symm) (Finset.Icc (↑toDFinsupp s) (↑toDFinsupp t))) s t ↔\n s ≤ x ∧ x ≤ t\n[PROOFSTEP]\nsimp\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.map (Equiv.toEmbedding equivDFinsupp.symm) (Finset.Icc (↑toDFinsupp (s ⊓ t)) (↑toDFinsupp (s ⊔ t))) =\n Finset.map (Equiv.toEmbedding equivDFinsupp.symm) (uIcc (↑toDFinsupp s) (↑toDFinsupp t))\n[PROOFSTEP]\nsimp [uIcc]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (Finset.Icc s t) = ∏ i in toFinset s ∪ toFinset t, (count i t + 1 - count i s)\n[PROOFSTEP]\nsimp_rw [Icc_eq, Finset.card_map, DFinsupp.card_Icc, Nat.card_Icc, Multiset.toDFinsupp_apply, toDFinsupp_support]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (Finset.Ico s t) = ∏ i in toFinset s ∪ toFinset t, (count i t + 1 - count i s) - 1\n[PROOFSTEP]\nrw [card_Ico_eq_card_Icc_sub_one, card_Icc]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (Finset.Ioc s t) = ∏ i in toFinset s ∪ toFinset t, (count i t + 1 - count i s) - 1\n[PROOFSTEP]\nrw [card_Ioc_eq_card_Icc_sub_one, card_Icc]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (Finset.Ioo s t) = ∏ i in toFinset s ∪ toFinset t, (count i t + 1 - count i s) - 2\n[PROOFSTEP]\nrw [card_Ioo_eq_card_Icc_sub_two, card_Icc]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (uIcc s t) = ∏ i in toFinset s ∪ toFinset t, (Int.natAbs (↑(count i t) - ↑(count i s)) + 1)\n[PROOFSTEP]\nsimp_rw [uIcc_eq, Finset.card_map, DFinsupp.card_uIcc, Nat.card_uIcc, Multiset.toDFinsupp_apply, toDFinsupp_support]\n[GOAL]\nα : Type u_1\ninst✝ : DecidableEq α\ns t : Multiset α\n⊢ Finset.card (Finset.Iic s) = ∏ i in toFinset s, (count i s + 1)\n[PROOFSTEP]\nsimp_rw [Iic_eq_Icc, card_Icc, bot_eq_zero, toFinset_zero, empty_union, count_zero, tsub_zero]\n", "meta": {"mathlib_filename": "Mathlib.Data.Multiset.Interval", "llama_tokens": 993, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8577680904463333, "lm_q2_score": 0.78793120560257, "lm_q1q2_score": 0.6758622456327937}} {"text": "[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝³ : SMul R M\ninst✝² : SMul M N\ninst✝¹ : SMul R N\ninst✝ : IsScalarTower R M N\nx : R\ny : M\nz : ULift N\n⊢ { down := (x • y) • z.down } = { down := x • y • z.down }\n[PROOFSTEP]\nrw [smul_assoc]\n[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝¹ : Zero M\ninst✝ : SMulZeroClass R M\nc : R\n⊢ c • 0 = 0\n[PROOFSTEP]\n{ext; simp [smul_zero]\n}\n[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝¹ : Zero M\ninst✝ : SMulZeroClass R M\nc : R\n⊢ c • 0 = 0\n[PROOFSTEP]\next\n[GOAL]\ncase h\nR : Type u\nM : Type v\nN : Type w\ninst✝¹ : Zero M\ninst✝ : SMulZeroClass R M\nc : R\n⊢ (c • 0).down = 0.down\n[PROOFSTEP]\nsimp [smul_zero]\n[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝¹ : AddZeroClass M\ninst✝ : DistribSMul R M\nc : R\nf g : ULift M\n⊢ c • (f + g) = c • f + c • g\n[PROOFSTEP]\next\n[GOAL]\ncase h\nR : Type u\nM : Type v\nN : Type w\ninst✝¹ : AddZeroClass M\ninst✝ : DistribSMul R M\nc : R\nf g : ULift M\n⊢ (c • (f + g)).down = (c • f + c • g).down\n[PROOFSTEP]\nsimp [smul_add]\n[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝² : Monoid R\ninst✝¹ : Monoid M\ninst✝ : MulDistribMulAction R M\nsrc✝ : MulAction R (ULift M) := mulAction'\nx✝² : R\nx✝¹ x✝ : ULift M\n⊢ x✝² • (x✝¹ * x✝) = x✝² • x✝¹ * x✝² • x✝\n[PROOFSTEP]\next\n[GOAL]\ncase h\nR : Type u\nM : Type v\nN : Type w\ninst✝² : Monoid R\ninst✝¹ : Monoid M\ninst✝ : MulDistribMulAction R M\nsrc✝ : MulAction R (ULift M) := mulAction'\nx✝² : R\nx✝¹ x✝ : ULift M\n⊢ (x✝² • (x✝¹ * x✝)).down = (x✝² • x✝¹ * x✝² • x✝).down\n[PROOFSTEP]\nsimp [smul_mul']\n[GOAL]\nR : Type u\nM : Type v\nN : Type w\ninst✝² : Monoid R\ninst✝¹ : Monoid M\ninst✝ : MulDistribMulAction R M\nsrc✝ : MulAction R (ULift M) := mulAction'\nx✝ : R\n⊢ x✝ • 1 = 1\n[PROOFSTEP]\next\n[GOAL]\ncase h\nR : Type u\nM : Type v\nN : Type w\ninst✝² : Monoid R\ninst✝¹ : Monoid M\ninst✝ : MulDistribMulAction R M\nsrc✝ : MulAction R (ULift M) := mulAction'\nx✝ : R\n⊢ (x✝ • 1).down = 1.down\n[PROOFSTEP]\nsimp [smul_one]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Module.ULift", "llama_tokens": 1036, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8577680977182187, "lm_q2_score": 0.7879311956428947, "lm_q1q2_score": 0.6758622428194474}} {"text": "[GOAL]\nK : Type u_1\nι : Type u_2\nR : ι → Type u_3\ninst✝ : (i : ι) → SMul K (R i)\nr : K\ns : Set ι\nt : (i : ι) → Set (R i)\n⊢ r • pi s t ⊆ pi s (r • t)\n[PROOFSTEP]\nrintro x ⟨y, h, rfl⟩ i hi\n[GOAL]\ncase intro.intro\nK : Type u_1\nι : Type u_2\nR : ι → Type u_3\ninst✝ : (i : ι) → SMul K (R i)\nr : K\ns : Set ι\nt : (i : ι) → Set (R i)\ny : (i : ι) → R i\nh : y ∈ pi s t\ni : ι\nhi : i ∈ s\n⊢ (fun x => r • x) y i ∈ (r • t) i\n[PROOFSTEP]\nexact smul_mem_smul_set (h i hi)\n[GOAL]\nK : Type u_1\nι : Type u_2\nR : ι → Type u_3\ninst✝ : (i : ι) → SMul K (R i)\nr : K\nt : (i : ι) → Set (R i)\nx : (i : ι) → R i\nh : x ∈ pi univ (r • t)\n⊢ x ∈ r • pi univ t\n[PROOFSTEP]\nrefine' ⟨fun i ↦ Classical.choose (h i <| Set.mem_univ _), fun i _ ↦ _, funext fun i ↦ _⟩\n[GOAL]\ncase refine'_1\nK : Type u_1\nι : Type u_2\nR : ι → Type u_3\ninst✝ : (i : ι) → SMul K (R i)\nr : K\nt : (i : ι) → Set (R i)\nx : (i : ι) → R i\nh : x ∈ pi univ (r • t)\ni : ι\nx✝ : i ∈ univ\n⊢ (fun i => Classical.choose (_ : x i ∈ (r • t) i)) i ∈ t i\n[PROOFSTEP]\nexact (Classical.choose_spec (h i <| Set.mem_univ i)).left\n[GOAL]\ncase refine'_2\nK : Type u_1\nι : Type u_2\nR : ι → Type u_3\ninst✝ : (i : ι) → SMul K (R i)\nr : K\nt : (i : ι) → Set (R i)\nx : (i : ι) → R i\nh : x ∈ pi univ (r • t)\ni : ι\n⊢ (fun x => r • x) (fun i => Classical.choose (_ : x i ∈ (r • t) i)) i = x i\n[PROOFSTEP]\nexact (Classical.choose_spec (h i <| Set.mem_univ i)).right\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Module.PointwisePi", "llama_tokens": 773, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8438951104066295, "lm_q2_score": 0.8006920116079209, "lm_q1q2_score": 0.6757000735375727}} {"text": "[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nhave a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nhave b : HasDerivAt (fun y : ℂ => Complex.sin (y * (2 * z))) _ x :=\n HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_sin (x * (2 * z))) a\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.sin (y * (2 * z))) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nhave c := b.comp_ofReal.div_const (2 * z)\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.sin (y * (2 * z))) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => Complex.sin (↑x * (2 * z)) / (2 * z)) (Complex.cos (↑x * (2 * z)) * (2 * z) / (2 * z)) x\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nfield_simp at c \n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.sin (y * (2 * z))) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => Complex.sin (↑x * (2 * z)) / (2 * z)) (Complex.cos (↑x * (2 * z))) x\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nsimp only [fun y => mul_comm y (2 * z)] at c \n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.sin (y * (2 * z))) (Complex.cos (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => Complex.sin (2 * z * ↑x) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n⊢ HasDerivAt (fun y => Complex.sin (2 * z * ↑y) / (2 * z)) (Complex.cos (2 * z * ↑x)) x\n[PROOFSTEP]\nexact c\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nhave a : HasDerivAt (fun y : ℂ => y * (2 * z)) _ x := hasDerivAt_mul_const _\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nhave b : HasDerivAt (fun y : ℂ => Complex.cos (y * (2 * z))) _ x :=\n HasDerivAt.comp (x : ℂ) (Complex.hasDerivAt_cos (x * (2 * z))) a\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.cos (y * (2 * z))) (-Complex.sin (↑x * (2 * z)) * (2 * z)) ↑x\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nhave c := (b.comp_ofReal.div_const (2 * z)).neg\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.cos (y * (2 * z))) (-Complex.sin (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => -(Complex.cos (↑x * (2 * z)) / (2 * z))) (-(-Complex.sin (↑x * (2 * z)) * (2 * z) / (2 * z))) x\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nfield_simp at c \n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.cos (y * (2 * z))) (-Complex.sin (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => -Complex.cos (↑x * (2 * z)) / (2 * z)) (Complex.sin (↑x * (2 * z))) x\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nsimp only [fun y => mul_comm y (2 * z)] at c \n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nx : ℝ\na : HasDerivAt (fun y => y * (2 * z)) (2 * z) ↑x\nb : HasDerivAt (fun y => Complex.cos (y * (2 * z))) (-Complex.sin (↑x * (2 * z)) * (2 * z)) ↑x\nc : HasDerivAt (fun x => -Complex.cos (2 * z * ↑x) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n⊢ HasDerivAt (fun y => -Complex.cos (2 * z * ↑y) / (2 * z)) (Complex.sin (2 * z * ↑x)) x\n[PROOFSTEP]\nexact c\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n ↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1)\n[PROOFSTEP]\nhave der1 :\n ∀ x : ℝ, x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y : ℝ => (cos y : ℂ) ^ n) (-n * sin x * (cos x : ℂ) ^ (n - 1)) x :=\n by\n intro x _\n have b : HasDerivAt (fun y : ℝ => (cos y : ℂ)) (-sin x) x := by simpa using (hasDerivAt_cos x).ofReal_comp\n convert HasDerivAt.comp x (hasDerivAt_pow _ _) b using 1\n ring\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n[PROOFSTEP]\nintro x _\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\n⊢ HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n[PROOFSTEP]\nhave b : HasDerivAt (fun y : ℝ => (cos y : ℂ)) (-sin x) x := by simpa using (hasDerivAt_cos x).ofReal_comp\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\n⊢ HasDerivAt (fun y => ↑(cos y)) (-↑(sin x)) x\n[PROOFSTEP]\nsimpa using (hasDerivAt_cos x).ofReal_comp\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nb : HasDerivAt (fun y => ↑(cos y)) (-↑(sin x)) x\n⊢ HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n[PROOFSTEP]\nconvert HasDerivAt.comp x (hasDerivAt_pow _ _) b using 1\n[GOAL]\ncase h.e'_7\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nb : HasDerivAt (fun y => ↑(cos y)) (-↑(sin x)) x\n⊢ -↑n * ↑(sin x) * ↑(cos x) ^ (n - 1) = ↑n * ↑(cos x) ^ (n - 1) * -↑(sin x)\n[PROOFSTEP]\nring\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n ↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1)\n[PROOFSTEP]\nconvert (config := { sameFun := true })\n integral_mul_deriv_eq_deriv_mul der1 (fun x _ => antideriv_cos_comp_const_mul hz x) _ _ using 2\n[GOAL]\ncase h.e'_2.h.e'_4\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ (fun x => Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) = fun x => ↑(cos x) ^ n * Complex.cos (2 * z * ↑x)\n[PROOFSTEP]\next1 x\n[GOAL]\ncase h.e'_2.h.e'_4.h\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\nx : ℝ\n⊢ Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n = ↑(cos x) ^ n * Complex.cos (2 * z * ↑x)\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ ↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1) =\n ↑(cos (π / 2)) ^ n * (Complex.sin (2 * z * ↑(π / 2)) / (2 * z)) -\n ↑(cos 0) ^ n * (Complex.sin (2 * z * ↑0) / (2 * z)) -\n ∫ (x : ℝ) in 0 ..π / 2, -↑n * ↑(sin x) * ↑(cos x) ^ (n - 1) * (Complex.sin (2 * z * ↑x) / (2 * z))\n[PROOFSTEP]\nrw [Complex.ofReal_zero, mul_zero, Complex.sin_zero, zero_div, mul_zero, sub_zero, cos_pi_div_two, Complex.ofReal_zero,\n zero_pow (by positivity : 0 < n), zero_mul, zero_sub, ← integral_neg, ← integral_const_mul]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ 0 < n\n[PROOFSTEP]\npositivity\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ ∫ (x : ℝ) in 0 ..π / 2, ↑n / (2 * z) * (Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1)) =\n ∫ (x : ℝ) in 0 ..π / 2, -(-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1) * (Complex.sin (2 * z * ↑x) / (2 * z)))\n[PROOFSTEP]\nrefine' integral_congr fun x _ => _\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ ↑n / (2 * z) * (Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1)) =\n -(-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1) * (Complex.sin (2 * z * ↑x) / (2 * z)))\n[PROOFSTEP]\nfield_simp\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ ↑n * (Complex.sin (2 * z * ↑x) * Complex.sin ↑x * Complex.cos ↑x ^ (n - 1)) =\n ↑n * Complex.sin ↑x * Complex.cos ↑x ^ (n - 1) * Complex.sin (2 * z * ↑x)\n[PROOFSTEP]\nring\n[GOAL]\ncase convert_1\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ IntervalIntegrable (fun x => -↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase convert_1.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ Continuous fun x => -↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)\n[PROOFSTEP]\nexact\n (continuous_const.mul (Complex.continuous_ofReal.comp continuous_sin)).mul\n ((Complex.continuous_ofReal.comp continuous_cos).pow (n - 1))\n[GOAL]\ncase convert_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ IntervalIntegrable (fun x => Complex.cos (2 * z * ↑x)) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase convert_2.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 : ∀ (x : ℝ), x ∈ uIcc 0 (π / 2) → HasDerivAt (fun y => ↑(cos y) ^ n) (-↑n * ↑(sin x) * ↑(cos x) ^ (n - 1)) x\n⊢ Continuous fun x => Complex.cos (2 * z * ↑x)\n[PROOFSTEP]\nexact Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1) =\n (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nhave der1 :\n ∀ x : ℝ,\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y : ℝ => sin y * (cos y : ℂ) ^ (n - 1))\n ((cos x : ℂ) ^ n - (n - 1) * (sin x : ℂ) ^ 2 * (cos x : ℂ) ^ (n - 2)) x :=\n by\n intro x _\n have c := HasDerivAt.comp (x : ℂ) (hasDerivAt_pow (n - 1) _) (Complex.hasDerivAt_cos x)\n convert ((Complex.hasDerivAt_sin x).mul c).comp_ofReal using 1\n · ext1 y; simp only [Complex.ofReal_sin, Complex.ofReal_cos, Function.comp]\n · simp only [Complex.ofReal_cos, Complex.ofReal_sin]\n rw [mul_neg, mul_neg, ← sub_eq_add_neg, Function.comp_apply]\n congr 1\n · rw [← pow_succ, Nat.sub_add_cancel (by linarith : 1 ≤ n)]\n · have : ((n - 1 : ℕ) : ℂ) = (n : ℂ) - 1 := by rw [Nat.cast_sub (one_le_two.trans hn), Nat.cast_one]\n rw [Nat.sub_sub, this]\n ring\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n[PROOFSTEP]\nintro x _\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\n⊢ HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) x\n[PROOFSTEP]\nhave c := HasDerivAt.comp (x : ℂ) (hasDerivAt_pow (n - 1) _) (Complex.hasDerivAt_cos x)\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) x\n[PROOFSTEP]\nconvert ((Complex.hasDerivAt_sin x).mul c).comp_ofReal using 1\n[GOAL]\ncase h.e'_6\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) = fun y => Complex.sin ↑y * ((fun x => x ^ (n - 1)) ∘ Complex.cos) ↑y\n[PROOFSTEP]\next1 y\n[GOAL]\ncase h.e'_6.h\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\ny : ℝ\n⊢ ↑(sin y) * ↑(cos y) ^ (n - 1) = Complex.sin ↑y * ((fun x => x ^ (n - 1)) ∘ Complex.cos) ↑y\n[PROOFSTEP]\nsimp only [Complex.ofReal_sin, Complex.ofReal_cos, Function.comp]\n[GOAL]\ncase h.e'_7\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ ↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2) =\n Complex.cos ↑x * ((fun x => x ^ (n - 1)) ∘ Complex.cos) ↑x +\n Complex.sin ↑x * (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x)\n[PROOFSTEP]\nsimp only [Complex.ofReal_cos, Complex.ofReal_sin]\n[GOAL]\ncase h.e'_7\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ Complex.cos ↑x ^ n - (↑n - ↑1) * Complex.sin ↑x ^ 2 * Complex.cos ↑x ^ (n - 2) =\n Complex.cos ↑x * ((fun x => x ^ (n - 1)) ∘ Complex.cos) ↑x +\n Complex.sin ↑x * (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x)\n[PROOFSTEP]\nrw [mul_neg, mul_neg, ← sub_eq_add_neg, Function.comp_apply]\n[GOAL]\ncase h.e'_7\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ Complex.cos ↑x ^ n - (↑n - ↑1) * Complex.sin ↑x ^ 2 * Complex.cos ↑x ^ (n - 2) =\n Complex.cos ↑x * Complex.cos ↑x ^ (n - 1) -\n Complex.sin ↑x * (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * Complex.sin ↑x)\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase h.e'_7.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ Complex.cos ↑x ^ n = Complex.cos ↑x * Complex.cos ↑x ^ (n - 1)\n[PROOFSTEP]\nrw [← pow_succ, Nat.sub_add_cancel (by linarith : 1 ≤ n)]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ 1 ≤ n\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase h.e'_7.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ (↑n - ↑1) * Complex.sin ↑x ^ 2 * Complex.cos ↑x ^ (n - 2) =\n Complex.sin ↑x * (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * Complex.sin ↑x)\n[PROOFSTEP]\nhave : ((n - 1 : ℕ) : ℂ) = (n : ℂ) - 1 := by rw [Nat.cast_sub (one_le_two.trans hn), Nat.cast_one]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\n⊢ ↑(n - 1) = ↑n - 1\n[PROOFSTEP]\nrw [Nat.cast_sub (one_le_two.trans hn), Nat.cast_one]\n[GOAL]\ncase h.e'_7.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\nthis : ↑(n - 1) = ↑n - 1\n⊢ (↑n - ↑1) * Complex.sin ↑x ^ 2 * Complex.cos ↑x ^ (n - 2) =\n Complex.sin ↑x * (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * Complex.sin ↑x)\n[PROOFSTEP]\nrw [Nat.sub_sub, this]\n[GOAL]\ncase h.e'_7.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nx : ℝ\na✝ : x ∈ uIcc 0 (π / 2)\nc : HasDerivAt ((fun x => x ^ (n - 1)) ∘ Complex.cos) (↑(n - 1) * Complex.cos ↑x ^ (n - 1 - 1) * -Complex.sin ↑x) ↑x\nthis : ↑(n - 1) = ↑n - 1\n⊢ (↑n - ↑1) * Complex.sin ↑x ^ 2 * Complex.cos ↑x ^ (n - 2) =\n Complex.sin ↑x * ((↑n - 1) * Complex.cos ↑x ^ (n - (1 + 1)) * Complex.sin ↑x)\n[PROOFSTEP]\nring\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1) =\n (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nconvert integral_mul_deriv_eq_deriv_mul der1 (fun x _ => antideriv_sin_comp_const_mul hz x) _ _ using 1\n[GOAL]\ncase h.e'_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1) =\n ∫ (x : ℝ) in 0 ..π / 2, ↑(sin x) * ↑(cos x) ^ (n - 1) * Complex.sin (2 * z * ↑x)\n[PROOFSTEP]\nrefine' integral_congr fun x _ => _\n[GOAL]\ncase h.e'_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1) = ↑(sin x) * ↑(cos x) ^ (n - 1) * Complex.sin (2 * z * ↑x)\n[PROOFSTEP]\nring_nf\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2) =\n ↑(sin (π / 2)) * ↑(cos (π / 2)) ^ (n - 1) * (-Complex.cos (2 * z * ↑(π / 2)) / (2 * z)) -\n ↑(sin 0) * ↑(cos 0) ^ (n - 1) * (-Complex.cos (2 * z * ↑0) / (2 * z)) -\n ∫ (x : ℝ) in 0 ..π / 2,\n (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) * (-Complex.cos (2 * z * ↑x) / (2 * z))\n[PROOFSTEP]\nrw [sin_zero, cos_pi_div_two, Complex.ofReal_zero, zero_pow, zero_mul, mul_zero, zero_mul, zero_mul, sub_zero, zero_sub,\n ← integral_neg, ← integral_const_mul, ← integral_const_mul, ← integral_sub]\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ ∫ (x : ℝ) in 0 ..π / 2,\n ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)) =\n ∫ (x : ℝ) in 0 ..π / 2,\n -((↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) * (-Complex.cos (2 * z * ↑x) / (2 * z)))\ncase h.e'_3.hf\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n)) volume 0 (π / 2)\ncase h.e'_3.hg\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))) volume 0 (π / 2)\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ 0 < n - 1\n[PROOFSTEP]\nrotate_left\n[GOAL]\ncase h.e'_3.hf\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n)) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase h.e'_3.hf.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ Continuous fun x => ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n)\n[PROOFSTEP]\nexact\n continuous_const.mul\n ((Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)).mul\n ((Complex.continuous_ofReal.comp continuous_cos).pow n))\n[GOAL]\ncase h.e'_3.hg\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase h.e'_3.hg.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ Continuous fun x => (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n[PROOFSTEP]\nexact\n continuous_const.mul\n ((Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)).mul\n ((Complex.continuous_ofReal.comp continuous_cos).pow (n - 2)))\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ 0 < n - 1\n[PROOFSTEP]\napply Nat.sub_pos_of_lt\n[GOAL]\ncase h.e'_3.h\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ 1 < n\n[PROOFSTEP]\nexact one_lt_two.trans_le hn\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ ∫ (x : ℝ) in 0 ..π / 2,\n ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)) =\n ∫ (x : ℝ) in 0 ..π / 2,\n -((↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) * (-Complex.cos (2 * z * ↑x) / (2 * z)))\n[PROOFSTEP]\nrefine' integral_congr fun x _ => _\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)) =\n -((↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) * (-Complex.cos (2 * z * ↑x) / (2 * z)))\n[PROOFSTEP]\ndsimp only\n -- get rid of real trig functions and divisions by 2 * z:\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ ↑n / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n (↑n - 1) / (2 * z) * (Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)) =\n -((↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) * (-Complex.cos (2 * z * ↑x) / (2 * z)))\n[PROOFSTEP]\nrw [Complex.ofReal_cos, Complex.ofReal_sin, Complex.sin_sq, ← mul_div_right_comm, ← mul_div_right_comm, ← sub_div,\n mul_div, ← neg_div]\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ (↑n * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) -\n (↑n - 1) * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2))) /\n (2 * z) =\n -((Complex.cos ↑x ^ n - (↑n - ↑1) * (1 - Complex.cos ↑x ^ 2) * Complex.cos ↑x ^ (n - 2)) *\n -Complex.cos (2 * z * ↑x)) /\n (2 * z)\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase h.e'_3.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ ↑n * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) -\n (↑n - 1) * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2)) =\n -((Complex.cos ↑x ^ n - (↑n - ↑1) * (1 - Complex.cos ↑x ^ 2) * Complex.cos ↑x ^ (n - 2)) *\n -Complex.cos (2 * z * ↑x))\n[PROOFSTEP]\nhave : Complex.cos x ^ n = Complex.cos x ^ (n - 2) * Complex.cos x ^ 2 := by\n conv_lhs => rw [← Nat.sub_add_cancel hn, pow_add]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ Complex.cos ↑x ^ n = Complex.cos ↑x ^ (n - 2) * Complex.cos ↑x ^ 2\n[PROOFSTEP]\nconv_lhs => rw [← Nat.sub_add_cancel hn, pow_add]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n| Complex.cos ↑x ^ n\n[PROOFSTEP]\nrw [← Nat.sub_add_cancel hn, pow_add]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n| Complex.cos ↑x ^ n\n[PROOFSTEP]\nrw [← Nat.sub_add_cancel hn, pow_add]\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n| Complex.cos ↑x ^ n\n[PROOFSTEP]\nrw [← Nat.sub_add_cancel hn, pow_add]\n[GOAL]\ncase h.e'_3.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\nthis : Complex.cos ↑x ^ n = Complex.cos ↑x ^ (n - 2) * Complex.cos ↑x ^ 2\n⊢ ↑n * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) -\n (↑n - 1) * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2)) =\n -((Complex.cos ↑x ^ n - (↑n - ↑1) * (1 - Complex.cos ↑x ^ 2) * Complex.cos ↑x ^ (n - 2)) *\n -Complex.cos (2 * z * ↑x))\n[PROOFSTEP]\nrw [this]\n[GOAL]\ncase h.e'_3.e_a\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\nthis : Complex.cos ↑x ^ n = Complex.cos ↑x ^ (n - 2) * Complex.cos ↑x ^ 2\n⊢ ↑n * (Complex.cos (2 * z * ↑x) * (Complex.cos ↑x ^ (n - 2) * Complex.cos ↑x ^ 2)) -\n (↑n - 1) * (Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2)) =\n -((Complex.cos ↑x ^ (n - 2) * Complex.cos ↑x ^ 2 -\n (↑n - ↑1) * (1 - Complex.cos ↑x ^ 2) * Complex.cos ↑x ^ (n - 2)) *\n -Complex.cos (2 * z * ↑x))\n[PROOFSTEP]\nring\n[GOAL]\ncase convert_1\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => ↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase convert_1.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ Continuous fun x => ↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nexact\n ((Complex.continuous_ofReal.comp continuous_cos).pow n).sub\n ((continuous_const.mul ((Complex.continuous_ofReal.comp continuous_sin).pow 2)).mul\n ((Complex.continuous_ofReal.comp continuous_cos).pow (n - 2)))\n[GOAL]\ncase convert_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ IntervalIntegrable (fun x => Complex.sin (2 * z * ↑x)) volume 0 (π / 2)\n[PROOFSTEP]\napply Continuous.intervalIntegrable\n[GOAL]\ncase convert_2.hu\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nder1 :\n ∀ (x : ℝ),\n x ∈ uIcc 0 (π / 2) →\n HasDerivAt (fun y => ↑(sin y) * ↑(cos y) ^ (n - 1)) (↑(cos x) ^ n - (↑n - ↑1) * ↑(sin x) ^ 2 * ↑(cos x) ^ (n - 2))\n x\n⊢ Continuous fun x => Complex.sin (2 * z * ↑x)\n[PROOFSTEP]\nexact Complex.continuous_sin.comp (continuous_const.mul Complex.continuous_ofReal)\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ (1 - 4 * z ^ 2 / ↑n ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n (↑n - 1) / ↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nhave nne : (n : ℂ) ≠ 0 := by contrapose! hn; rw [Nat.cast_eq_zero] at hn ; rw [hn]; exact zero_lt_two\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\n⊢ ↑n ≠ 0\n[PROOFSTEP]\ncontrapose! hn\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nhn : ↑n = 0\n⊢ n < 2\n[PROOFSTEP]\nrw [Nat.cast_eq_zero] at hn \n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nhn : n = 0\n⊢ n < 2\n[PROOFSTEP]\nrw [hn]\n[GOAL]\nz : ℂ\nn : ℕ\nhz : z ≠ 0\nhn : n = 0\n⊢ 0 < 2\n[PROOFSTEP]\nexact zero_lt_two\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\n⊢ (1 - 4 * z ^ 2 / ↑n ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n (↑n - 1) / ↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nhave := integral_cos_mul_cos_pow_aux hn hz\n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n ↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(sin x) * ↑(cos x) ^ (n - 1)\n⊢ (1 - 4 * z ^ 2 / ↑n ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n (↑n - 1) / ↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nrw [integral_sin_mul_sin_mul_cos_pow_eq hn hz, sub_eq_neg_add, mul_add, ← sub_eq_iff_eq_add] at this \n[GOAL]\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) =\n ↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n⊢ (1 - 4 * z ^ 2 / ↑n ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n (↑n - 1) / ↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2)\n[PROOFSTEP]\nconvert congr_arg (fun u : ℂ => -u * (2 * z) ^ 2 / n ^ 2) this using 1\n[GOAL]\ncase h.e'_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) =\n ↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n⊢ (1 - 4 * z ^ 2 / ↑n ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n =\n -((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n)) *\n (2 * z) ^ 2 /\n ↑(n ^ 2)\n[PROOFSTEP]\nfield_simp\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) =\n ↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n⊢ (↑n - 1) / ↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2) =\n -(↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))) *\n (2 * z) ^ 2 /\n ↑(n ^ 2)\n[PROOFSTEP]\nfield_simp\n[GOAL]\ncase h.e'_2\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) =\n ↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n⊢ ((↑n ^ 2 - 4 * z ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) *\n (2 * z * (2 * z) * ↑n ^ 2) =\n (↑n * (↑n * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) -\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ n) * (2 * z * (2 * z))) *\n (2 * z) ^ 2 *\n ↑n ^ 2\n[PROOFSTEP]\nring\n[GOAL]\ncase h.e'_3\nz : ℂ\nn : ℕ\nhn : 2 ≤ n\nhz : z ≠ 0\nnne : ↑n ≠ 0\nthis :\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) -\n ↑n / (2 * z) * (↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) =\n ↑n / (2 * z) * -((↑n - 1) / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (n - 2))\n⊢ ((↑n - 1) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2)) *\n (2 * z * (2 * z) * ↑n ^ 2) =\n ↑n * ((↑n - 1) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (n - 2)) * (2 * z) ^ 2 * ↑n\n[PROOFSTEP]\nring\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ (1 - z ^ 2 / (↑n + 1) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n + 2) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\n[PROOFSTEP]\nconvert integral_cos_mul_cos_pow (by linarith : 2 ≤ 2 * n + 2) hz using 3\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ 2 ≤ 2 * n + 2\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase h.e'_2.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ z ^ 2 / (↑n + 1) ^ 2 = 4 * z ^ 2 / ↑(2 * n + 2) ^ 2\n[PROOFSTEP]\nsimp only [Nat.cast_add, Nat.cast_mul, Nat.cast_two]\n[GOAL]\ncase h.e'_2.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ z ^ 2 / (↑n + 1) ^ 2 = 4 * z ^ 2 / (2 * ↑n + 2) ^ 2\n[PROOFSTEP]\nnth_rw 2 [← mul_one (2 : ℂ)]\n[GOAL]\ncase h.e'_2.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ z ^ 2 / (↑n + 1) ^ 2 = 4 * z ^ 2 / (2 * ↑n + 2 * 1) ^ 2\n[PROOFSTEP]\nrw [← mul_add, mul_pow, ← div_div]\n[GOAL]\ncase h.e'_2.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ z ^ 2 / (↑n + 1) ^ 2 = 4 * z ^ 2 / 2 ^ 2 / (↑n + 1) ^ 2\n[PROOFSTEP]\nring\n[GOAL]\ncase h.e'_3.h.e'_5.h.e'_5\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ 2 * ↑n + 1 = ↑(2 * n + 2) - 1\n[PROOFSTEP]\npush_cast\n[GOAL]\ncase h.e'_3.h.e'_5.h.e'_5\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ 2 * ↑n + 1 = 2 * ↑n + 2 - 1\n[PROOFSTEP]\nring\n[GOAL]\ncase h.e'_3.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ 2 * ↑n + 2 = ↑(2 * n + 2)\n[PROOFSTEP]\npush_cast\n[GOAL]\ncase h.e'_3.h.e'_5.h.e'_6\nz : ℂ\nn✝ n : ℕ\nhz : z ≠ 0\n⊢ 2 * ↑n + 2 = 2 * ↑n + 2\n[PROOFSTEP]\nring\n[GOAL]\nz : ℂ\nn✝ n : ℕ\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = 1 / 2 * ∫ (x : ℝ) in 0 ..π, sin x ^ n\n[PROOFSTEP]\nrw [mul_comm (1 / 2 : ℝ), ← div_eq_iff (one_div_ne_zero (two_ne_zero' ℝ)), ← div_mul, div_one, mul_two]\n[GOAL]\nz : ℂ\nn✝ n : ℕ\n⊢ (∫ (x : ℝ) in 0 ..π / 2, cos x ^ n) + ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π, sin x ^ n\n[PROOFSTEP]\nhave L : IntervalIntegrable _ volume 0 (π / 2) := (continuous_sin.pow n).intervalIntegrable _ _\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\n⊢ (∫ (x : ℝ) in 0 ..π / 2, cos x ^ n) + ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π, sin x ^ n\n[PROOFSTEP]\nhave R : IntervalIntegrable _ volume (π / 2) π := (continuous_sin.pow n).intervalIntegrable _ _\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ (∫ (x : ℝ) in 0 ..π / 2, cos x ^ n) + ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π, sin x ^ n\n[PROOFSTEP]\nrw [← integral_add_adjacent_intervals L R]\n -- Porting note: was `congr 1` but it timeouts\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ (∫ (x : ℝ) in 0 ..π / 2, cos x ^ n) + ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n =\n (∫ (x : ℝ) in 0 ..π / 2, sin x ^ n) + ∫ (x : ℝ) in π / 2 ..π, sin x ^ n\n[PROOFSTEP]\nrefine congr_arg₂ _ ?_ ?_\n[GOAL]\ncase refine_1\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π / 2, sin x ^ n\n[PROOFSTEP]\nnth_rw 1 [(by ring : 0 = π / 2 - π / 2)]\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ 0 = π / 2 - π / 2\n[PROOFSTEP]\nring\n[GOAL]\ncase refine_1\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in π / 2 - π / 2 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π / 2, sin x ^ n\n[PROOFSTEP]\nnth_rw 3 [(by ring : π / 2 = π / 2 - 0)]\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ π / 2 = π / 2 - 0\n[PROOFSTEP]\nring\n[GOAL]\ncase refine_1\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in π / 2 - π / 2 ..π / 2 - 0, cos x ^ n = ∫ (x : ℝ) in 0 ..π / 2, sin x ^ n\n[PROOFSTEP]\nrw [← integral_comp_sub_left]\n[GOAL]\ncase refine_1\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos (π / 2 - x) ^ n = ∫ (x : ℝ) in 0 ..π / 2, sin x ^ n\n[PROOFSTEP]\nrefine' integral_congr fun x _ => _\n[GOAL]\ncase refine_1\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ cos (π / 2 - x) ^ n = sin x ^ n\n[PROOFSTEP]\nrw [cos_pi_div_two_sub]\n[GOAL]\ncase refine_2\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in π / 2 ..π, sin x ^ n\n[PROOFSTEP]\nnth_rw 3 [(by ring : π = π / 2 + π / 2)]\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ π = π / 2 + π / 2\n[PROOFSTEP]\nring\n[GOAL]\ncase refine_2\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in π / 2 ..π / 2 + π / 2, sin x ^ n\n[PROOFSTEP]\nnth_rw 2 [(by ring : π / 2 = 0 + π / 2)]\n[GOAL]\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ π / 2 = 0 + π / 2\n[PROOFSTEP]\nring\n[GOAL]\ncase refine_2\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 + π / 2 ..π / 2 + π / 2, sin x ^ n\n[PROOFSTEP]\nrw [← integral_comp_add_right]\n[GOAL]\ncase refine_2\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ n = ∫ (x : ℝ) in 0 ..π / 2, sin (x + π / 2) ^ n\n[PROOFSTEP]\nrefine' integral_congr fun x _ => _\n[GOAL]\ncase refine_2\nz : ℂ\nn✝ n : ℕ\nL : IntervalIntegrable (fun b => sin b ^ n) volume 0 (π / 2)\nR : IntervalIntegrable (fun b => sin b ^ n) volume (π / 2) π\nx : ℝ\nx✝ : x ∈ uIcc 0 (π / 2)\n⊢ cos x ^ n = sin (x + π / 2) ^ n\n[PROOFSTEP]\nrw [sin_add_pi_div_two]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nn : ℕ\n⊢ Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n[PROOFSTEP]\nrcases eq_or_ne z 0 with (rfl | hz)\n[GOAL]\ncase inl\nz : ℂ\nn✝ n : ℕ\n⊢ Complex.sin (↑π * 0) =\n ((↑π * 0 * ∏ j in Finset.range n, (1 - 0 ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * 0 * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nn : ℕ\nhz : z ≠ 0\n⊢ Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n[PROOFSTEP]\ninduction' n with n hn\n[GOAL]\ncase inr.zero\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range Nat.zero, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.zero)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.zero))\n[PROOFSTEP]\nsimp_rw [Nat.zero_eq, mul_zero, pow_zero, mul_one, Finset.prod_range_zero, mul_one, integral_one, sub_zero]\n[GOAL]\ncase inr.zero\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ Complex.sin (↑π * z) = (↑π * z * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x)) / ↑(π / 2)\n[PROOFSTEP]\nrw [integral_cos_mul_complex (mul_ne_zero two_ne_zero hz), Complex.ofReal_zero, mul_zero, Complex.sin_zero, zero_div,\n sub_zero, (by push_cast ; field_simp; ring : 2 * z * ↑(π / 2) = π * z)]\n[GOAL]\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ 2 * z * ↑(π / 2) = ↑π * z\n[PROOFSTEP]\npush_cast\n[GOAL]\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ 2 * z * (↑π / 2) = ↑π * z\n[PROOFSTEP]\nfield_simp\n[GOAL]\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ 2 * z * ↑π = ↑π * z * 2\n[PROOFSTEP]\nring\n[GOAL]\ncase inr.zero\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ Complex.sin (↑π * z) = ↑π * z * (Complex.sin (↑π * z) / (2 * z)) / ↑(π / 2)\n[PROOFSTEP]\nfield_simp [Complex.ofReal_ne_zero.mpr pi_pos.ne']\n[GOAL]\ncase inr.zero\nz✝ : ℂ\nn : ℕ\nz : ℂ\nhz : z ≠ 0\n⊢ Complex.sin (↑π * z) * (2 * z * ↑π) = ↑π * z * Complex.sin (↑π * z) * 2\n[PROOFSTEP]\nring\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nhn :\n Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n⊢ Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range (Nat.succ n), (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nrw [hn, Finset.prod_range_succ]\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nhn :\n Complex.sin (↑π * z) =\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n⊢ ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)) =\n (↑π * z * ((∏ x in Finset.range n, (1 - z ^ 2 / (↑x + 1) ^ 2)) * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nset A := ∏ j in Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2)\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nhn :\n Complex.sin (↑π * z) =\n (↑π * z * A * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n⊢ (↑π * z * A * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)) =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nset B := ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n)\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n⊢ ↑π * z * A * B / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)) =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nset C := ∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n)\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nhave aux' : 2 * n.succ = 2 * n + 2 := by rw [Nat.succ_eq_add_one, mul_add, mul_one]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\n⊢ 2 * Nat.succ n = 2 * n + 2\n[PROOFSTEP]\nrw [Nat.succ_eq_add_one, mul_add, mul_one]\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nhave : (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n.succ)) = (2 * (n : ℝ) + 1) / (2 * n + 2) * C :=\n by\n rw [integral_cos_pow_eq]\n dsimp only\n rw [integral_cos_pow_eq, aux', integral_sin_pow, sin_zero, sin_pi, pow_succ, zero_mul, zero_mul, zero_mul, sub_zero,\n zero_div, zero_add, ← mul_assoc, ← mul_assoc, mul_comm (1 / 2 : ℝ) _, Nat.cast_mul, Nat.cast_eq_ofNat]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\n⊢ ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n[PROOFSTEP]\nrw [integral_cos_pow_eq]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\n⊢ 1 / 2 * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n[PROOFSTEP]\ndsimp only\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\n⊢ 1 / 2 * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\n[PROOFSTEP]\nrw [integral_cos_pow_eq, aux', integral_sin_pow, sin_zero, sin_pi, pow_succ, zero_mul, zero_mul, zero_mul, sub_zero,\n zero_div, zero_add, ← mul_assoc, ← mul_assoc, mul_comm (1 / 2 : ℝ) _, Nat.cast_mul, Nat.cast_eq_ofNat]\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n))\n[PROOFSTEP]\nrw [this]\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑((2 * ↑n + 1) / (2 * ↑n + 2) * C)\n[PROOFSTEP]\nchange\n π * z * A * B / C =\n (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) *\n ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) /\n ((2 * n + 1) / (2 * n + 2) * C : ℝ)\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑((2 * ↑n + 1) / (2 * ↑n + 2) * C)\n[PROOFSTEP]\nhave :\n (π * z * (A * ((1 : ℂ) - z ^ 2 / ((n : ℂ) + 1) ^ 2)) *\n ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) =\n π * z * A *\n (((1 : ℂ) - z ^ 2 / (n.succ : ℂ) ^ 2) *\n ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) :=\n by\n nth_rw 2 [Nat.succ_eq_add_one]\n rw [Nat.cast_add_one]\n ring\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n[PROOFSTEP]\nnth_rw 2 [Nat.succ_eq_add_one]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(n + 1) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n[PROOFSTEP]\nrw [Nat.cast_add_one]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\n⊢ ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / (↑n + 1) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n[PROOFSTEP]\nring\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n⊢ ↑π * z * A * B / ↑C =\n (↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑((2 * ↑n + 1) / (2 * ↑n + 2) * C)\n[PROOFSTEP]\nrw [this]\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n⊢ ↑π * z * A * B / ↑C =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑((2 * ↑n + 1) / (2 * ↑n + 2) * C)\n[PROOFSTEP]\nsuffices\n (((1 : ℂ) - z ^ 2 / (n.succ : ℂ) ^ 2) * ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n.succ)) =\n (2 * n + 1) / (2 * n + 2) * B\n by\n rw [this, Complex.ofReal_mul, Complex.ofReal_div]\n have : (C : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (integral_cos_pow_pos _).ne'\n have : 2 * (n : ℂ) + 1 ≠ 0 :=\n by\n convert (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)\n simp\n have : 2 * (n : ℂ) + 2 ≠ 0 :=\n by\n convert (Nat.cast_add_one_ne_zero (2 * n + 1) : (↑(2 * n + 1) + 1 : ℂ) ≠ 0) using 1\n push_cast ; ring\n field_simp; ring\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝¹ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\n⊢ ↑π * z * A * B / ↑C =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n)) /\n ↑((2 * ↑n + 1) / (2 * ↑n + 2) * C)\n[PROOFSTEP]\nrw [this, Complex.ofReal_mul, Complex.ofReal_div]\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝¹ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\n⊢ ↑π * z * A * B / ↑C = ↑π * z * A * ((2 * ↑n + 1) / (2 * ↑n + 2) * B) / (↑(2 * ↑n + 1) / ↑(2 * ↑n + 2) * ↑C)\n[PROOFSTEP]\nhave : (C : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr (integral_cos_pow_pos _).ne'\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝² : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝¹ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis : ↑C ≠ 0\n⊢ ↑π * z * A * B / ↑C = ↑π * z * A * ((2 * ↑n + 1) / (2 * ↑n + 2) * B) / (↑(2 * ↑n + 1) / ↑(2 * ↑n + 2) * ↑C)\n[PROOFSTEP]\nhave : 2 * (n : ℂ) + 1 ≠ 0 :=\n by\n convert (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)\n simp\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝² : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝¹ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis : ↑C ≠ 0\n⊢ 2 * ↑n + 1 ≠ 0\n[PROOFSTEP]\nconvert (Nat.cast_add_one_ne_zero (2 * n) : (↑(2 * n) + 1 : ℂ) ≠ 0)\n[GOAL]\ncase h.e'_2.h.e'_5\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝² : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝¹ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis : ↑C ≠ 0\n⊢ 2 * ↑n = ↑(2 * n)\n[PROOFSTEP]\nsimp\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝³ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝² :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝¹ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝ : ↑C ≠ 0\nthis : 2 * ↑n + 1 ≠ 0\n⊢ ↑π * z * A * B / ↑C = ↑π * z * A * ((2 * ↑n + 1) / (2 * ↑n + 2) * B) / (↑(2 * ↑n + 1) / ↑(2 * ↑n + 2) * ↑C)\n[PROOFSTEP]\nhave : 2 * (n : ℂ) + 2 ≠ 0 :=\n by\n convert (Nat.cast_add_one_ne_zero (2 * n + 1) : (↑(2 * n + 1) + 1 : ℂ) ≠ 0) using 1\n push_cast ; ring\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝³ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝² :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝¹ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝ : ↑C ≠ 0\nthis : 2 * ↑n + 1 ≠ 0\n⊢ 2 * ↑n + 2 ≠ 0\n[PROOFSTEP]\nconvert (Nat.cast_add_one_ne_zero (2 * n + 1) : (↑(2 * n + 1) + 1 : ℂ) ≠ 0) using 1\n[GOAL]\ncase h.e'_2\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝³ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝² :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝¹ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝ : ↑C ≠ 0\nthis : 2 * ↑n + 1 ≠ 0\n⊢ 2 * ↑n + 2 = ↑(2 * n + 1) + 1\n[PROOFSTEP]\npush_cast\n[GOAL]\ncase h.e'_2\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝³ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝² :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝¹ :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝ : ↑C ≠ 0\nthis : 2 * ↑n + 1 ≠ 0\n⊢ 2 * ↑n + 2 = 2 * ↑n + 1 + 1\n[PROOFSTEP]\nring\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝⁴ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝³ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝² :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝¹ : ↑C ≠ 0\nthis✝ : 2 * ↑n + 1 ≠ 0\nthis : 2 * ↑n + 2 ≠ 0\n⊢ ↑π * z * A * B / ↑C = ↑π * z * A * ((2 * ↑n + 1) / (2 * ↑n + 2) * B) / (↑(2 * ↑n + 1) / ↑(2 * ↑n + 2) * ↑C)\n[PROOFSTEP]\nfield_simp\n[GOAL]\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝⁴ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis✝³ :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\nthis✝² :\n (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\nthis✝¹ : ↑C ≠ 0\nthis✝ : 2 * ↑n + 1 ≠ 0\nthis : 2 * ↑n + 2 ≠ 0\n⊢ ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (2 * n)) *\n ((2 * ↑n + 1) * ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))) =\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((2 * ↑n + 1) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * Complex.cos ↑x ^ (2 * n)) *\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))\n[PROOFSTEP]\nring\n[GOAL]\ncase inr.succ\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n⊢ (1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n (2 * ↑n + 1) / (2 * ↑n + 2) * B\n[PROOFSTEP]\nconvert integral_cos_mul_cos_pow_even n hz\n[GOAL]\ncase h.e'_2.h.e'_5.h.e'_6.h.e'_6.h.e'_5\nz✝ : ℂ\nn✝ : ℕ\nz : ℂ\nhz : z ≠ 0\nn : ℕ\nA : ℂ := ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)\nB : ℂ := ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)\nC : ℝ := ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)\nhn : Complex.sin (↑π * z) = ↑π * z * A * B / ↑C\naux' : 2 * Nat.succ n = 2 * n + 2\nthis✝ : ∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * Nat.succ n) = (2 * ↑n + 1) / (2 * ↑n + 2) * C\nthis :\n ↑π * z * (A * (1 - z ^ 2 / (↑n + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n) =\n ↑π * z * A *\n ((1 - z ^ 2 / ↑(Nat.succ n) ^ 2) * ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * Nat.succ n))\n⊢ ↑(Nat.succ n) = ↑n + 1\n[PROOFSTEP]\nrw [Nat.cast_succ]\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\n⊢ Tendsto (fun n => (∫ (x : ℝ) in 0 ..π / 2, ↑(cos x) ^ n * f x) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n)) atTop (𝓝 (f 0))\n[PROOFSTEP]\nsimp_rw [div_eq_inv_mul (α := ℂ), ← Complex.ofReal_inv, integral_of_le pi_div_two_pos.le, ←\n MeasureTheory.integral_Icc_eq_integral_Ioc, ← Complex.ofReal_pow, ← Complex.real_smul]\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\n⊢ Tendsto (fun n => (∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n)⁻¹ • ∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n • f x) atTop\n (𝓝 (f 0))\n[PROOFSTEP]\nhave c_lt : ∀ y : ℝ, y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0 := fun y hy hy' =>\n cos_lt_cos_of_nonneg_of_le_pi_div_two (le_refl 0) hy.2 (lt_of_le_of_ne hy.1 hy'.symm)\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\n⊢ Tendsto (fun n => (∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n)⁻¹ • ∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n • f x) atTop\n (𝓝 (f 0))\n[PROOFSTEP]\nhave c_nonneg : ∀ x : ℝ, x ∈ Icc 0 (π / 2) → 0 ≤ cos x := fun x hx =>\n cos_nonneg_of_mem_Icc ((Icc_subset_Icc_left (neg_nonpos_of_nonneg pi_div_two_pos.le)) hx)\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\n⊢ Tendsto (fun n => (∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n)⁻¹ • ∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n • f x) atTop\n (𝓝 (f 0))\n[PROOFSTEP]\nhave c_zero_pos : 0 < cos 0 := by rw [cos_zero]; exact zero_lt_one\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\n⊢ 0 < cos 0\n[PROOFSTEP]\nrw [cos_zero]\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\n⊢ 0 < 1\n[PROOFSTEP]\nexact zero_lt_one\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\nc_zero_pos : 0 < cos 0\n⊢ Tendsto (fun n => (∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n)⁻¹ • ∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n • f x) atTop\n (𝓝 (f 0))\n[PROOFSTEP]\nhave zero_mem : (0 : ℝ) ∈ closure (interior (Icc 0 (π / 2))) :=\n by\n rw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]\n exact pi_div_two_pos.le\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\nc_zero_pos : 0 < cos 0\n⊢ 0 ∈ closure (interior (Icc 0 (π / 2)))\n[PROOFSTEP]\nrw [interior_Icc, closure_Ioo pi_div_two_pos.ne, left_mem_Icc]\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\nc_zero_pos : 0 < cos 0\n⊢ 0 ≤ π / 2\n[PROOFSTEP]\nexact pi_div_two_pos.le\n[GOAL]\nf : ℝ → ℂ\nhf : ContinuousOn f (Icc 0 (π / 2))\nc_lt : ∀ (y : ℝ), y ∈ Icc 0 (π / 2) → y ≠ 0 → cos y < cos 0\nc_nonneg : ∀ (x : ℝ), x ∈ Icc 0 (π / 2) → 0 ≤ cos x\nc_zero_pos : 0 < cos 0\nzero_mem : 0 ∈ closure (interior (Icc 0 (π / 2)))\n⊢ Tendsto (fun n => (∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n)⁻¹ • ∫ (x : ℝ) in Icc 0 (π / 2), cos x ^ n • f x) atTop\n (𝓝 (f 0))\n[PROOFSTEP]\nexact\n tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn isCompact_Icc continuousOn_cos c_lt\n c_nonneg c_zero_pos zero_mem hf\n[GOAL]\nz : ℂ\n⊢ Tendsto (fun n => ↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) atTop (𝓝 (Complex.sin (↑π * z)))\n[PROOFSTEP]\nhave A :\n Tendsto\n (fun n : ℕ =>\n ((π * z * ∏ j in Finset.range n, ((1 : ℂ) - z ^ 2 / ((j : ℂ) + 1) ^ 2)) *\n ∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ (2 * n)) /\n (∫ x in (0 : ℝ)..π / 2, cos x ^ (2 * n) : ℝ))\n atTop (𝓝 <| _) :=\n Tendsto.congr (fun n => sin_pi_mul_eq z n) tendsto_const_nhds\n[GOAL]\nz : ℂ\nA :\n Tendsto\n (fun n =>\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)))\n atTop (𝓝 (Complex.sin (↑π * z)))\n⊢ Tendsto (fun n => ↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) atTop (𝓝 (Complex.sin (↑π * z)))\n[PROOFSTEP]\nhave : 𝓝 (Complex.sin (π * z)) = 𝓝 (Complex.sin (π * z) * 1) := by rw [mul_one]\n[GOAL]\nz : ℂ\nA :\n Tendsto\n (fun n =>\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)))\n atTop (𝓝 (Complex.sin (↑π * z)))\n⊢ 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\n[PROOFSTEP]\nrw [mul_one]\n[GOAL]\nz : ℂ\nA :\n Tendsto\n (fun n =>\n ((↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)))\n atTop (𝓝 (Complex.sin (↑π * z)))\nthis : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\n⊢ Tendsto (fun n => ↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) atTop (𝓝 (Complex.sin (↑π * z)))\n[PROOFSTEP]\nsimp_rw [this, mul_div_assoc] at A \n[GOAL]\nz : ℂ\nthis : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\n⊢ Tendsto (fun n => ↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) atTop (𝓝 (Complex.sin (↑π * z)))\n[PROOFSTEP]\nconvert (tendsto_mul_iff_of_ne_zero _ one_ne_zero).mp A\n[GOAL]\nz : ℂ\nthis : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\n⊢ Tendsto\n (fun n =>\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)))\n atTop (𝓝 1)\n[PROOFSTEP]\nsuffices :\n Tendsto\n (fun n : ℕ =>\n (∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ n) / (∫ x in (0 : ℝ)..π / 2, cos x ^ n : ℝ))\n atTop (𝓝 1)\n[GOAL]\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis :\n Tendsto\n (fun n => (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n))\n atTop (𝓝 1)\n⊢ Tendsto\n (fun n =>\n (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n)))\n atTop (𝓝 1)\ncase this\nz : ℂ\nthis : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\n⊢ Tendsto\n (fun n => (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n))\n atTop (𝓝 1)\n[PROOFSTEP]\nexact this.comp (tendsto_id.const_mul_atTop' zero_lt_two)\n[GOAL]\ncase this\nz : ℂ\nthis : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\n⊢ Tendsto\n (fun n => (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n))\n atTop (𝓝 1)\n[PROOFSTEP]\nhave : ContinuousOn (fun x : ℝ => Complex.cos (2 * z * x)) (Icc 0 (π / 2)) :=\n (Complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)).continuousOn\n[GOAL]\ncase this\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis : ContinuousOn (fun x => Complex.cos (2 * z * ↑x)) (Icc 0 (π / 2))\n⊢ Tendsto\n (fun n => (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n))\n atTop (𝓝 1)\n[PROOFSTEP]\nconvert tendsto_integral_cos_pow_mul_div this using 1\n[GOAL]\ncase h.e'_3\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis : ContinuousOn (fun x => Complex.cos (2 * z * ↑x)) (Icc 0 (π / 2))\n⊢ (fun n => (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n)) =\n fun n => (∫ (x : ℝ) in 0 ..π / 2, ↑(cos x) ^ n * Complex.cos (2 * z * ↑x)) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n)\n[PROOFSTEP]\next1 n\n[GOAL]\ncase h.e'_3.h\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis : ContinuousOn (fun x => Complex.cos (2 * z * ↑x)) (Icc 0 (π / 2))\nn : ℕ\n⊢ (∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n) =\n (∫ (x : ℝ) in 0 ..π / 2, ↑(cos x) ^ n * Complex.cos (2 * z * ↑x)) / ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ n)\n[PROOFSTEP]\ncongr 2 with x : 1\n[GOAL]\ncase h.e'_3.h.e_a.e_f.h\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis : ContinuousOn (fun x => Complex.cos (2 * z * ↑x)) (Icc 0 (π / 2))\nn : ℕ\nx : ℝ\n⊢ Complex.cos (2 * z * ↑x) * ↑(cos x) ^ n = ↑(cos x) ^ n * Complex.cos (2 * z * ↑x)\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\ncase h.e'_5\nz : ℂ\nthis✝ : 𝓝 (Complex.sin (↑π * z)) = 𝓝 (Complex.sin (↑π * z) * 1)\nA :\n Tendsto\n (fun n =>\n (↑π * z * ∏ j in Finset.range n, (1 - z ^ 2 / (↑j + 1) ^ 2)) *\n ((∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(cos x) ^ (2 * n)) /\n ↑(∫ (x : ℝ) in 0 ..π / 2, cos x ^ (2 * n))))\n atTop (𝓝 (Complex.sin (↑π * z) * 1))\nthis : ContinuousOn (fun x => Complex.cos (2 * z * ↑x)) (Icc 0 (π / 2))\n⊢ 𝓝 1 = 𝓝 (Complex.cos (2 * z * ↑0))\n[PROOFSTEP]\nrw [Complex.ofReal_zero, mul_zero, Complex.cos_zero]\n[GOAL]\nx : ℝ\n⊢ Tendsto (fun n => π * x * ∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2)) atTop (𝓝 (sin (π * x)))\n[PROOFSTEP]\nconvert (Complex.continuous_re.tendsto _).comp (Complex.tendsto_euler_sin_prod x) using 1\n[GOAL]\ncase h.e'_3\nx : ℝ\n⊢ (fun n => π * x * ∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2)) =\n Complex.re ∘ fun n => ↑π * ↑x * ∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2)\n[PROOFSTEP]\next1 n\n[GOAL]\ncase h.e'_3.h\nx : ℝ\nn : ℕ\n⊢ π * x * ∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2) =\n (Complex.re ∘ fun n => ↑π * ↑x * ∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2)) n\n[PROOFSTEP]\nrw [Function.comp_apply, ← Complex.ofReal_mul, Complex.ofReal_mul_re]\n[GOAL]\ncase h.e'_3.h\nx : ℝ\nn : ℕ\n⊢ π * x * ∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2) =\n π * x * (∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2)).re\n[PROOFSTEP]\nsuffices\n (∏ j : ℕ in Finset.range n, ((1 : ℂ) - (x : ℂ) ^ 2 / ((j : ℂ) + 1) ^ 2)) =\n (∏ j : ℕ in Finset.range n, ((1 : ℝ) - x ^ 2 / ((j : ℝ) + 1) ^ 2) : ℝ)\n by rw [this, Complex.ofReal_re]\n[GOAL]\nx : ℝ\nn : ℕ\nthis : ∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2) = ↑(∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2))\n⊢ π * x * ∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2) =\n π * x * (∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2)).re\n[PROOFSTEP]\nrw [this, Complex.ofReal_re]\n[GOAL]\ncase h.e'_3.h\nx : ℝ\nn : ℕ\n⊢ ∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2) = ↑(∏ j in Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2))\n[PROOFSTEP]\nrw [Complex.ofReal_prod]\n[GOAL]\ncase h.e'_3.h\nx : ℝ\nn : ℕ\n⊢ ∏ j in Finset.range n, (1 - ↑x ^ 2 / (↑j + 1) ^ 2) = ∏ i in Finset.range n, ↑(1 - x ^ 2 / (↑i + 1) ^ 2)\n[PROOFSTEP]\nrefine' Finset.prod_congr (by rfl) fun n _ => _\n[GOAL]\nx : ℝ\nn : ℕ\n⊢ Finset.range n = Finset.range n\n[PROOFSTEP]\nrfl\n[GOAL]\ncase h.e'_3.h\nx : ℝ\nn✝ n : ℕ\nx✝ : n ∈ Finset.range n✝\n⊢ 1 - ↑x ^ 2 / (↑n + 1) ^ 2 = ↑(1 - x ^ 2 / (↑n + 1) ^ 2)\n[PROOFSTEP]\nnorm_cast\n[GOAL]\ncase h.e'_5\nx : ℝ\n⊢ 𝓝 (sin (π * x)) = 𝓝 (Complex.sin (↑π * ↑x)).re\n[PROOFSTEP]\nrw [← Complex.ofReal_mul, ← Complex.ofReal_sin, Complex.ofReal_re]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.SpecialFunctions.Trigonometric.EulerSineProd", "llama_tokens": 48905, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9086178944582997, "lm_q2_score": 0.74316801430083, "lm_q1q2_score": 0.6752557563827757}} {"text": "[GOAL]\na b c d : ℤ\nhb : b ≠ 0\nhbc : b ∣ c\nh : b * a = c * d\n⊢ a = c / b * d\n[PROOFSTEP]\ncases' hbc with k hk\n[GOAL]\ncase intro\na b c d : ℤ\nhb : b ≠ 0\nh : b * a = c * d\nk : ℤ\nhk : c = b * k\n⊢ a = c / b * d\n[PROOFSTEP]\nsubst hk\n[GOAL]\ncase intro\na b d : ℤ\nhb : b ≠ 0\nk : ℤ\nh : b * a = b * k * d\n⊢ a = b * k / b * d\n[PROOFSTEP]\nrw [Int.mul_ediv_cancel_left _ hb]\n[GOAL]\ncase intro\na b d : ℤ\nhb : b ≠ 0\nk : ℤ\nh : b * a = b * k * d\n⊢ a = k * d\n[PROOFSTEP]\nrw [mul_assoc] at h \n[GOAL]\ncase intro\na b d : ℤ\nhb : b ≠ 0\nk : ℤ\nh : b * a = b * (k * d)\n⊢ a = k * d\n[PROOFSTEP]\napply mul_left_cancel₀ hb h\n[GOAL]\na b : ℤ\nw : a ∣ b\nh : natAbs b < natAbs a\n⊢ b = 0\n[PROOFSTEP]\nrw [← natAbs_dvd, ← dvd_natAbs, coe_nat_dvd] at w \n[GOAL]\na b : ℤ\nw : natAbs a ∣ natAbs b\nh : natAbs b < natAbs a\n⊢ b = 0\n[PROOFSTEP]\nrw [← natAbs_eq_zero]\n[GOAL]\na b : ℤ\nw : natAbs a ∣ natAbs b\nh : natAbs b < natAbs a\n⊢ natAbs b = 0\n[PROOFSTEP]\nexact eq_zero_of_dvd_of_lt w h\n[GOAL]\nm n : ℕ\nh : Nat.succ n ≤ m\n⊢ ofNat m + -[n+1] = ofNat (m - Nat.succ n)\n[PROOFSTEP]\nrw [negSucc_eq, ofNat_eq_cast, ofNat_eq_cast, ← Nat.cast_one, ← Nat.cast_add, ← sub_eq_add_neg, ← Nat.cast_sub h]\n", "meta": {"mathlib_filename": "Mathlib.Data.Int.Div", "llama_tokens": 662, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8418256512199032, "lm_q2_score": 0.8006919925839875, "lm_q1q2_score": 0.6740430580835771}} {"text": "[GOAL]\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ k ≃o ↑(Ioo (-1) 1)\n[PROOFSTEP]\nrefine' StrictMono.orderIsoOfRightInverse _ _ (fun x ↦ x / (1 - |↑x|)) _\n[GOAL]\ncase refine'_1\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ k → ↑(Ioo (-1) 1)\n[PROOFSTEP]\nrefine' codRestrict (fun x ↦ x / (1 + |x|)) _ fun x ↦ abs_lt.1 _\n[GOAL]\ncase refine'_1\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : k\n⊢ |(fun x => x / (1 + |x|)) x| < 1\n[PROOFSTEP]\nhave H : 0 < 1 + |x| := (abs_nonneg x).trans_lt (lt_one_add _)\n[GOAL]\ncase refine'_1\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : k\nH : 0 < 1 + |x|\n⊢ |(fun x => x / (1 + |x|)) x| < 1\n[PROOFSTEP]\ncalc\n |x / (1 + |x|)| = |x| / (1 + |x|) := by rw [abs_div, abs_of_pos H]\n _ < 1 := (div_lt_one H).2 (lt_one_add _)\n[GOAL]\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : k\nH : 0 < 1 + |x|\n⊢ |x / (1 + |x|)| = |x| / (1 + |x|)\n[PROOFSTEP]\nrw [abs_div, abs_of_pos H]\n[GOAL]\ncase refine'_2\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ StrictMono\n (codRestrict (fun x => x / (1 + |x|)) (Ioo (-1) 1)\n (_ : ∀ (x : k), -1 < (fun x => x / (1 + |x|)) x ∧ (fun x => x / (1 + |x|)) x < 1))\n[PROOFSTEP]\nrefine' (strictMono_of_odd_strictMonoOn_nonneg _ _).codRestrict _\n[GOAL]\ncase refine'_2.refine'_1\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ ∀ (x : k), -x / (1 + |(-x)|) = -(x / (1 + |x|))\n[PROOFSTEP]\nintro x\n[GOAL]\ncase refine'_2.refine'_1\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : k\n⊢ -x / (1 + |(-x)|) = -(x / (1 + |x|))\n[PROOFSTEP]\nsimp only [abs_neg, neg_div]\n[GOAL]\ncase refine'_2.refine'_2\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ StrictMonoOn (fun x => x / (1 + |x|)) (Ici 0)\n[PROOFSTEP]\nrintro x (hx : 0 ≤ x) y (hy : 0 ≤ y) hxy\n[GOAL]\ncase refine'_2.refine'_2\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : k\nhx : 0 ≤ x\ny : k\nhy : 0 ≤ y\nhxy : x < y\n⊢ (fun x => x / (1 + |x|)) x < (fun x => x / (1 + |x|)) y\n[PROOFSTEP]\nsimp [abs_of_nonneg, mul_add, mul_comm x y, div_lt_div_iff, hx.trans_lt (lt_one_add _), hy.trans_lt (lt_one_add _), *]\n[GOAL]\ncase refine'_3\nk : Type u_1\ninst✝ : LinearOrderedField k\n⊢ Function.RightInverse (fun x => ↑x / (1 - |↑x|))\n (codRestrict (fun x => x / (1 + |x|)) (Ioo (-1) 1)\n (_ : ∀ (x : k), -1 < (fun x => x / (1 + |x|)) x ∧ (fun x => x / (1 + |x|)) x < 1))\n[PROOFSTEP]\nrefine' fun x ↦ Subtype.ext _\n[GOAL]\ncase refine'_3\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : ↑(Ioo (-1) 1)\n⊢ ↑(codRestrict (fun x => x / (1 + |x|)) (Ioo (-1) 1)\n (_ : ∀ (x : k), -1 < (fun x => x / (1 + |x|)) x ∧ (fun x => x / (1 + |x|)) x < 1)\n ((fun x => ↑x / (1 - |↑x|)) x)) =\n ↑x\n[PROOFSTEP]\nhave : 0 < 1 - |(x : k)| := sub_pos.2 (abs_lt.2 x.2)\n[GOAL]\ncase refine'_3\nk : Type u_1\ninst✝ : LinearOrderedField k\nx : ↑(Ioo (-1) 1)\nthis : 0 < 1 - |↑x|\n⊢ ↑(codRestrict (fun x => x / (1 + |x|)) (Ioo (-1) 1)\n (_ : ∀ (x : k), -1 < (fun x => x / (1 + |x|)) x ∧ (fun x => x / (1 + |x|)) x < 1)\n ((fun x => ↑x / (1 - |↑x|)) x)) =\n ↑x\n[PROOFSTEP]\nfield_simp [abs_div, this.ne', abs_of_pos this]\n", "meta": {"mathlib_filename": "Mathlib.Data.Set.Intervals.IsoIoo", "llama_tokens": 1564, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8670357460591569, "lm_q2_score": 0.7772998663336157, "lm_q1q2_score": 0.6739467695182494}} {"text": "[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ dist (secondInter s p v) s.center = dist p s.center\n[PROOFSTEP]\nrw [Sphere.secondInter]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center\n[PROOFSTEP]\nby_cases hv : v = 0\n[GOAL]\ncase pos\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : v = 0\n⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center\n[PROOFSTEP]\nsimp [hv]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\n⊢ dist ((-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p) s.center = dist p s.center\n[PROOFSTEP]\nrw [dist_smul_vadd_eq_dist _ _ hv]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\n⊢ -2 * inner v (p -ᵥ s.center) / inner v v = 0 ∨\n -2 * inner v (p -ᵥ s.center) / inner v v = -2 * inner v (p -ᵥ s.center) / inner v v\n[PROOFSTEP]\nexact Or.inr rfl\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ secondInter s p v ∈ s ↔ p ∈ s\n[PROOFSTEP]\nsimp_rw [mem_sphere, Sphere.secondInter_dist]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\n⊢ secondInter s p 0 = p\n[PROOFSTEP]\nsimp [Sphere.secondInter]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ secondInter s p v = p ↔ inner v (p -ᵥ s.center) = 0\n[PROOFSTEP]\nrefine' ⟨fun hp => _, fun hp => _⟩\n[GOAL]\ncase refine'_1\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhp : secondInter s p v = p\n⊢ inner v (p -ᵥ s.center) = 0\n[PROOFSTEP]\nby_cases hv : v = 0\n[GOAL]\ncase pos\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhp : secondInter s p v = p\nhv : v = 0\n⊢ inner v (p -ᵥ s.center) = 0\n[PROOFSTEP]\nsimp [hv]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhp : secondInter s p v = p\nhv : ¬v = 0\n⊢ inner v (p -ᵥ s.center) = 0\n[PROOFSTEP]\nrwa [Sphere.secondInter, eq_comm, eq_vadd_iff_vsub_eq, vsub_self, eq_comm, smul_eq_zero, or_iff_left hv,\n div_eq_zero_iff, inner_self_eq_zero, or_iff_left hv, mul_eq_zero, or_iff_right (by norm_num : (-2 : ℝ) ≠ 0)] at hp \n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhp : -2 = 0 ∨ inner v (p -ᵥ s.center) = 0\nhv : ¬v = 0\n⊢ -2 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhp : inner v (p -ᵥ s.center) = 0\n⊢ secondInter s p v = p\n[PROOFSTEP]\nrw [Sphere.secondInter, hp, mul_zero, zero_div, zero_smul, zero_vadd]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})\n⊢ p' = p ∨ p' = secondInter s p v ↔ p' ∈ s\n[PROOFSTEP]\nrefine' ⟨fun h => _, fun h => _⟩\n[GOAL]\ncase refine'_1\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})\nh : p' = p ∨ p' = secondInter s p v\n⊢ p' ∈ s\n[PROOFSTEP]\nrcases h with (h | h)\n[GOAL]\ncase refine'_1.inl\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})\nh : p' = p\n⊢ p' ∈ s\n[PROOFSTEP]\nrwa [h]\n[GOAL]\ncase refine'_1.inr\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})\nh : p' = secondInter s p v\n⊢ p' ∈ s\n[PROOFSTEP]\nrwa [h, Sphere.secondInter_mem]\n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : p' ∈ AffineSubspace.mk' p (Submodule.span ℝ {v})\nh : p' ∈ s\n⊢ p' = p ∨ p' = secondInter s p v\n[PROOFSTEP]\nrw [AffineSubspace.mem_mk'_iff_vsub_mem, Submodule.mem_span_singleton] at hp' \n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nhp' : ∃ a, a • v = p' -ᵥ p\nh : p' ∈ s\n⊢ p' = p ∨ p' = secondInter s p v\n[PROOFSTEP]\nrcases hp' with ⟨r, hr⟩\n[GOAL]\ncase refine'_2.intro\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nh : p' ∈ s\nr : ℝ\nhr : r • v = p' -ᵥ p\n⊢ p' = p ∨ p' = secondInter s p v\n[PROOFSTEP]\nrw [eq_comm, ← eq_vadd_iff_vsub_eq] at hr \n[GOAL]\ncase refine'_2.intro\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\np' : P\nh : p' ∈ s\nr : ℝ\nhr : p' = r • v +ᵥ p\n⊢ p' = p ∨ p' = secondInter s p v\n[PROOFSTEP]\nsubst hr\n[GOAL]\ncase refine'_2.intro\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\nr : ℝ\nh : r • v +ᵥ p ∈ s\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v\n[PROOFSTEP]\nby_cases hv : v = 0\n[GOAL]\ncase pos\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\nr : ℝ\nh : r • v +ᵥ p ∈ s\nhv : v = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v\n[PROOFSTEP]\nsimp [hv]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\nr : ℝ\nh : r • v +ᵥ p ∈ s\nhv : ¬v = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = secondInter s p v\n[PROOFSTEP]\nrw [Sphere.secondInter]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : p ∈ s\nv : V\nr : ℝ\nh : r • v +ᵥ p ∈ s\nhv : ¬v = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nrw [mem_sphere] at h hp \n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : dist p s.center = s.radius\nv : V\nr : ℝ\nh : dist (r • v +ᵥ p) s.center = s.radius\nhv : ¬v = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nrw [← hp, dist_smul_vadd_eq_dist _ _ hv] at h \n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : dist p s.center = s.radius\nv : V\nr : ℝ\nh : r = 0 ∨ r = -2 * inner v (p -ᵥ s.center) / inner v v\nhv : ¬v = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nrcases h with (h | h)\n[GOAL]\ncase neg.inl\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : dist p s.center = s.radius\nv : V\nr : ℝ\nhv : ¬v = 0\nh : r = 0\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nsimp [h]\n[GOAL]\ncase neg.inr\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nhp : dist p s.center = s.radius\nv : V\nr : ℝ\nhv : ¬v = 0\nh : r = -2 * inner v (p -ᵥ s.center) / inner v v\n⊢ r • v +ᵥ p = p ∨ r • v +ᵥ p = (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nsimp [h]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nr : ℝ\nhr : r ≠ 0\n⊢ secondInter s p (r • v) = secondInter s p v\n[PROOFSTEP]\nsimp_rw [Sphere.secondInter, real_inner_smul_left, inner_smul_right, smul_smul, div_mul_eq_div_div]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nr : ℝ\nhr : r ≠ 0\n⊢ (-2 * (r * inner v (p -ᵥ s.center)) / r / r / inner v v * r) • v +ᵥ p =\n (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ p\n[PROOFSTEP]\nrw [mul_comm, ← mul_div_assoc, ← mul_div_assoc, mul_div_cancel_left _ hr, mul_comm, mul_assoc, mul_div_cancel_left _ hr,\n mul_comm]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ secondInter s p (-v) = secondInter s p v\n[PROOFSTEP]\nrw [← neg_one_smul ℝ v, s.secondInter_smul p v (by norm_num : (-1 : ℝ) ≠ 0)]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ -1 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\n⊢ secondInter s (secondInter s p v) v = p\n[PROOFSTEP]\nby_cases hv : v = 0\n[GOAL]\ncase pos\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : v = 0\n⊢ secondInter s (secondInter s p v) v = p\n[PROOFSTEP]\nsimp [hv]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\n⊢ secondInter s (secondInter s p v) v = p\n[PROOFSTEP]\nhave hv' : ⟪v, v⟫ ≠ 0 := inner_self_ne_zero.2 hv\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\nhv' : inner v v ≠ 0\n⊢ secondInter s (secondInter s p v) v = p\n[PROOFSTEP]\nsimp only [Sphere.secondInter, vadd_vsub_assoc, vadd_vadd, inner_add_right, inner_smul_right, div_mul_cancel _ hv']\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\nhv' : inner v v ≠ 0\n⊢ (-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) / inner v v) • v +\n (-2 * inner v (p -ᵥ s.center) / inner v v) • v +ᵥ\n p =\n p\n[PROOFSTEP]\nrw [← @vsub_eq_zero_iff_eq V, vadd_vsub, ← add_smul, ← add_div]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\nhv' : inner v v ≠ 0\n⊢ ((-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center)) / inner v v) • v = 0\n[PROOFSTEP]\nconvert zero_smul ℝ (M := V) _\n[GOAL]\ncase h.e'_2.h.e'_5\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\nhv' : inner v v ≠ 0\n⊢ (-2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center)) / inner v v = 0\n[PROOFSTEP]\nconvert zero_div (G₀ := ℝ) _\n[GOAL]\ncase h.e'_2.h.e'_5\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np : P\nv : V\nhv : ¬v = 0\nhv' : inner v v ≠ 0\n⊢ -2 * (-2 * inner v (p -ᵥ s.center) + inner v (p -ᵥ s.center)) + -2 * inner v (p -ᵥ s.center) = 0\n[PROOFSTEP]\nring\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\n⊢ Collinear ℝ {p, p', secondInter s p (p' -ᵥ p)}\n[PROOFSTEP]\nrw [Set.pair_comm, Set.insert_comm]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\n⊢ Collinear ℝ {secondInter s p (p' -ᵥ p), p, p'}\n[PROOFSTEP]\nexact (collinear_insert_iff_of_mem_affineSpan (s.secondInter_vsub_mem_affineSpan _ _)).2 (collinear_pair ℝ _ _)\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\n⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))\n[PROOFSTEP]\nby_cases h : p' = p\n[GOAL]\ncase pos\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\nh : p' = p\n⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))\n[PROOFSTEP]\nsimp [h]\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\nh : ¬p' = p\n⊢ Wbtw ℝ p p' (secondInter s p (p' -ᵥ p))\n[PROOFSTEP]\nrefine'\n wbtw_of_collinear_of_dist_center_le_radius (s.secondInter_collinear p p') hp hp' ((Sphere.secondInter_mem _).2 hp) _\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\nh : ¬p' = p\n⊢ p ≠ secondInter s p (p' -ᵥ p)\n[PROOFSTEP]\nintro he\n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\nh : ¬p' = p\nhe : p = secondInter s p (p' -ᵥ p)\n⊢ False\n[PROOFSTEP]\nrw [eq_comm, Sphere.secondInter_eq_self_iff, ← neg_neg (p' -ᵥ p), inner_neg_left, neg_vsub_eq_vsub_rev, neg_eq_zero,\n eq_comm] at he \n[GOAL]\ncase neg\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center ≤ s.radius\nh : ¬p' = p\nhe : 0 = inner (p -ᵥ p') (p -ᵥ s.center)\n⊢ False\n[PROOFSTEP]\nexact ((inner_pos_or_eq_of_dist_le_radius hp hp').resolve_right (Ne.symm h)).ne he\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center < s.radius\n⊢ Sbtw ℝ p p' (secondInter s p (p' -ᵥ p))\n[PROOFSTEP]\nrefine' ⟨Sphere.wbtw_secondInter hp hp'.le, _, _⟩\n[GOAL]\ncase refine'_1\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center < s.radius\n⊢ p' ≠ p\n[PROOFSTEP]\nrintro rfl\n[GOAL]\ncase refine'_1\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np' : P\nhp' : dist p' s.center < s.radius\nhp : p' ∈ s\n⊢ False\n[PROOFSTEP]\nrw [mem_sphere] at hp \n[GOAL]\ncase refine'_1\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np' : P\nhp' : dist p' s.center < s.radius\nhp : dist p' s.center = s.radius\n⊢ False\n[PROOFSTEP]\nsimp [hp] at hp' \n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center < s.radius\n⊢ p' ≠ secondInter s p (p' -ᵥ p)\n[PROOFSTEP]\nrintro h\n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : dist p' s.center < s.radius\nh : p' = secondInter s p (p' -ᵥ p)\n⊢ False\n[PROOFSTEP]\nrw [h, mem_sphere.1 ((Sphere.secondInter_mem _).2 hp)] at hp' \n[GOAL]\ncase refine'_2\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\ns : Sphere P\np p' : P\nhp : p ∈ s\nhp' : s.radius < s.radius\nh : p' = secondInter s p (p' -ᵥ p)\n⊢ False\n[PROOFSTEP]\nexact lt_irrefl _ hp'\n", "meta": {"mathlib_filename": "Mathlib.Geometry.Euclidean.Sphere.SecondInter", "llama_tokens": 9116, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8887587817066392, "lm_q2_score": 0.7577943767446202, "lm_q1q2_score": 0.6734964070596907}} {"text": "[GOAL]\na : ℤ\nh₁ : a ≠ 0\nh₂ : -a = 0\n⊢ False\n[PROOFSTEP]\nhave : -a = -0 := by rwa [Int.neg_zero]\n[GOAL]\na : ℤ\nh₁ : a ≠ 0\nh₂ : -a = 0\n⊢ -a = -0\n[PROOFSTEP]\nrwa [Int.neg_zero]\n[GOAL]\na : ℤ\nh₁ : a ≠ 0\nh₂ : -a = 0\nthis : -a = -0\n⊢ False\n[PROOFSTEP]\nhave : a = 0 := Int.neg_eq_neg this\n[GOAL]\na : ℤ\nh₁ : a ≠ 0\nh₂ : -a = 0\nthis✝ : -a = -0\nthis : a = 0\n⊢ False\n[PROOFSTEP]\ncontradiction\n[GOAL]\na b : ℤ\nh₁ : 0 < a\nh₂ : 0 < b\nh : -a = b\n⊢ False\n[PROOFSTEP]\nrw [← h] at h₂ \n[GOAL]\na b : ℤ\nh₁ : 0 < a\nh₂ : 0 < -a\nh : -a = b\n⊢ False\n[PROOFSTEP]\nexact absurd (le_of_lt h₁) (not_le_of_gt (Int.neg_of_neg_pos h₂))\n[GOAL]\nn : ℕ\n⊢ 0 + ↑n = ofNat n\n[PROOFSTEP]\nrw [Int.zero_add, Int.coe_nat_eq]\n[GOAL]\na b : ℤ\nha : 0 ≤ a\nhb : 0 ≤ b\nh✝ : natAbs a ≠ natAbs b\nh : a = b\n⊢ False\n[PROOFSTEP]\nhave : (natAbs a : ℤ) = natAbs b := by rwa [ofNat_natAbs_eq_of_nonneg _ ha, ofNat_natAbs_eq_of_nonneg _ hb]\n[GOAL]\na b : ℤ\nha : 0 ≤ a\nhb : 0 ≤ b\nh✝ : natAbs a ≠ natAbs b\nh : a = b\n⊢ ↑(natAbs a) = ↑(natAbs b)\n[PROOFSTEP]\nrwa [ofNat_natAbs_eq_of_nonneg _ ha, ofNat_natAbs_eq_of_nonneg _ hb]\n[GOAL]\na b : ℤ\nha : 0 ≤ a\nhb : 0 ≤ b\nh✝ : natAbs a ≠ natAbs b\nh : a = b\nthis : ↑(natAbs a) = ↑(natAbs b)\n⊢ False\n[PROOFSTEP]\ninjection this\n[GOAL]\na b : ℤ\nha : 0 ≤ a\nhb : 0 ≤ b\nh✝ : natAbs a ≠ natAbs b\nh : a = b\na_eq✝ : natAbs a = natAbs b\n⊢ False\n[PROOFSTEP]\ncontradiction\n[GOAL]\na b : ℤ\nn m : ℕ\nha : 0 ≤ a\nhb : 0 ≤ b\ne1 : natAbs a = n\ne2 : natAbs b = m\nh : n ≠ m\n⊢ natAbs a ≠ natAbs b\n[PROOFSTEP]\nrwa [e1, e2]\n[GOAL]\nn m : ℕ\nx✝¹ : 0 ≤ ofNat n\nx✝ : 0 ≤ ofNat m\n⊢ natAbs (ofNat n + ofNat m) = natAbs (ofNat n) + natAbs (ofNat m)\n[PROOFSTEP]\nsimp [natAbs_ofNat_core]\n[GOAL]\nn m : ℕ\nx✝¹ : -[n+1] < 0\nx✝ : -[m+1] < 0\n⊢ natAbs (-[n+1] + -[m+1]) = natAbs -[n+1] + natAbs -[m+1]\n[PROOFSTEP]\nsimp [natAbs_of_negSucc, Nat.succ_add, Nat.add_succ]\n[GOAL]\na : ℤ\nn : ℕ\nh : natAbs a = n\n⊢ natAbs (bit0 a) = bit0 n\n[PROOFSTEP]\nrw [← h]\n[GOAL]\na : ℤ\nn : ℕ\nh : natAbs a = n\n⊢ natAbs (bit0 a) = bit0 (natAbs a)\n[PROOFSTEP]\napply Int.natAbs_bit0\n[GOAL]\na : ℤ\nh : 0 ≤ a\n⊢ natAbs (bit0 a + 1) = bit0 (natAbs a) + natAbs 1\n[PROOFSTEP]\nrw [Int.natAbs_add_nonneg (Int.bit0_nonneg h) (le_of_lt Int.zero_lt_one), Int.natAbs_bit0]\n[GOAL]\na : ℤ\nn : ℕ\nh₁ : 0 ≤ a\nh₂ : natAbs a = n\n⊢ natAbs (bit1 a) = bit1 n\n[PROOFSTEP]\nrw [← h₂]\n[GOAL]\na : ℤ\nn : ℕ\nh₁ : 0 ≤ a\nh₂ : natAbs a = n\n⊢ natAbs (bit1 a) = bit1 (natAbs a)\n[PROOFSTEP]\napply Int.natAbs_bit1_nonneg h₁\n", "meta": {"mathlib_filename": "Mathlib.Init.Data.Int.CompLemmas", "llama_tokens": 1464, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8596637577007394, "lm_q2_score": 0.7826624840223698, "lm_q1q2_score": 0.6728265720260653}} {"text": "[GOAL]\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nae : ↑n = ↑m * a\nm0 : m = 0\n⊢ m ∣ n\n[PROOFSTEP]\nsimp [m0] at ae \n[GOAL]\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nm0 : m = 0\nae : n = 0\n⊢ m ∣ n\n[PROOFSTEP]\nsimp [ae, m0]\n[GOAL]\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nae : ↑n = ↑m * a\nm0l : m > 0\n⊢ m ∣ n\n[PROOFSTEP]\ncases' eq_ofNat_of_zero_le (@nonneg_of_mul_nonneg_right ℤ _ m a (by simp [ae.symm]) (by simpa using m0l)) with k e\n[GOAL]\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nae : ↑n = ↑m * a\nm0l : m > 0\n⊢ 0 ≤ ↑m * a\n[PROOFSTEP]\nsimp [ae.symm]\n[GOAL]\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nae : ↑n = ↑m * a\nm0l : m > 0\n⊢ 0 < ↑m\n[PROOFSTEP]\nsimpa using m0l\n[GOAL]\ncase intro\nm n : ℕ\nx✝ : ↑m ∣ ↑n\na : ℤ\nae : ↑n = ↑m * a\nm0l : m > 0\nk : ℕ\ne : a = ↑k\n⊢ m ∣ n\n[PROOFSTEP]\nsubst a\n[GOAL]\ncase intro\nm n : ℕ\nx✝ : ↑m ∣ ↑n\nm0l : m > 0\nk : ℕ\nae : ↑n = ↑m * ↑k\n⊢ m ∣ n\n[PROOFSTEP]\nexact ⟨k, Int.ofNat.inj ae⟩\n[GOAL]\nm n : ℕ\nx✝ : m ∣ n\nk : ℕ\ne : n = m * k\n⊢ ↑m * ↑k = ↑n\n[PROOFSTEP]\nrw [e, Int.ofNat_mul]\n[GOAL]\nn : ℕ\nz : ℤ\n⊢ ↑n ∣ z ↔ n ∣ natAbs z\n[PROOFSTEP]\nrcases natAbs_eq z with (eq | eq)\n[GOAL]\ncase inl\nn : ℕ\nz : ℤ\neq : z = ↑(natAbs z)\n⊢ ↑n ∣ z ↔ n ∣ natAbs z\n[PROOFSTEP]\nrw [eq]\n[GOAL]\ncase inr\nn : ℕ\nz : ℤ\neq : z = -↑(natAbs z)\n⊢ ↑n ∣ z ↔ n ∣ natAbs z\n[PROOFSTEP]\nrw [eq]\n[GOAL]\ncase inl\nn : ℕ\nz : ℤ\neq : z = ↑(natAbs z)\n⊢ ↑n ∣ ↑(natAbs z) ↔ n ∣ natAbs ↑(natAbs z)\n[PROOFSTEP]\nsimp [← coe_nat_dvd]\n[GOAL]\ncase inr\nn : ℕ\nz : ℤ\neq : z = -↑(natAbs z)\n⊢ ↑n ∣ -↑(natAbs z) ↔ n ∣ natAbs (-↑(natAbs z))\n[PROOFSTEP]\nsimp [← coe_nat_dvd]\n[GOAL]\nn : ℕ\nz : ℤ\n⊢ z ∣ ↑n ↔ natAbs z ∣ n\n[PROOFSTEP]\nrcases natAbs_eq z with (eq | eq)\n[GOAL]\ncase inl\nn : ℕ\nz : ℤ\neq : z = ↑(natAbs z)\n⊢ z ∣ ↑n ↔ natAbs z ∣ n\n[PROOFSTEP]\nrw [eq]\n[GOAL]\ncase inr\nn : ℕ\nz : ℤ\neq : z = -↑(natAbs z)\n⊢ z ∣ ↑n ↔ natAbs z ∣ n\n[PROOFSTEP]\nrw [eq]\n[GOAL]\ncase inl\nn : ℕ\nz : ℤ\neq : z = ↑(natAbs z)\n⊢ ↑(natAbs z) ∣ ↑n ↔ natAbs ↑(natAbs z) ∣ n\n[PROOFSTEP]\nsimp [← coe_nat_dvd]\n[GOAL]\ncase inr\nn : ℕ\nz : ℤ\neq : z = -↑(natAbs z)\n⊢ -↑(natAbs z) ∣ ↑n ↔ natAbs (-↑(natAbs z)) ∣ n\n[PROOFSTEP]\nsimp [← coe_nat_dvd]\n", "meta": {"mathlib_filename": "Mathlib.Data.Int.Dvd.Basic", "llama_tokens": 1324, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8418256472515684, "lm_q2_score": 0.7981867753392728, "lm_q1q2_score": 0.6719340987776256}} {"text": "[GOAL]\nX Y : FintypeCat\nf g : X ⟶ Y\nh : ∀ (x : ↑X), f x = g x\n⊢ f = g\n[PROOFSTEP]\nfunext\n[GOAL]\ncase h\nX Y : FintypeCat\nf g : X ⟶ Y\nh : ∀ (x : ↑X), f x = g x\nx✝ : ↑X\n⊢ f x✝ = g x✝\n[PROOFSTEP]\napply h\n[GOAL]\nA B : FintypeCat\n⊢ Function.LeftInverse\n (fun i =>\n { toFun := i.hom, invFun := i.inv, left_inv := (_ : ∀ (a : ↑A), i.inv (i.hom a) = a),\n right_inv := (_ : ∀ (a : ↑B), i.hom (i.inv a) = a) })\n fun e => Iso.mk ↑e ↑e.symm\n[PROOFSTEP]\naesop_cat\n[GOAL]\nA B : FintypeCat\n⊢ Function.RightInverse\n (fun i =>\n { toFun := i.hom, invFun := i.inv, left_inv := (_ : ∀ (a : ↑A), i.inv (i.hom a) = a),\n right_inv := (_ : ∀ (a : ↑B), i.hom (i.inv a) = a) })\n fun e => Iso.mk ↑e ↑e.symm\n[PROOFSTEP]\naesop_cat\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\n⊢ Function.LeftInverse (fun x => (h.inv { down := x }).down) fun x => (h.hom { down := x }).down\n[PROOFSTEP]\nintro a\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len X)\n⊢ (fun x => (h.inv { down := x }).down) ((fun x => (h.hom { down := x }).down) a) = a\n[PROOFSTEP]\nchange ULift.down _ = _\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len X)\n⊢ (h.inv { down := (fun x => (h.hom { down := x }).down) a }).down = a\n[PROOFSTEP]\nrw [ULift.up_down]\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len X)\n⊢ (h.inv (h.hom { down := a })).down = a\n[PROOFSTEP]\nchange ((h.hom ≫ h.inv) _).down = _\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len X)\n⊢ ((h.hom ≫ h.inv) { down := a }).down = a\n[PROOFSTEP]\nsimp\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len X)\n⊢ (𝟙 X { down := a }).down = a\n[PROOFSTEP]\nrfl\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\n⊢ Function.RightInverse (fun x => (h.inv { down := x }).down) fun x => (h.hom { down := x }).down\n[PROOFSTEP]\nintro a\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len Y)\n⊢ (fun x => (h.hom { down := x }).down) ((fun x => (h.inv { down := x }).down) a) = a\n[PROOFSTEP]\nchange ULift.down _ = _\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len Y)\n⊢ (h.hom { down := (fun x => (h.inv { down := x }).down) a }).down = a\n[PROOFSTEP]\nrw [ULift.up_down]\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len Y)\n⊢ (h.hom (h.inv { down := a })).down = a\n[PROOFSTEP]\nchange ((h.inv ≫ h.hom) _).down = _\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len Y)\n⊢ ((h.inv ≫ h.hom) { down := a }).down = a\n[PROOFSTEP]\nsimp\n[GOAL]\nX Y : Skeleton\nx✝ : IsIsomorphic X Y\nh : X ≅ Y\na : Fin (len Y)\n⊢ (𝟙 Y { down := a }).down = a\n[PROOFSTEP]\nrfl\n[GOAL]\nn : ℕ\n⊢ Fintype.card ↑(incl.obj (mk n)) = n\n[PROOFSTEP]\nconvert Finset.card_fin n\n[GOAL]\ncase h.e'_2\nn : ℕ\n⊢ Fintype.card ↑(incl.obj (mk n)) = Finset.card Finset.univ\n[PROOFSTEP]\napply Fintype.ofEquiv_card\n[GOAL]\n⊢ IsEquivalence Skeleton.incl\n[PROOFSTEP]\ninfer_instance\n", "meta": {"mathlib_filename": "Mathlib.CategoryTheory.FintypeCat", "llama_tokens": 1472, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8479677660619633, "lm_q2_score": 0.7905303087996143, "lm_q1q2_score": 0.6703442199570829}} {"text": "[GOAL]\nx✝¹ x✝ : ℕ\n⊢ (fun m n => m * n) (x✝¹ + 1) x✝ = x✝ + (fun m n => m * n) x✝¹ x✝\n[PROOFSTEP]\ndsimp only\n[GOAL]\nx✝¹ x✝ : ℕ\n⊢ (x✝¹ + 1) * x✝ = x✝ + x✝¹ * x✝\n[PROOFSTEP]\nrw [Nat.add_comm, Nat.right_distrib, Nat.one_mul]\n[GOAL]\nm n k : ℕ\np : ℕ → Prop\n⊢ (∃ n, p n) → p 0 ∨ ∃ n, p (n + 1)\n[PROOFSTEP]\nrintro ⟨_ | n, hn⟩\n[GOAL]\ncase intro.zero\nm n k : ℕ\np : ℕ → Prop\nhn : p zero\n⊢ p 0 ∨ ∃ n, p (n + 1)\ncase intro.succ m n✝ k : ℕ p : ℕ → Prop n : ℕ hn : p (succ n) ⊢ p 0 ∨ ∃ n, p (n + 1)\n[PROOFSTEP]\nexacts [Or.inl hn, Or.inr ⟨n, hn⟩]\n[GOAL]\nm✝ n✝ k m n : ℕ\n⊢ max (succ m) (succ n) = succ (max m n)\n[PROOFSTEP]\nby_cases h1 : m ≤ n\n[GOAL]\ncase pos\nm✝ n✝ k m n : ℕ\nh1 : m ≤ n\n⊢ max (succ m) (succ n) = succ (max m n)\ncase neg m✝ n✝ k m n : ℕ h1 : ¬m ≤ n ⊢ max (succ m) (succ n) = succ (max m n)\n[PROOFSTEP]\nrw [max_eq_right h1, max_eq_right (succ_le_succ h1)]\n[GOAL]\ncase neg\nm✝ n✝ k m n : ℕ\nh1 : ¬m ≤ n\n⊢ max (succ m) (succ n) = succ (max m n)\n[PROOFSTEP]\nrw [not_le] at h1 \n[GOAL]\ncase neg\nm✝ n✝ k m n : ℕ\nh1 : n < m\n⊢ max (succ m) (succ n) = succ (max m n)\n[PROOFSTEP]\nhave h2 := le_of_lt h1\n[GOAL]\ncase neg\nm✝ n✝ k m n : ℕ\nh1 : n < m\nh2 : n ≤ m\n⊢ max (succ m) (succ n) = succ (max m n)\n[PROOFSTEP]\nrw [max_eq_left h2, max_eq_left (succ_le_succ h2)]\n[GOAL]\nm✝ n✝ k m n : ℕ\n⊢ m < n ↔ m + 1 ≤ n\n[PROOFSTEP]\nrw [succ_le_iff]\n[GOAL]\nm n k a b : ℕ\n⊢ a < 1 + b ↔ a ≤ b\n[PROOFSTEP]\nsimp only [add_comm, lt_succ_iff]\n[GOAL]\nm n k a b : ℕ\n⊢ 1 + a ≤ b ↔ a < b\n[PROOFSTEP]\nsimp only [add_comm, add_one_le_iff]\n[GOAL]\nm✝ n✝ k✝ m n k : ℕ\nn0 : 0 < n\n⊢ m / n ≤ k ↔ m ≤ n * k + (n - 1)\n[PROOFSTEP]\nrw [← lt_succ_iff, div_lt_iff_lt_mul n0, succ_mul, mul_comm]\n[GOAL]\nm✝ n✝ k✝ m n k : ℕ\nn0 : 0 < n\n⊢ m < n * k + n ↔ m ≤ n * k + (n - 1)\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nm✝ n k✝ m k : ℕ\nn0 : 0 < zero\n⊢ m < zero * k + zero ↔ m ≤ zero * k + (zero - 1)\n[PROOFSTEP]\ncases n0\n[GOAL]\ncase succ\nm✝ n k✝ m k n✝ : ℕ\nn0 : 0 < succ n✝\n⊢ m < succ n✝ * k + succ n✝ ↔ m ≤ succ n✝ * k + (succ n✝ - 1)\n[PROOFSTEP]\nexact lt_succ_iff\n[GOAL]\nm n✝ k n : ℕ\nx✝² : n + 3 ≠ 0\nx✝¹ : n + 3 ≠ 1\nx✝ : n + 3 ≠ 2\n⊢ 2 < n + 3\n[PROOFSTEP]\nrw [Nat.lt_iff_add_one_le]\n[GOAL]\nm n✝ k n : ℕ\nx✝² : n + 3 ≠ 0\nx✝¹ : n + 3 ≠ 1\nx✝ : n + 3 ≠ 2\n⊢ 2 + 1 ≤ n + 3\n[PROOFSTEP]\nconvert Nat.le_add_left 3 n\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nn : ℕ\n⊢ (∀ (m : ℕ), m < n + 1 → P m) ↔ (∀ (m : ℕ), m < n → P m) ∧ P n\n[PROOFSTEP]\nsimp only [lt_succ_iff, Decidable.le_iff_eq_or_lt, forall_eq_or_imp, and_comm]\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nn : ℕ\n⊢ (∃ m, m < n + 1 ∧ P m) ↔ (∃ m, m < n ∧ P m) ∨ P n\n[PROOFSTEP]\nrw [← not_iff_not]\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nn : ℕ\n⊢ (¬∃ m, m < n + 1 ∧ P m) ↔ ¬((∃ m, m < n ∧ P m) ∨ P n)\n[PROOFSTEP]\npush_neg\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nn : ℕ\n⊢ (∀ (m : ℕ), m < n + 1 → ¬P m) ↔ (∀ (m : ℕ), m < n → ¬P m) ∧ ¬P n\n[PROOFSTEP]\nexact forall_lt_succ\n[GOAL]\nm n k : ℕ\nh : m < n\n⊢ n = m + (n - (m + 1)) + 1\n[PROOFSTEP]\nrw [add_right_comm, add_sub_of_le h]\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ n + succ m - 1 = n + m\n[PROOFSTEP]\nrw [add_succ, succ_sub_one]\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ succ n + m - 1 = n + m\n[PROOFSTEP]\nrw [succ_add, succ_sub_one]\n[GOAL]\nm✝ n✝ k m n : ℕ\nH : m = succ n\n⊢ pred m = n\n[PROOFSTEP]\nsimp [H]\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ pred n = succ m ↔ n = m + 2\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nm✝ n k m : ℕ\n⊢ pred zero = succ m ↔ zero = m + 2\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase succ\nm✝ n k m n✝ : ℕ\n⊢ pred (succ n✝) = succ m ↔ succ n✝ = m + 2\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase zero.mp\nm✝ n k m : ℕ\n⊢ pred zero = succ m → zero = m + 2\n[PROOFSTEP]\nrintro ⟨⟩\n[GOAL]\ncase zero.mpr\nm✝ n k m : ℕ\n⊢ zero = m + 2 → pred zero = succ m\n[PROOFSTEP]\nrintro ⟨⟩\n[GOAL]\ncase succ.mp\nm✝ n k m n✝ : ℕ\n⊢ pred (succ n✝) = succ m → succ n✝ = m + 2\n[PROOFSTEP]\nrintro ⟨⟩\n[GOAL]\ncase succ.mpr\nm✝ n k m n✝ : ℕ\n⊢ succ n✝ = m + 2 → pred (succ n✝) = succ m\n[PROOFSTEP]\nrintro ⟨⟩\n[GOAL]\ncase succ.mp.refl\nm✝ n k m : ℕ\n⊢ succ (succ m) = m + 2\n[PROOFSTEP]\nrfl\n[GOAL]\ncase succ.mpr.refl\nm✝ n k m : ℕ\n⊢ pred (succ (Nat.add m 1)) = succ m\n[PROOFSTEP]\nrfl\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ pred n - m = pred (n - m)\n[PROOFSTEP]\nrw [← Nat.sub_one, Nat.sub_sub, one_add, sub_succ]\n[GOAL]\nm n✝ k n : ℕ\n⊢ pred (1 + n) = n\n[PROOFSTEP]\nrw [add_comm, add_one, Nat.pred_succ]\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ ¬2 * n % 2 = (2 * m + 1) % 2\n[PROOFSTEP]\nrw [add_comm, add_mul_mod_self_left, mul_mod_right, mod_eq_of_lt]\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ ¬0 = 1\n[PROOFSTEP]\nsimp\n[GOAL]\nm✝ n✝ k n m : ℕ\n⊢ 1 < 2\n[PROOFSTEP]\nsimp\n[GOAL]\nm n k a b : ℕ\nha : 0 < a\nthis : a * b = a * 1 ↔ b = 1\n⊢ a * b = a ↔ b = 1\n[PROOFSTEP]\nrwa [mul_one] at this \n[GOAL]\nm n k a b : ℕ\nhb : 0 < b\n⊢ a * b = b ↔ a = 1\n[PROOFSTEP]\nrw [mul_comm, Nat.mul_right_eq_self_iff hb]\n[GOAL]\nm n✝ k : ℕ\nC : ℕ → Sort u\nn : ℕ\nh : n ≤ n\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn h (fun {k} => next) x = x\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nm n k : ℕ\nC : ℕ → Sort u\nnext : {k : ℕ} → C k → C (k + 1)\nh : zero ≤ zero\nx : C zero\n⊢ leRecOn h (fun {k} => next) x = x\n[PROOFSTEP]\nunfold leRecOn Eq.recOn\n[GOAL]\ncase succ\nm n k : ℕ\nC : ℕ → Sort u\nnext : {k : ℕ} → C k → C (k + 1)\nn✝ : ℕ\nh : succ n✝ ≤ succ n✝\nx : C (succ n✝)\n⊢ leRecOn h (fun {k} => next) x = x\n[PROOFSTEP]\nunfold leRecOn Eq.recOn\n[GOAL]\ncase zero\nm n k : ℕ\nC : ℕ → Sort u\nnext : {k : ℕ} → C k → C (k + 1)\nh : zero ≤ zero\nx : C zero\n⊢ (_ : zero = 0) ▸ x = x\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nm n k : ℕ\nC : ℕ → Sort u\nnext : {k : ℕ} → C k → C (k + 1)\nn✝ : ℕ\nh : succ n✝ ≤ succ n✝\nx : C (succ n✝)\n⊢ (Or.by_cases (_ : succ n✝ ≤ n✝ ∨ succ n✝ = succ n✝) (fun h => (fun {k} => next) (leRecOn h (fun {k} => next) x))\n fun h => h ▸ x) =\n x\n[PROOFSTEP]\nunfold Or.by_cases\n[GOAL]\ncase succ\nm n k : ℕ\nC : ℕ → Sort u\nnext : {k : ℕ} → C k → C (k + 1)\nn✝ : ℕ\nh : succ n✝ ≤ succ n✝\nx : C (succ n✝)\n⊢ (if hp : succ n✝ ≤ n✝ then (fun h => (fun {k} => next) (leRecOn h (fun {k} => next) x)) hp\n else (fun h => h ▸ x) (_ : succ n✝ = succ n✝)) =\n x\n[PROOFSTEP]\nrw [dif_neg (Nat.not_succ_le_self _)]\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n ≤ m + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn h2 next x = next (leRecOn h1 next x)\n[PROOFSTEP]\nconv =>\n lhs\n rw [leRecOn, Or.by_cases, dif_pos h1]\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n ≤ m + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n| leRecOn h2 next x = next (leRecOn h1 next x)\n[PROOFSTEP]\n lhs\n rw [leRecOn, Or.by_cases, dif_pos h1]\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n ≤ m + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n| leRecOn h2 next x = next (leRecOn h1 next x)\n[PROOFSTEP]\n lhs\n rw [leRecOn, Or.by_cases, dif_pos h1]\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n ≤ m + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n| leRecOn h2 next x = next (leRecOn h1 next x)\n[PROOFSTEP]\nlhs\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n ≤ m + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n| leRecOn h2 next x\n[PROOFSTEP]\nrw [leRecOn, Or.by_cases, dif_pos h1]\n[GOAL]\nm n✝ k : ℕ\nC : ℕ → Sort u\nn : ℕ\nh : n ≤ n + 1\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn h (fun {k} => next) x = next x\n[PROOFSTEP]\nrw [leRecOn_succ (le_refl n), leRecOn_self]\n[GOAL]\nm✝ n✝ k✝ : ℕ\nC : ℕ → Sort u\nn m k : ℕ\nhnm : n ≤ m\nhmk : m ≤ k\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn (_ : n ≤ k) next x = leRecOn hmk next (leRecOn hnm next x)\n[PROOFSTEP]\ninduction' hmk with k hmk ih\n[GOAL]\ncase refl\nm✝ n✝ k✝ : ℕ\nC : ℕ → Sort u\nn m k : ℕ\nhnm : n ≤ m\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn (_ : n ≤ m) next x = leRecOn (_ : Nat.le m m) next (leRecOn hnm next x)\n[PROOFSTEP]\nrw [leRecOn_self]\n[GOAL]\ncase step\nm✝ n✝ k✝¹ : ℕ\nC : ℕ → Sort u\nn m k✝ : ℕ\nhnm : n ≤ m\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\nk : ℕ\nhmk : Nat.le m k\nih : leRecOn (_ : n ≤ k) next x = leRecOn hmk next (leRecOn hnm next x)\n⊢ leRecOn (_ : n ≤ succ k) next x = leRecOn (_ : Nat.le m (succ k)) next (leRecOn hnm next x)\n[PROOFSTEP]\nrw [leRecOn_succ (le_trans hnm hmk), ih, leRecOn_succ]\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nh1 : n ≤ m\nh2 : n + 1 ≤ m\nnext : {k : ℕ} → C k → C (k + 1)\nx : C n\n⊢ leRecOn h2 (fun {k} => next) (next x) = leRecOn h1 (fun {k} => next) x\n[PROOFSTEP]\nrw [Subsingleton.elim h1 (le_trans (le_succ n) h2), leRecOn_trans (le_succ n) h2, leRecOn_succ']\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nhnm : n ≤ m\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\n⊢ Function.Injective (leRecOn hnm fun {k} => next)\n[PROOFSTEP]\ninduction' hnm with m hnm ih\n[GOAL]\ncase refl\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\n⊢ Function.Injective (leRecOn (_ : Nat.le n n) fun {k} => next)\n[PROOFSTEP]\nintro x y H\n[GOAL]\ncase refl\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\nx y : C n\nH : leRecOn (_ : Nat.le n n) (fun {k} => next) x = leRecOn (_ : Nat.le n n) (fun {k} => next) y\n⊢ x = y\n[PROOFSTEP]\nrwa [leRecOn_self, leRecOn_self] at H \n[GOAL]\ncase step\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Injective (leRecOn hnm fun {k} => next)\n⊢ Function.Injective (leRecOn (_ : Nat.le n (succ m)) fun {k} => next)\n[PROOFSTEP]\nintro x y H\n[GOAL]\ncase step\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Injective (leRecOn hnm fun {k} => next)\nx y : C n\nH : leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) x = leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) y\n⊢ x = y\n[PROOFSTEP]\nrw [leRecOn_succ hnm, leRecOn_succ hnm] at H \n[GOAL]\ncase step\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Injective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Injective (leRecOn hnm fun {k} => next)\nx y : C n\nH : next (leRecOn hnm (fun {k} => next) x) = next (leRecOn hnm (fun {k} => next) y)\n⊢ x = y\n[PROOFSTEP]\nexact ih (Hnext _ H)\n[GOAL]\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nhnm : n ≤ m\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\n⊢ Function.Surjective (leRecOn hnm fun {k} => next)\n[PROOFSTEP]\ninduction' hnm with m hnm ih\n[GOAL]\ncase refl\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\n⊢ Function.Surjective (leRecOn (_ : Nat.le n n) fun {k} => next)\n[PROOFSTEP]\nintro x\n[GOAL]\ncase refl\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nx : C n\n⊢ ∃ a, leRecOn (_ : Nat.le n n) (fun {k} => next) a = x\n[PROOFSTEP]\nuse x\n[GOAL]\ncase h\nm✝ n✝ k : ℕ\nC : ℕ → Sort u\nn m : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nx : C n\n⊢ leRecOn (_ : Nat.le n n) (fun {k} => next) x = x\n[PROOFSTEP]\nrw [leRecOn_self]\n[GOAL]\ncase step\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Surjective (leRecOn hnm fun {k} => next)\n⊢ Function.Surjective (leRecOn (_ : Nat.le n (succ m)) fun {k} => next)\n[PROOFSTEP]\nintro x\n[GOAL]\ncase step\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Surjective (leRecOn hnm fun {k} => next)\nx : C (succ m)\n⊢ ∃ a, leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) a = x\n[PROOFSTEP]\nrcases Hnext _ x with ⟨w, rfl⟩\n[GOAL]\ncase step.intro\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Surjective (leRecOn hnm fun {k} => next)\nw : C m\n⊢ ∃ a, leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) a = next w\n[PROOFSTEP]\nrcases ih w with ⟨x, rfl⟩\n[GOAL]\ncase step.intro.intro\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Surjective (leRecOn hnm fun {k} => next)\nx : C n\n⊢ ∃ a, leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) a = next (leRecOn hnm (fun {k} => next) x)\n[PROOFSTEP]\nuse x\n[GOAL]\ncase h\nm✝¹ n✝ k : ℕ\nC : ℕ → Sort u\nn m✝ : ℕ\nnext : {k : ℕ} → C k → C (k + 1)\nHnext : ∀ (n : ℕ), Function.Surjective next\nm : ℕ\nhnm : Nat.le n m\nih : Function.Surjective (leRecOn hnm fun {k} => next)\nx : C n\n⊢ leRecOn (_ : Nat.le n (succ m)) (fun {k} => next) x = next (leRecOn hnm (fun {k} => next) x)\n[PROOFSTEP]\nrw [leRecOn_succ]\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → ((m : ℕ) → m < n → P m) → P n\nn : ℕ\n⊢ strongRecOn' n h = h n fun m x => strongRecOn' m h\n[PROOFSTEP]\nsimp only [strongRecOn']\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → ((m : ℕ) → m < n → P m) → P n\nn : ℕ\n⊢ Nat.strongRec' h n = h n fun m x => Nat.strongRec' h m\n[PROOFSTEP]\nrw [Nat.strongRec']\n[GOAL]\nm✝ n k m : ℕ\nP : (n : ℕ) → m ≤ n → Prop\nbase : P m (_ : m ≤ m)\nsucc : ∀ (n : ℕ) (hn : m ≤ n), P n hn → P (n + 1) (_ : m ≤ n + 1)\n⊢ ∀ (n : ℕ) (hn : m ≤ n), P n hn\n[PROOFSTEP]\napply Nat.le.rec\n[GOAL]\ncase refl\nm✝ n k m : ℕ\nP : (n : ℕ) → m ≤ n → Prop\nbase : P m (_ : m ≤ m)\nsucc : ∀ (n : ℕ) (hn : m ≤ n), P n hn → P (n + 1) (_ : m ≤ n + 1)\n⊢ P m (_ : Nat.le m m)\n[PROOFSTEP]\nexact base\n[GOAL]\ncase step\nm✝ n k m : ℕ\nP : (n : ℕ) → m ≤ n → Prop\nbase : P m (_ : m ≤ m)\nsucc : ∀ (n : ℕ) (hn : m ≤ n), P n hn → P (n + 1) (_ : m ≤ n + 1)\n⊢ ∀ {m_1 : ℕ} (a : Nat.le m m_1), P m_1 a → P (Nat.succ m_1) (_ : Nat.le m (Nat.succ m_1))\n[PROOFSTEP]\nintros n hn\n[GOAL]\ncase step\nm✝ n✝ k m : ℕ\nP : (n : ℕ) → m ≤ n → Prop\nbase : P m (_ : m ≤ m)\nsucc : ∀ (n : ℕ) (hn : m ≤ n), P n hn → P (n + 1) (_ : m ≤ n + 1)\nn : ℕ\nhn : Nat.le m n\n⊢ P n hn → P (Nat.succ n) (_ : Nat.le m (Nat.succ n))\n[PROOFSTEP]\napply succ n hn\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nn : ℕ\nnn : n ≤ n\nhP : P n\n⊢ decreasingInduction h nn hP = hP\n[PROOFSTEP]\ndsimp only [decreasingInduction]\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nn : ℕ\nnn : n ≤ n\nhP : P n\n⊢ leRecOn nn (fun {k} ih hsk => ih (h k hsk)) (fun h => h) hP = hP\n[PROOFSTEP]\nrw [leRecOn_self]\n[GOAL]\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n : ℕ\nmn : m ≤ n\nmsn : m ≤ n + 1\nhP : P (n + 1)\n⊢ decreasingInduction h msn hP = decreasingInduction h mn (h n hP)\n[PROOFSTEP]\ndsimp only [decreasingInduction]\n[GOAL]\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n : ℕ\nmn : m ≤ n\nmsn : m ≤ n + 1\nhP : P (n + 1)\n⊢ leRecOn msn (fun {k} ih hsk => ih (h k hsk)) (fun h => h) hP =\n leRecOn mn (fun {k} ih hsk => ih (h k hsk)) (fun h => h) (h n hP)\n[PROOFSTEP]\nrw [leRecOn_succ]\n[GOAL]\nm✝ n k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm : ℕ\nmsm : m ≤ m + 1\nhP : P (m + 1)\n⊢ decreasingInduction h msm hP = h m hP\n[PROOFSTEP]\ndsimp only [decreasingInduction]\n[GOAL]\nm✝ n k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm : ℕ\nmsm : m ≤ m + 1\nhP : P (m + 1)\n⊢ leRecOn msm (fun {k} ih hsk => ih (h k hsk)) (fun h => h) hP = h m hP\n[PROOFSTEP]\nrw [leRecOn_succ']\n[GOAL]\nm✝ n✝ k✝ : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n k : ℕ\nmn : m ≤ n\nnk : n ≤ k\nhP : P k\n⊢ decreasingInduction h (_ : m ≤ k) hP = decreasingInduction h mn (decreasingInduction h nk hP)\n[PROOFSTEP]\ninduction' nk with k nk ih\n[GOAL]\ncase refl\nm✝ n✝ k✝ : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n k : ℕ\nmn : m ≤ n\nhP✝ : P k\nhP : P n\n⊢ decreasingInduction h (_ : m ≤ n) hP = decreasingInduction h mn (decreasingInduction h (_ : Nat.le n n) hP)\n[PROOFSTEP]\nrw [decreasingInduction_self]\n[GOAL]\ncase step\nm✝ n✝ k✝¹ : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n k✝ : ℕ\nmn : m ≤ n\nhP✝ : P k✝\nk : ℕ\nnk : Nat.le n k\nih : ∀ (hP : P k), decreasingInduction h (_ : m ≤ k) hP = decreasingInduction h mn (decreasingInduction h nk hP)\nhP : P (succ k)\n⊢ decreasingInduction h (_ : m ≤ succ k) hP =\n decreasingInduction h mn (decreasingInduction h (_ : Nat.le n (succ k)) hP)\n[PROOFSTEP]\nrw [decreasingInduction_succ h (le_trans mn nk), ih, decreasingInduction_succ]\n[GOAL]\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n : ℕ\nsmn : m + 1 ≤ n\nmn : m ≤ n\nhP : P n\n⊢ decreasingInduction h mn hP = h m (decreasingInduction h smn hP)\n[PROOFSTEP]\nrw [Subsingleton.elim mn (le_trans (le_succ m) smn), decreasingInduction_trans, decreasingInduction_succ']\n[GOAL]\ncase msm\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nh : (n : ℕ) → P (n + 1) → P n\nm n : ℕ\nsmn : m + 1 ≤ n\nmn : m ≤ n\nhP : P n\n⊢ m ≤ m + 1\n[PROOFSTEP]\napply Nat.le_succ\n[GOAL]\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nm n : ℕ\nh : (k : ℕ) → k < n → m ≤ k → P (k + 1) → P k\nmn : m ≤ n\nhP : P n\n⊢ P m\n[PROOFSTEP]\nrevert h hP\n[GOAL]\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nm n : ℕ\nmn : m ≤ n\n⊢ ((k : ℕ) → k < n → m ≤ k → P (k + 1) → P k) → P n → P m\n[PROOFSTEP]\nrefine' leRecOn' mn _ _\n[GOAL]\ncase refine'_1\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nm n : ℕ\nmn : m ≤ n\n⊢ ⦃k : ℕ⦄ →\n m ≤ k →\n (((k_1 : ℕ) → k_1 < k → m ≤ k_1 → P (k_1 + 1) → P k_1) → P k → P m) →\n ((k_1 : ℕ) → k_1 < k + 1 → m ≤ k_1 → P (k_1 + 1) → P k_1) → P (k + 1) → P m\n[PROOFSTEP]\nintro n mn ih h hP\n[GOAL]\ncase refine'_1\nm✝ n✝¹ k : ℕ\nP : ℕ → Sort u_1\nm n✝ : ℕ\nmn✝ : m ≤ n✝\nn : ℕ\nmn : m ≤ n\nih : ((k : ℕ) → k < n → m ≤ k → P (k + 1) → P k) → P n → P m\nh : (k : ℕ) → k < n + 1 → m ≤ k → P (k + 1) → P k\nhP : P (n + 1)\n⊢ P m\n[PROOFSTEP]\napply ih\n[GOAL]\ncase refine'_1.h\nm✝ n✝¹ k : ℕ\nP : ℕ → Sort u_1\nm n✝ : ℕ\nmn✝ : m ≤ n✝\nn : ℕ\nmn : m ≤ n\nih : ((k : ℕ) → k < n → m ≤ k → P (k + 1) → P k) → P n → P m\nh : (k : ℕ) → k < n + 1 → m ≤ k → P (k + 1) → P k\nhP : P (n + 1)\n⊢ (k : ℕ) → k < n → m ≤ k → P (k + 1) → P k\n[PROOFSTEP]\nexact fun k hk => h k (Nat.lt.step hk)\n[GOAL]\ncase refine'_1.hP\nm✝ n✝¹ k : ℕ\nP : ℕ → Sort u_1\nm n✝ : ℕ\nmn✝ : m ≤ n✝\nn : ℕ\nmn : m ≤ n\nih : ((k : ℕ) → k < n → m ≤ k → P (k + 1) → P k) → P n → P m\nh : (k : ℕ) → k < n + 1 → m ≤ k → P (k + 1) → P k\nhP : P (n + 1)\n⊢ P n\n[PROOFSTEP]\nexact h n (lt_succ_self n) mn hP\n[GOAL]\ncase refine'_2\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nm n : ℕ\nmn : m ≤ n\n⊢ ((k : ℕ) → k < m → m ≤ k → P (k + 1) → P k) → P m → P m\n[PROOFSTEP]\nintro _ hP\n[GOAL]\ncase refine'_2\nm✝ n✝ k : ℕ\nP : ℕ → Sort u_1\nm n : ℕ\nmn : m ≤ n\nh✝ : (k : ℕ) → k < m → m ≤ k → P (k + 1) → P k\nhP : P m\n⊢ P m\n[PROOFSTEP]\nexact hP\n[GOAL]\nm n k a b : ℕ\nhb : 0 < b\n⊢ 1 ≤ a / b ↔ b ≤ a\n[PROOFSTEP]\nrw [le_div_iff_mul_le hb, one_mul]\n[GOAL]\nm✝ n✝ k✝ n m : ℕ\nh : n ≤ m\nk : ℕ\nk0 : k = 0\n⊢ n / k ≤ m / k\n[PROOFSTEP]\nsimp [k0]\n[GOAL]\nm n k a b : ℕ\nhba : b ≤ a\nhb : 0 < b\nh : a / b = 0\n⊢ a = a % b\n[PROOFSTEP]\nsimpa [h] using (mod_add_div a b).symm\n[GOAL]\nm n k a b c : ℕ\nhc0 : c = 0\n⊢ a * (b / c) ≤ a * b / c\n[PROOFSTEP]\nsimp [hc0]\n[GOAL]\nm n k a b c : ℕ\nhc0 : ¬c = 0\n⊢ a * (b / c) * c ≤ a * b\n[PROOFSTEP]\nrw [mul_assoc]\n[GOAL]\nm n k a b c : ℕ\nhc0 : ¬c = 0\n⊢ a * (b / c * c) ≤ a * b\n[PROOFSTEP]\nexact Nat.mul_le_mul_left _ (Nat.div_mul_le_self _ _)\n[GOAL]\nm n k a b c : ℕ\nH1 : b ∣ a\nH2 : a / b = c\n⊢ a = b * c\n[PROOFSTEP]\nrw [← H2, Nat.mul_div_cancel' H1]\n[GOAL]\nm n k a b c : ℕ\nH : 0 < b\nH' : b ∣ a\n⊢ a / b = c ↔ a = c * b\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\nm n k a b c : ℕ\nH : 0 < b\nH' : b ∣ a\n⊢ a / b = c ↔ a = b * c\n[PROOFSTEP]\nexact Nat.div_eq_iff_eq_mul_right H H'\n[GOAL]\nm n k a b c : ℕ\nH1 : b ∣ a\nH2 : a / b = c\n⊢ a = c * b\n[PROOFSTEP]\nrw [mul_comm, Nat.eq_mul_of_div_eq_right H1 H2]\n[GOAL]\nm n k a b : ℕ\nHd : a ∣ b\n⊢ a * (b / a) = b\n[PROOFSTEP]\nrw [mul_comm, Nat.div_mul_cancel Hd]\n[GOAL]\nm n k a b : ℕ\nhb : 0 < b\n⊢ a < a / b * b + b\n[PROOFSTEP]\nrw [← Nat.succ_mul, ← Nat.div_lt_iff_lt_mul hb]\n[GOAL]\nm n k a b : ℕ\nhb : 0 < b\n⊢ a / b < succ (a / b)\n[PROOFSTEP]\nexact Nat.lt_succ_self _\n[GOAL]\nm n k a b d : ℕ\nhda : d ∣ a\nhdb : d ∣ b\n⊢ a / d = b / d ↔ a = b\n[PROOFSTEP]\nrefine ⟨fun h => ?_, congr_arg fun n => n / d⟩\n[GOAL]\nm n k a b d : ℕ\nhda : d ∣ a\nhdb : d ∣ b\nh : a / d = b / d\n⊢ a = b\n[PROOFSTEP]\nrw [← Nat.mul_div_cancel' hda, ← Nat.mul_div_cancel' hdb, h]\n[GOAL]\nm n k a b : ℕ\nh : b ≠ 0\n⊢ a % b = a ↔ a < b\n[PROOFSTEP]\ncases b\n[GOAL]\ncase zero\nm n k a : ℕ\nh : zero ≠ 0\n⊢ a % zero = a ↔ a < zero\ncase succ m n k a n✝ : ℕ h : succ n✝ ≠ 0 ⊢ a % succ n✝ = a ↔ a < succ n✝\n[PROOFSTEP]\ncontradiction\n[GOAL]\ncase succ\nm n k a n✝ : ℕ\nh : succ n✝ ≠ 0\n⊢ a % succ n✝ = a ↔ a < succ n✝\n[PROOFSTEP]\nexact ⟨fun h => h.ge.trans_lt (mod_lt _ (succ_pos _)), mod_eq_of_lt⟩\n[GOAL]\nm✝ n k✝ m k : ℕ\n⊢ m % k + m / k * k = m\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\nm✝ n k✝ m k : ℕ\n⊢ m % k + k * (m / k) = m\n[PROOFSTEP]\nexact mod_add_div _ _\n[GOAL]\nm✝ n k✝ m k : ℕ\n⊢ m / k * k + m % k = m\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\nm✝ n k✝ m k : ℕ\n⊢ k * (m / k) + m % k = m\n[PROOFSTEP]\nexact div_add_mod _ _\n[GOAL]\nm✝ n✝ k✝ n k m d : ℕ\nh : 0 < k\nx✝ : m + k * d = n ∧ m < k\nh₁ : m + k * d = n\nh₂ : m < k\n⊢ (m + k * d) / k = d ∧ (m + k * d) % k = m\n[PROOFSTEP]\nrw [add_mul_div_left _ _ h, add_mul_mod_self_left]\n[GOAL]\nm✝ n✝ k✝ n k m d : ℕ\nh : 0 < k\nx✝ : m + k * d = n ∧ m < k\nh₁ : m + k * d = n\nh₂ : m < k\n⊢ m / k + d = d ∧ m % k = m\n[PROOFSTEP]\nsimp [div_eq_of_lt, mod_eq_of_lt, h₂]\n[GOAL]\nm n k a b c : ℕ\nha : 0 < a\nd : ℕ\n⊢ a * c = a * b * d ↔ c = b * d\n[PROOFSTEP]\nrw [mul_assoc, mul_right_inj' ha.ne']\n[GOAL]\nm n k a b c : ℕ\nhc : 0 < c\nd : ℕ\n⊢ b * c = a * c * d ↔ b = a * d\n[PROOFSTEP]\nrw [mul_right_comm, mul_left_inj' hc.ne']\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n⊢ n % k % m = n % m\n[PROOFSTEP]\nconv =>\n rhs\n rw [← mod_add_div n k]\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n| n % k % m = n % m\n[PROOFSTEP]\n rhs\n rw [← mod_add_div n k]\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n| n % k % m = n % m\n[PROOFSTEP]\n rhs\n rw [← mod_add_div n k]\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n| n % k % m = n % m\n[PROOFSTEP]\nrhs\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n| n % m\n[PROOFSTEP]\nrw [← mod_add_div n k]\n[GOAL]\nm✝ n✝ k✝ n m k : ℕ\nh : m ∣ k\n⊢ n % k % m = (n % k + k * (n / k)) % m\n[PROOFSTEP]\nrcases h with ⟨t, rfl⟩\n[GOAL]\ncase intro\nm✝ n✝ k n m t : ℕ\n⊢ n % (m * t) % m = (n % (m * t) + m * t * (n / (m * t))) % m\n[PROOFSTEP]\nrw [mul_assoc, add_mul_mod_self_left]\n[GOAL]\nm✝ n✝ k✝ m n k i : ℕ\nH : m % n = k % n\n⊢ (m + i) % n = (k + i) % n\n[PROOFSTEP]\nrw [← mod_add_mod, ← mod_add_mod k, H]\n[GOAL]\nm✝ n✝ k✝ m n k i : ℕ\nH : m % n = k % n\n⊢ (i + m) % n = (i + k) % n\n[PROOFSTEP]\nrw [add_comm, add_mod_eq_add_mod_right _ H, add_comm]\n[GOAL]\nm n k a b c : ℕ\nhab : c ∣ b\nh : a ∣ b / c\nh1 : ∃ d, b / c = a * d\nd : ℕ\nhd : b / c = a * d\nh3 : b = a * d * c\n⊢ b = c * a * d\n[PROOFSTEP]\nrwa [mul_comm, ← mul_assoc] at h3 \n[GOAL]\nm n k a b : ℕ\nw : a ∣ b\nh : b / a = 1\n⊢ a = b\n[PROOFSTEP]\nrw [← Nat.div_mul_cancel w, h, one_mul]\n[GOAL]\nm n k a b : ℕ\nw : a ∣ b\nh : b / a = 0\n⊢ b = 0\n[PROOFSTEP]\nrw [← Nat.div_mul_cancel w, h, zero_mul]\n[GOAL]\nm✝ n✝ k m n : ℕ\nn0 : 0 < n\n⊢ m < n * (m / n + 1)\n[PROOFSTEP]\nrw [mul_comm, ← Nat.div_lt_iff_lt_mul' n0]\n[GOAL]\nm✝ n✝ k m n : ℕ\nn0 : 0 < n\n⊢ m / n < m / n + 1\n[PROOFSTEP]\nexact lt_succ_self _\n[GOAL]\nm n k a b c : ℕ\n⊢ (a * b + c) % b = c % b\n[PROOFSTEP]\nsimp [Nat.add_mod]\n[GOAL]\nm n k a b c : ℕ\nh : c < b\n⊢ (a * b + c) % b = c\n[PROOFSTEP]\nrw [Nat.mul_add_mod, Nat.mod_eq_of_lt h]\n[GOAL]\nm n✝ k n : ℕ\n⊢ pred n = n ↔ n = 0\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nm n k : ℕ\n⊢ pred zero = zero ↔ zero = 0\n[PROOFSTEP]\nsimp [(Nat.succ_ne_self _).symm]\n[GOAL]\ncase succ\nm n k n✝ : ℕ\n⊢ pred (succ n✝) = succ n✝ ↔ succ n✝ = 0\n[PROOFSTEP]\nsimp [(Nat.succ_ne_self _).symm]\n[GOAL]\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\n⊢ Nat.find h = m ↔ p m ∧ ∀ (n : ℕ), n < m → ¬p n\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase mp\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\n⊢ Nat.find h = m → p m ∧ ∀ (n : ℕ), n < m → ¬p n\n[PROOFSTEP]\nrintro rfl\n[GOAL]\ncase mp\nn k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\n⊢ p (Nat.find h) ∧ ∀ (n : ℕ), n < Nat.find h → ¬p n\n[PROOFSTEP]\nexact ⟨Nat.find_spec h, fun _ => Nat.find_min h⟩\n[GOAL]\ncase mpr\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\n⊢ (p m ∧ ∀ (n : ℕ), n < m → ¬p n) → Nat.find h = m\n[PROOFSTEP]\nrintro ⟨hm, hlt⟩\n[GOAL]\ncase mpr.intro\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\nhm : p m\nhlt : ∀ (n : ℕ), n < m → ¬p n\n⊢ Nat.find h = m\n[PROOFSTEP]\nexact le_antisymm (Nat.find_min' h hm) (not_lt.1 <| imp_not_comm.1 (hlt _) <| Nat.find_spec h)\n[GOAL]\nm n✝ k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\nn : ℕ\n⊢ Nat.find h ≤ n ↔ ∃ m, m ≤ n ∧ p m\n[PROOFSTEP]\nsimp only [exists_prop, ← lt_succ_iff, find_lt_iff]\n[GOAL]\nm n✝ k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\nn : ℕ\n⊢ n ≤ Nat.find h ↔ ∀ (m : ℕ), m < n → ¬p m\n[PROOFSTEP]\nsimp_rw [← not_lt, find_lt_iff, not_exists, not_and]\n[GOAL]\nm n✝ k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\nn : ℕ\n⊢ n < Nat.find h ↔ ∀ (m : ℕ), m ≤ n → ¬p m\n[PROOFSTEP]\nsimp only [← succ_le_iff, le_find_iff, succ_le_succ_iff]\n[GOAL]\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh : ∃ n, p n\n⊢ Nat.find h = 0 ↔ p 0\n[PROOFSTEP]\nsimp [find_eq_iff]\n[GOAL]\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh₁ : ∃ n, p n\nh₂ : ∃ n, p (n + 1)\nh0 : ¬p 0\n⊢ Nat.find h₁ = Nat.find h₂ + 1\n[PROOFSTEP]\nrefine' (find_eq_iff _).2 ⟨Nat.find_spec h₂, fun n hn => _⟩\n[GOAL]\nm n✝ k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh₁ : ∃ n, p n\nh₂ : ∃ n, p (n + 1)\nh0 : ¬p 0\nn : ℕ\nhn : n < Nat.find h₂ + 1\n⊢ ¬p n\n[PROOFSTEP]\ncases' n with n\n[GOAL]\ncase zero\nm n k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh₁ : ∃ n, p n\nh₂ : ∃ n, p (n + 1)\nh0 : ¬p 0\nhn : zero < Nat.find h₂ + 1\n⊢ ¬p zero\ncase succ\nm n✝ k : ℕ\np q : ℕ → Prop\ninst✝¹ : DecidablePred p\ninst✝ : DecidablePred q\nh₁ : ∃ n, p n\nh₂ : ∃ n, p (n + 1)\nh0 : ¬p 0\nn : ℕ\nhn : succ n < Nat.find h₂ + 1\n⊢ ¬p (succ n)\n[PROOFSTEP]\nexacts [h0, @Nat.find_min (fun n => p (n + 1)) _ h₂ _ (succ_lt_succ_iff.1 hn)]\n[GOAL]\nm n✝ k : ℕ\nP Q : ℕ → Prop\ninst✝ : DecidablePred P\nb n : ℕ\nh : P (n + 1)\n⊢ Nat.findGreatest P (n + 1) = n + 1\n[PROOFSTEP]\nsimp [Nat.findGreatest, h]\n[GOAL]\nm n k : ℕ\nP Q : ℕ → Prop\ninst✝ : DecidablePred P\nb : ℕ\nh : ¬P (b + 1)\n⊢ Nat.findGreatest P (b + 1) = Nat.findGreatest P b\n[PROOFSTEP]\nsimp [Nat.findGreatest, h]\n[GOAL]\nm n✝ k : ℕ\nP : (k : ℕ) → k < 0 → Prop\nx✝ : (n : ℕ) → (h : n < 0) → Decidable (P n h)\nn : ℕ\nh : n < 0\n⊢ P n h\n[PROOFSTEP]\ncases h\n[GOAL]\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\n⊢ Decidable (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h)\n[PROOFSTEP]\ncases' decidableBallLT n fun k h => P k (lt_succ_of_lt h) with h h\n[GOAL]\ncase isFalse\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh : ¬∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\n⊢ Decidable (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h)\n[PROOFSTEP]\nrefine' isFalse (mt _ h)\n[GOAL]\ncase isFalse\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh : ¬∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\n⊢ (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h) → ∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\n[PROOFSTEP]\nintro hn k h\n[GOAL]\ncase isFalse\nm n✝ k✝ n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh✝ : ¬∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\nhn : ∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h\nk : ℕ\nh : k < n\n⊢ P k (_ : k < succ n)\n[PROOFSTEP]\napply hn\n[GOAL]\ncase isTrue\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh : ∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\n⊢ Decidable (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h)\n[PROOFSTEP]\nby_cases p : P n (lt_succ_self n)\n[GOAL]\ncase pos\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh : ∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\np : P n (_ : n < succ n)\n⊢ Decidable (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h)\n[PROOFSTEP]\nexact\n isTrue fun k h' =>\n (le_of_lt_succ h').lt_or_eq_dec.elim (h _) fun e =>\n match k, e, h' with\n | _, rfl, _ => p\n[GOAL]\ncase neg\nm n✝ k n : ℕ\nP : (k : ℕ) → k < n + 1 → Prop\nH : (n_1 : ℕ) → (h : n_1 < n + 1) → Decidable (P n_1 h)\nh : ∀ (n_1 : ℕ) (h : n_1 < n), P n_1 (_ : n_1 < succ n)\np : ¬P n (_ : n < succ n)\n⊢ Decidable (∀ (n_1 : ℕ) (h : n_1 < n + 1), P n_1 h)\n[PROOFSTEP]\nexact isFalse (mt (fun hn => hn _ _) p)\n[GOAL]\nm n k : ℕ\nP : ℕ → Prop\nh : DecidablePred P\n⊢ ¬(fun n => ∃ m, m < n ∧ P m) 0\n[PROOFSTEP]\nsimp\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nh : DecidablePred P\nn : ℕ\n⊢ (fun n_1 => ∃ m, m < n_1 ∧ ?m.69545 n m) n ∨ P n ↔ (fun n => ∃ m, m < n ∧ P m) (n + 1)\n[PROOFSTEP]\nsimp only [lt_succ_iff_lt_or_eq, or_and_right, exists_or, exists_eq_left]\n[GOAL]\nm n✝ k : ℕ\nP : ℕ → Prop\nh : DecidablePred P\nn : ℕ\n⊢ (∃ m, m < n ∧ ?m.69545 n m) ∨ P n ↔ (∃ x, x < n ∧ P x) ∨ P n\n[PROOFSTEP]\napply Iff.refl\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Basic", "llama_tokens": 16806, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8333246118695629, "lm_q2_score": 0.8031737892899221, "lm_q1q2_score": 0.6693044862238304}} {"text": "[GOAL]\nE : Type u_1\ninst✝² : NormedAddCommGroup E\ninst✝¹ : NormedSpace ℝ E\ninst✝ : CompleteSpace E\nf : ℝ → E\na b : ℝ\n⊢ ⨍ (x : ℝ) in a..b, f x = ⨍ (x : ℝ) in b..a, f x\n[PROOFSTEP]\nrw [setAverage_eq, setAverage_eq, uIoc_comm]\n[GOAL]\nE : Type u_1\ninst✝² : NormedAddCommGroup E\ninst✝¹ : NormedSpace ℝ E\ninst✝ : CompleteSpace E\nf : ℝ → E\na b : ℝ\n⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x\n[PROOFSTEP]\ncases' le_or_lt a b with h h\n[GOAL]\ncase inl\nE : Type u_1\ninst✝² : NormedAddCommGroup E\ninst✝¹ : NormedSpace ℝ E\ninst✝ : CompleteSpace E\nf : ℝ → E\na b : ℝ\nh : a ≤ b\n⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x\n[PROOFSTEP]\nrw [setAverage_eq, uIoc_of_le h, Real.volume_Ioc, intervalIntegral.integral_of_le h,\n ENNReal.toReal_ofReal (sub_nonneg.2 h)]\n[GOAL]\ncase inr\nE : Type u_1\ninst✝² : NormedAddCommGroup E\ninst✝¹ : NormedSpace ℝ E\ninst✝ : CompleteSpace E\nf : ℝ → E\na b : ℝ\nh : b < a\n⊢ ⨍ (x : ℝ) in a..b, f x = (b - a)⁻¹ • ∫ (x : ℝ) in a..b, f x\n[PROOFSTEP]\nrw [setAverage_eq, uIoc_of_lt h, Real.volume_Ioc, intervalIntegral.integral_of_ge h.le,\n ENNReal.toReal_ofReal (sub_nonneg.2 h.le), smul_neg, ← neg_smul, ← inv_neg, neg_sub]\n[GOAL]\nE : Type u_1\ninst✝² : NormedAddCommGroup E\ninst✝¹ : NormedSpace ℝ E\ninst✝ : CompleteSpace E\nf : ℝ → ℝ\na b : ℝ\n⊢ ⨍ (x : ℝ) in a..b, f x = (∫ (x : ℝ) in a..b, f x) / (b - a)\n[PROOFSTEP]\nrw [interval_average_eq, smul_eq_mul, div_eq_inv_mul]\n", "meta": {"mathlib_filename": "Mathlib.MeasureTheory.Integral.IntervalAverage", "llama_tokens": 766, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8633916064586998, "lm_q2_score": 0.7745833893685269, "lm_q1q2_score": 0.6687687968831171}} {"text": "[GOAL]\nE : Type u_1\nF : Type u_2\ninst✝³ : NormedAddCommGroup E\ninst✝² : NormedAddCommGroup F\ninst✝¹ : InnerProductSpace ℝ E\ninst✝ : InnerProductSpace ℝ F\nf' : E →L[ℝ] F\nh : IsConformalMap f'\nu v : E\n⊢ angle (↑f' u) (↑f' v) = angle u v\n[PROOFSTEP]\nobtain ⟨c, hc, li, rfl⟩ := h\n[GOAL]\ncase intro.intro.intro\nE : Type u_1\nF : Type u_2\ninst✝³ : NormedAddCommGroup E\ninst✝² : NormedAddCommGroup F\ninst✝¹ : InnerProductSpace ℝ E\ninst✝ : InnerProductSpace ℝ F\nu v : E\nc : ℝ\nhc : c ≠ 0\nli : E →ₗᵢ[ℝ] F\n⊢ angle (↑(c • LinearIsometry.toContinuousLinearMap li) u) (↑(c • LinearIsometry.toContinuousLinearMap li) v) =\n angle u v\n[PROOFSTEP]\nexact (angle_smul_smul hc _ _).trans (li.angle_map _ _)\n", "meta": {"mathlib_filename": "Mathlib.Geometry.Euclidean.Angle.Unoriented.Conformal", "llama_tokens": 327, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9219218434359675, "lm_q2_score": 0.7248702761768248, "lm_q1q2_score": 0.6682737412648772}} {"text": "[GOAL]\nι : Type u_1\nX : Type u_2\nE : Type u_3\ninst✝⁷ : TopologicalSpace X\ninst✝⁶ : AddCommGroup E\ninst✝⁵ : Module ℝ E\ninst✝⁴ : NormalSpace X\ninst✝³ : ParacompactSpace X\ninst✝² : TopologicalSpace E\ninst✝¹ : ContinuousAdd E\ninst✝ : ContinuousSMul ℝ E\nt : X → Set E\nht : ∀ (x : X), Convex ℝ (t x)\nH : ∀ (x : X), ∃ U, U ∈ 𝓝 x ∧ ∃ g, ContinuousOn g U ∧ ∀ (y : X), y ∈ U → g y ∈ t y\n⊢ ∃ g, ∀ (x : X), ↑g x ∈ t x\n[PROOFSTEP]\nchoose U hU g hgc hgt using H\n[GOAL]\nι : Type u_1\nX : Type u_2\nE : Type u_3\ninst✝⁷ : TopologicalSpace X\ninst✝⁶ : AddCommGroup E\ninst✝⁵ : Module ℝ E\ninst✝⁴ : NormalSpace X\ninst✝³ : ParacompactSpace X\ninst✝² : TopologicalSpace E\ninst✝¹ : ContinuousAdd E\ninst✝ : ContinuousSMul ℝ E\nt : X → Set E\nht : ∀ (x : X), Convex ℝ (t x)\nU : X → Set X\nhU : ∀ (x : X), U x ∈ 𝓝 x\ng : X → X → E\nhgc : ∀ (x : X), ContinuousOn (g x) (U x)\nhgt : ∀ (x y : X), y ∈ U x → g x y ∈ t y\n⊢ ∃ g, ∀ (x : X), ↑g x ∈ t x\n[PROOFSTEP]\nobtain ⟨f, hf⟩ :=\n PartitionOfUnity.exists_isSubordinate isClosed_univ (fun x => interior (U x)) (fun x => isOpen_interior) fun x _ =>\n mem_iUnion.2 ⟨x, mem_interior_iff_mem_nhds.2 (hU x)⟩\n[GOAL]\ncase intro\nι : Type u_1\nX : Type u_2\nE : Type u_3\ninst✝⁷ : TopologicalSpace X\ninst✝⁶ : AddCommGroup E\ninst✝⁵ : Module ℝ E\ninst✝⁴ : NormalSpace X\ninst✝³ : ParacompactSpace X\ninst✝² : TopologicalSpace E\ninst✝¹ : ContinuousAdd E\ninst✝ : ContinuousSMul ℝ E\nt : X → Set E\nht : ∀ (x : X), Convex ℝ (t x)\nU : X → Set X\nhU : ∀ (x : X), U x ∈ 𝓝 x\ng : X → X → E\nhgc : ∀ (x : X), ContinuousOn (g x) (U x)\nhgt : ∀ (x y : X), y ∈ U x → g x y ∈ t y\nf : PartitionOfUnity X X univ\nhf : PartitionOfUnity.IsSubordinate f fun x => interior (U x)\n⊢ ∃ g, ∀ (x : X), ↑g x ∈ t x\n[PROOFSTEP]\nrefine'\n ⟨⟨fun x => ∑ᶠ i, f i x • g i x,\n hf.continuous_finsum_smul (fun i => isOpen_interior) fun i => (hgc i).mono interior_subset⟩,\n fun x => f.finsum_smul_mem_convex (mem_univ x) (fun i hi => hgt _ _ _) (ht _)⟩\n[GOAL]\ncase intro\nι : Type u_1\nX : Type u_2\nE : Type u_3\ninst✝⁷ : TopologicalSpace X\ninst✝⁶ : AddCommGroup E\ninst✝⁵ : Module ℝ E\ninst✝⁴ : NormalSpace X\ninst✝³ : ParacompactSpace X\ninst✝² : TopologicalSpace E\ninst✝¹ : ContinuousAdd E\ninst✝ : ContinuousSMul ℝ E\nt : X → Set E\nht : ∀ (x : X), Convex ℝ (t x)\nU : X → Set X\nhU : ∀ (x : X), U x ∈ 𝓝 x\ng : X → X → E\nhgc : ∀ (x : X), ContinuousOn (g x) (U x)\nhgt : ∀ (x y : X), y ∈ U x → g x y ∈ t y\nf : PartitionOfUnity X X univ\nhf : PartitionOfUnity.IsSubordinate f fun x => interior (U x)\nx i : X\nhi : ↑(↑f i) x ≠ 0\n⊢ x ∈ U i\n[PROOFSTEP]\nexact interior_subset (hf _ <| subset_closure hi)\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Convex.PartitionOfUnity", "llama_tokens": 1277, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8918110511888303, "lm_q2_score": 0.7490872075132153, "lm_q1q2_score": 0.668044249964466}} {"text": "[GOAL]\nn : ℕ\n⊢ fib (n + 2) = fib n + fib (n + 1)\n[PROOFSTEP]\nsimp [fib, Function.iterate_succ_apply']\n[GOAL]\nn : ℕ\n⊢ fib n ≤ fib (n + 1)\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\n⊢ fib zero ≤ fib (zero + 1)\n[PROOFSTEP]\nsimp [fib_add_two]\n[GOAL]\ncase succ\nn✝ : ℕ\n⊢ fib (succ n✝) ≤ fib (succ n✝ + 1)\n[PROOFSTEP]\nsimp [fib_add_two]\n[GOAL]\nn : ℕ\nn_pos : 0 < n\n⊢ 0 < fib 1\n[PROOFSTEP]\ndecide\n[GOAL]\nn : ℕ\n⊢ fib (n + 2) - fib (n + 1) = fib n\n[PROOFSTEP]\nrw [fib_add_two, add_tsub_cancel_right]\n[GOAL]\nn : ℕ\nhn : 2 ≤ n\n⊢ fib n < fib (n + 1)\n[PROOFSTEP]\nrcases exists_add_of_le hn with ⟨n, rfl⟩\n[GOAL]\ncase intro\nn : ℕ\nhn : 2 ≤ 2 + n\n⊢ fib (2 + n) < fib (2 + n + 1)\n[PROOFSTEP]\nrw [← tsub_pos_iff_lt, add_comm 2, fib_add_two_sub_fib_add_one]\n[GOAL]\ncase intro\nn : ℕ\nhn : 2 ≤ 2 + n\n⊢ 0 < fib (n + 1)\n[PROOFSTEP]\napply fib_pos (succ_pos n)\n[GOAL]\n⊢ StrictMono fun n => fib (n + 2)\n[PROOFSTEP]\nrefine' strictMono_nat_of_lt_succ fun n => _\n[GOAL]\nn : ℕ\n⊢ fib (n + 2) < fib (n + 1 + 2)\n[PROOFSTEP]\nrw [add_right_comm]\n[GOAL]\nn : ℕ\n⊢ fib (n + 2) < fib (n + 2 + 1)\n[PROOFSTEP]\nexact fib_lt_fib_succ (self_le_add_left _ _)\n[GOAL]\nn : ℕ\nfive_le_n : 5 ≤ n\n⊢ n ≤ fib n\n[PROOFSTEP]\ninduction' five_le_n with n five_le_n IH\n[GOAL]\ncase refl\nn : ℕ\n⊢ 5 ≤ fib 5\n[PROOFSTEP]\nrfl\n[GOAL]\ncase step\nn✝ n : ℕ\nfive_le_n : Nat.le 5 n\nIH : n ≤ fib n\n⊢ succ n ≤ fib (succ n)\n[PROOFSTEP]\nrw [succ_le_iff]\n[GOAL]\ncase step\nn✝ n : ℕ\nfive_le_n : Nat.le 5 n\nIH : n ≤ fib n\n⊢ n < fib (succ n)\n[PROOFSTEP]\ncalc\n n ≤ fib n := IH\n _ < fib (n + 1) := fib_lt_fib_succ (le_trans (by decide) five_le_n)\n[GOAL]\nn✝ n : ℕ\nfive_le_n : Nat.le 5 n\nIH : n ≤ fib n\n⊢ 2 ≤ 5\n[PROOFSTEP]\ndecide\n[GOAL]\nn : ℕ\n⊢ coprime (fib n) (fib (n + 1))\n[PROOFSTEP]\ninduction' n with n ih\n[GOAL]\ncase zero\n⊢ coprime (fib zero) (fib (zero + 1))\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nn : ℕ\nih : coprime (fib n) (fib (n + 1))\n⊢ coprime (fib (succ n)) (fib (succ n + 1))\n[PROOFSTEP]\nrw [fib_add_two]\n[GOAL]\ncase succ\nn : ℕ\nih : coprime (fib n) (fib (n + 1))\n⊢ coprime (fib (succ n)) (fib n + fib (n + 1))\n[PROOFSTEP]\nsimp only [coprime_add_self_right]\n[GOAL]\ncase succ\nn : ℕ\nih : coprime (fib n) (fib (n + 1))\n⊢ coprime (fib (succ n)) (fib n)\n[PROOFSTEP]\nsimp [coprime, ih.symm]\n[GOAL]\nm n : ℕ\n⊢ fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1)\n[PROOFSTEP]\ninduction' n with n ih generalizing m\n[GOAL]\ncase zero\nm✝ m : ℕ\n⊢ fib (m + zero + 1) = fib m * fib zero + fib (m + 1) * fib (zero + 1)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nm✝ n : ℕ\nih : ∀ (m : ℕ), fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1)\nm : ℕ\n⊢ fib (m + succ n + 1) = fib m * fib (succ n) + fib (m + 1) * fib (succ n + 1)\n[PROOFSTEP]\nintros\n[GOAL]\ncase succ\nm✝ n : ℕ\nih : ∀ (m : ℕ), fib (m + n + 1) = fib m * fib n + fib (m + 1) * fib (n + 1)\nm : ℕ\n⊢ fib (m + succ n + 1) = fib m * fib (succ n) + fib (m + 1) * fib (succ n + 1)\n[PROOFSTEP]\nspecialize ih (m + 1)\n[GOAL]\ncase succ\nm✝ n m : ℕ\nih : fib (m + 1 + n + 1) = fib (m + 1) * fib n + fib (m + 1 + 1) * fib (n + 1)\n⊢ fib (m + succ n + 1) = fib m * fib (succ n) + fib (m + 1) * fib (succ n + 1)\n[PROOFSTEP]\nrw [add_assoc m 1 n, add_comm 1 n] at ih \n[GOAL]\ncase succ\nm✝ n m : ℕ\nih : fib (m + (n + 1) + 1) = fib (m + 1) * fib n + fib (m + 1 + 1) * fib (n + 1)\n⊢ fib (m + succ n + 1) = fib m * fib (succ n) + fib (m + 1) * fib (succ n + 1)\n[PROOFSTEP]\nsimp only [fib_add_two, ih]\n[GOAL]\ncase succ\nm✝ n m : ℕ\nih : fib (m + (n + 1) + 1) = fib (m + 1) * fib n + fib (m + 1 + 1) * fib (n + 1)\n⊢ fib (m + 1) * fib n + (fib m + fib (m + 1)) * fib (n + 1) = fib m * fib (succ n) + fib (m + 1) * (fib n + fib (n + 1))\n[PROOFSTEP]\nring\n[GOAL]\nn : ℕ\n⊢ fib (2 * n) = fib n * (2 * fib (n + 1) - fib n)\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\n⊢ fib (2 * zero) = fib zero * (2 * fib (zero + 1) - fib zero)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nn✝ : ℕ\n⊢ fib (2 * succ n✝) = fib (succ n✝) * (2 * fib (succ n✝ + 1) - fib (succ n✝))\n[PROOFSTEP]\nrw [Nat.succ_eq_add_one, two_mul, ← add_assoc, fib_add, fib_add_two, two_mul]\n[GOAL]\ncase succ\nn✝ : ℕ\n⊢ fib (n✝ + 1) * fib n✝ + (fib n✝ + fib (n✝ + 1)) * fib (n✝ + 1) =\n fib (n✝ + 1) * (fib n✝ + fib (n✝ + 1) + (fib n✝ + fib (n✝ + 1)) - fib (n✝ + 1))\n[PROOFSTEP]\nsimp only [← add_assoc, add_tsub_cancel_right]\n[GOAL]\ncase succ\nn✝ : ℕ\n⊢ fib (n✝ + 1) * fib n✝ + (fib n✝ + fib (n✝ + 1)) * fib (n✝ + 1) = fib (n✝ + 1) * (fib n✝ + fib (n✝ + 1) + fib n✝)\n[PROOFSTEP]\nring\n[GOAL]\nn : ℕ\n⊢ fib (2 * n + 1) = fib (n + 1) ^ 2 + fib n ^ 2\n[PROOFSTEP]\nrw [two_mul, fib_add]\n[GOAL]\nn : ℕ\n⊢ fib n * fib n + fib (n + 1) * fib (n + 1) = fib (n + 1) ^ 2 + fib n ^ 2\n[PROOFSTEP]\nring\n[GOAL]\nn : ℕ\n⊢ fib (2 * n + 2) = fib (n + 1) * (2 * fib n + fib (n + 1))\n[PROOFSTEP]\nrw [fib_add_two, fib_two_mul, fib_two_mul_add_one]\n -- porting note: A bunch of issues similar to [this zulip thread](https://github.com/leanprover-community/mathlib4/pull/1576) with `zify`\n[GOAL]\nn : ℕ\n⊢ fib n * (2 * fib (n + 1) - fib n) + (fib (n + 1) ^ 2 + fib n ^ 2) = fib (n + 1) * (2 * fib n + fib (n + 1))\n[PROOFSTEP]\nhave : fib n ≤ 2 * fib (n + 1) := le_trans (fib_le_fib_succ) (mul_comm 2 _ ▸ le_mul_of_pos_right two_pos)\n[GOAL]\nn : ℕ\nthis : fib n ≤ 2 * fib (n + 1)\n⊢ fib n * (2 * fib (n + 1) - fib n) + (fib (n + 1) ^ 2 + fib n ^ 2) = fib (n + 1) * (2 * fib n + fib (n + 1))\n[PROOFSTEP]\nzify [this]\n[GOAL]\nn : ℕ\nthis : fib n ≤ 2 * fib (n + 1)\n⊢ ↑(fib n) * (2 * ↑(fib (n + 1)) - ↑(fib n)) + (↑(fib (n + 1)) ^ 2 + ↑(fib n) ^ 2) =\n ↑(fib (n + 1)) * (2 * ↑(fib n) + ↑(fib (n + 1)))\n[PROOFSTEP]\nring\n[GOAL]\nn : ℕ\n⊢ fib (bit0 n) = fib n * (2 * fib (n + 1) - fib n)\n[PROOFSTEP]\nrw [bit0_eq_two_mul, fib_two_mul]\n[GOAL]\nn : ℕ\n⊢ fib (bit1 n) = fib (n + 1) ^ 2 + fib n ^ 2\n[PROOFSTEP]\nrw [Nat.bit1_eq_succ_bit0, bit0_eq_two_mul, fib_two_mul_add_one]\n[GOAL]\nn : ℕ\n⊢ fib (bit1 n + 1) = fib (n + 1) * (2 * fib n + fib (n + 1))\n[PROOFSTEP]\nrw [Nat.bit1_eq_succ_bit0, bit0_eq_two_mul, fib_two_mul_add_two]\n[GOAL]\nn : ℕ\n⊢ fastFibAux (bit false n) =\n let p := fastFibAux n;\n (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2)\n[PROOFSTEP]\nrw [fastFibAux, binaryRec_eq]\n[GOAL]\nn : ℕ\n⊢ (if false = true then\n ((binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd ^\n 2 +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst ^\n 2,\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd *\n (2 *\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd))\n else\n ((binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst *\n (2 *\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd -\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst),\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd ^\n 2 +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst ^\n 2)) =\n let p :=\n binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n;\n (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2)\n[PROOFSTEP]\nrfl\n[GOAL]\ncase h\nn : ℕ\n⊢ (if false = true then\n ((fib 0, fib 1).snd ^ 2 + (fib 0, fib 1).fst ^ 2,\n (fib 0, fib 1).snd * (2 * (fib 0, fib 1).fst + (fib 0, fib 1).snd))\n else\n ((fib 0, fib 1).fst * (2 * (fib 0, fib 1).snd - (fib 0, fib 1).fst),\n (fib 0, fib 1).snd ^ 2 + (fib 0, fib 1).fst ^ 2)) =\n (fib 0, fib 1)\n[PROOFSTEP]\nsimp\n[GOAL]\nn : ℕ\n⊢ fastFibAux (bit true n) =\n let p := fastFibAux n;\n (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n[PROOFSTEP]\nrw [fastFibAux, binaryRec_eq]\n[GOAL]\nn : ℕ\n⊢ (if true = true then\n ((binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd ^\n 2 +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst ^\n 2,\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd *\n (2 *\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd))\n else\n ((binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst *\n (2 *\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd -\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst),\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).snd ^\n 2 +\n (binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n).fst ^\n 2)) =\n let p :=\n binaryRec (fib 0, fib 1)\n (fun b x p =>\n if b = true then (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n else (p.fst * (2 * p.snd - p.fst), p.snd ^ 2 + p.fst ^ 2))\n n;\n (p.snd ^ 2 + p.fst ^ 2, p.snd * (2 * p.fst + p.snd))\n[PROOFSTEP]\nrfl\n[GOAL]\ncase h\nn : ℕ\n⊢ (if false = true then\n ((fib 0, fib 1).snd ^ 2 + (fib 0, fib 1).fst ^ 2,\n (fib 0, fib 1).snd * (2 * (fib 0, fib 1).fst + (fib 0, fib 1).snd))\n else\n ((fib 0, fib 1).fst * (2 * (fib 0, fib 1).snd - (fib 0, fib 1).fst),\n (fib 0, fib 1).snd ^ 2 + (fib 0, fib 1).fst ^ 2)) =\n (fib 0, fib 1)\n[PROOFSTEP]\nsimp\n[GOAL]\nn : ℕ\n⊢ fastFibAux n = (fib n, fib (n + 1))\n[PROOFSTEP]\napply Nat.binaryRec _ (fun b n' ih => _) n\n[GOAL]\nn : ℕ\n⊢ fastFibAux 0 = (fib 0, fib (0 + 1))\n[PROOFSTEP]\nsimp [fastFibAux]\n[GOAL]\nn : ℕ\n⊢ ∀ (b : Bool) (n' : ℕ),\n fastFibAux n' = (fib n', fib (n' + 1)) → fastFibAux (bit b n') = (fib (bit b n'), fib (bit b n' + 1))\n[PROOFSTEP]\nintro b\n[GOAL]\nn : ℕ\nb : Bool\n⊢ ∀ (n' : ℕ), fastFibAux n' = (fib n', fib (n' + 1)) → fastFibAux (bit b n') = (fib (bit b n'), fib (bit b n' + 1))\n[PROOFSTEP]\nintro n'\n[GOAL]\nn : ℕ\nb : Bool\nn' : ℕ\n⊢ fastFibAux n' = (fib n', fib (n' + 1)) → fastFibAux (bit b n') = (fib (bit b n'), fib (bit b n' + 1))\n[PROOFSTEP]\nintro ih\n[GOAL]\nn : ℕ\nb : Bool\nn' : ℕ\nih : fastFibAux n' = (fib n', fib (n' + 1))\n⊢ fastFibAux (bit b n') = (fib (bit b n'), fib (bit b n' + 1))\n[PROOFSTEP]\ncases b\n[GOAL]\ncase false\nn n' : ℕ\nih : fastFibAux n' = (fib n', fib (n' + 1))\n⊢ fastFibAux (bit false n') = (fib (bit false n'), fib (bit false n' + 1))\n[PROOFSTEP]\nsimp only [fast_fib_aux_bit_ff, fast_fib_aux_bit_tt, congr_arg Prod.fst ih, congr_arg Prod.snd ih, Prod.mk.inj_iff]\n[GOAL]\ncase true\nn n' : ℕ\nih : fastFibAux n' = (fib n', fib (n' + 1))\n⊢ fastFibAux (bit true n') = (fib (bit true n'), fib (bit true n' + 1))\n[PROOFSTEP]\nsimp only [fast_fib_aux_bit_ff, fast_fib_aux_bit_tt, congr_arg Prod.fst ih, congr_arg Prod.snd ih, Prod.mk.inj_iff]\n[GOAL]\ncase false\nn n' : ℕ\nih : fastFibAux n' = (fib n', fib (n' + 1))\n⊢ fib n' * (2 * fib (n' + 1) - fib n') = fib (bit false n') ∧ fib (n' + 1) ^ 2 + fib n' ^ 2 = fib (bit false n' + 1)\n[PROOFSTEP]\nsimp [bit, fib_bit0, fib_bit1, fib_bit0_succ, fib_bit1_succ]\n[GOAL]\ncase true\nn n' : ℕ\nih : fastFibAux n' = (fib n', fib (n' + 1))\n⊢ fib (n' + 1) ^ 2 + fib n' ^ 2 = fib (bit true n') ∧ fib (n' + 1) * (2 * fib n' + fib (n' + 1)) = fib (bit true n' + 1)\n[PROOFSTEP]\nsimp [bit, fib_bit0, fib_bit1, fib_bit0_succ, fib_bit1_succ]\n[GOAL]\nn : ℕ\n⊢ fastFib n = fib n\n[PROOFSTEP]\nrw [fastFib, fast_fib_aux_eq]\n[GOAL]\nm n : ℕ\n⊢ gcd (fib m) (fib (n + m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\ncases' Nat.eq_zero_or_pos n with h h\n[GOAL]\ncase inl\nm n : ℕ\nh : n = 0\n⊢ gcd (fib m) (fib (n + m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [h]\n[GOAL]\ncase inl\nm n : ℕ\nh : n = 0\n⊢ gcd (fib m) (fib (0 + m)) = gcd (fib m) (fib 0)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nm n : ℕ\nh : n > 0\n⊢ gcd (fib m) (fib (n + m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\nreplace h := Nat.succ_pred_eq_of_pos h\n[GOAL]\ncase inr\nm n : ℕ\nh : succ (pred n) = n\n⊢ gcd (fib m) (fib (n + m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← h, succ_eq_add_one]\n[GOAL]\ncase inr\nm n : ℕ\nh : succ (pred n) = n\n⊢ gcd (fib m) (fib (pred n + 1 + m)) = gcd (fib m) (fib (pred n + 1))\n[PROOFSTEP]\ncalc\n gcd (fib m) (fib (n.pred + 1 + m)) = gcd (fib m) (fib n.pred * fib m + fib (n.pred + 1) * fib (m + 1)) :=\n by\n rw [← fib_add n.pred _]\n ring_nf\n _ = gcd (fib m) (fib (n.pred + 1) * fib (m + 1)) := by rw [add_comm, gcd_add_mul_right_right (fib m) _ (fib n.pred)]\n _ = gcd (fib m) (fib (n.pred + 1)) :=\n coprime.gcd_mul_right_cancel_right (fib (n.pred + 1)) (coprime.symm (fib_coprime_fib_succ m))\n[GOAL]\nm n : ℕ\nh : succ (pred n) = n\n⊢ gcd (fib m) (fib (pred n + 1 + m)) = gcd (fib m) (fib (pred n) * fib m + fib (pred n + 1) * fib (m + 1))\n[PROOFSTEP]\nrw [← fib_add n.pred _]\n[GOAL]\nm n : ℕ\nh : succ (pred n) = n\n⊢ gcd (fib m) (fib (pred n + 1 + m)) = gcd (fib m) (fib (pred n + m + 1))\n[PROOFSTEP]\nring_nf\n[GOAL]\nm n : ℕ\nh : succ (pred n) = n\n⊢ gcd (fib m) (fib (pred n) * fib m + fib (pred n + 1) * fib (m + 1)) = gcd (fib m) (fib (pred n + 1) * fib (m + 1))\n[PROOFSTEP]\nrw [add_comm, gcd_add_mul_right_right (fib m) _ (fib n.pred)]\n[GOAL]\nm n : ℕ\n⊢ gcd (fib m) (fib (n + 0 * m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\nsimp\n[GOAL]\nm n k : ℕ\n⊢ gcd (fib m) (fib (n + (k + 1) * m)) = gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← gcd_fib_add_mul_self m n k, add_mul, ← add_assoc, one_mul, gcd_fib_add_self _ _]\n[GOAL]\nm n : ℕ\n⊢ fib (gcd m n) = gcd (fib m) (fib n)\n[PROOFSTEP]\ninduction m, n using Nat.gcd.induction with\n| H0 => simp\n| H1 m n _ h' =>\n rw [← gcd_rec m n] at h' \n conv_rhs => rw [← mod_add_div' n m]\n rwa [gcd_fib_add_mul_self m (n % m) (n / m), gcd_comm (fib m) _]\n[GOAL]\nm n : ℕ\n⊢ fib (gcd m n) = gcd (fib m) (fib n)\n[PROOFSTEP]\ninduction m, n using Nat.gcd.induction with\n| H0 => simp\n| H1 m n _ h' =>\n rw [← gcd_rec m n] at h' \n conv_rhs => rw [← mod_add_div' n m]\n rwa [gcd_fib_add_mul_self m (n % m) (n / m), gcd_comm (fib m) _]\n[GOAL]\ncase H0\nn✝ : ℕ\n⊢ fib (gcd 0 n✝) = gcd (fib 0) (fib n✝)\n[PROOFSTEP]\n\n| H0 => simp\n[GOAL]\ncase H0\nn✝ : ℕ\n⊢ fib (gcd 0 n✝) = gcd (fib 0) (fib n✝)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase H1\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd (n % m) m) = gcd (fib (n % m)) (fib m)\n⊢ fib (gcd m n) = gcd (fib m) (fib n)\n[PROOFSTEP]\n\n| H1 m n _ h' =>\n rw [← gcd_rec m n] at h' \n conv_rhs => rw [← mod_add_div' n m]\n rwa [gcd_fib_add_mul_self m (n % m) (n / m), gcd_comm (fib m) _]\n[GOAL]\ncase H1\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd (n % m) m) = gcd (fib (n % m)) (fib m)\n⊢ fib (gcd m n) = gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← gcd_rec m n] at h' \n[GOAL]\ncase H1\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd m n) = gcd (fib (n % m)) (fib m)\n⊢ fib (gcd m n) = gcd (fib m) (fib n)\n[PROOFSTEP]\nconv_rhs => rw [← mod_add_div' n m]\n[GOAL]\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd m n) = gcd (fib (n % m)) (fib m)\n| gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← mod_add_div' n m]\n[GOAL]\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd m n) = gcd (fib (n % m)) (fib m)\n| gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← mod_add_div' n m]\n[GOAL]\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd m n) = gcd (fib (n % m)) (fib m)\n| gcd (fib m) (fib n)\n[PROOFSTEP]\nrw [← mod_add_div' n m]\n[GOAL]\ncase H1\nm n : ℕ\na✝ : 0 < m\nh' : fib (gcd m n) = gcd (fib (n % m)) (fib m)\n⊢ fib (gcd m n) = gcd (fib m) (fib (n % m + n / m * m))\n[PROOFSTEP]\nrwa [gcd_fib_add_mul_self m (n % m) (n / m), gcd_comm (fib m) _]\n[GOAL]\nm n : ℕ\nh : m ∣ n\n⊢ fib m ∣ fib n\n[PROOFSTEP]\nrwa [gcd_eq_left_iff_dvd, ← fib_gcd, gcd_eq_left_iff_dvd.mp]\n[GOAL]\nn : ℕ\nh1 : fib (n + 1) = ∑ p in Finset.Nat.antidiagonal n, choose p.fst p.snd\nh2 : fib (succ n + 1) = ∑ p in Finset.Nat.antidiagonal (succ n), choose p.fst p.snd\n⊢ fib (succ (succ n) + 1) = ∑ p in Finset.Nat.antidiagonal (succ (succ n)), choose p.fst p.snd\n[PROOFSTEP]\nrw [fib_add_two, h1, h2, Finset.Nat.antidiagonal_succ_succ', Finset.Nat.antidiagonal_succ']\n[GOAL]\nn : ℕ\nh1 : fib (n + 1) = ∑ p in Finset.Nat.antidiagonal n, choose p.fst p.snd\nh2 : fib (succ n + 1) = ∑ p in Finset.Nat.antidiagonal (succ n), choose p.fst p.snd\n⊢ ∑ p in Finset.Nat.antidiagonal n, choose p.fst p.snd +\n ∑ p in\n Finset.cons (n + 1, 0)\n (Finset.map (Function.Embedding.prodMap (Function.Embedding.refl ℕ) { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n))\n (_ :\n ¬(n + 1, 0) ∈\n Finset.map\n (Function.Embedding.prodMap (Function.Embedding.refl ℕ) { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n)),\n choose p.fst p.snd =\n ∑ p in\n Finset.cons (0, n + 2)\n (Finset.cons (n + 2, 0)\n (Finset.map\n (Function.Embedding.prodMap { toFun := succ, inj' := succ_injective }\n { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n))\n (_ :\n ¬(n + 2, 0) ∈\n Finset.map\n (Function.Embedding.prodMap { toFun := succ, inj' := succ_injective }\n { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n)))\n (_ :\n ¬(0, n + 2) ∈\n Finset.cons (n + 2, 0)\n (Finset.map\n (Function.Embedding.prodMap { toFun := succ, inj' := succ_injective }\n { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n))\n (_ :\n ¬(n + 2, 0) ∈\n Finset.map\n (Function.Embedding.prodMap { toFun := succ, inj' := succ_injective }\n { toFun := succ, inj' := succ_injective })\n (Finset.Nat.antidiagonal n))),\n choose p.fst p.snd\n[PROOFSTEP]\nsimp [choose_succ_succ, Finset.sum_add_distrib, add_left_comm]\n[GOAL]\nn : ℕ\n⊢ fib (n + 1) = ∑ k in Finset.range n, fib k + 1\n[PROOFSTEP]\ninduction' n with n ih\n[GOAL]\ncase zero\n⊢ fib (zero + 1) = ∑ k in Finset.range zero, fib k + 1\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nn : ℕ\nih : fib (n + 1) = ∑ k in Finset.range n, fib k + 1\n⊢ fib (succ n + 1) = ∑ k in Finset.range (succ n), fib k + 1\n[PROOFSTEP]\ncalc\n fib (n + 2) = fib n + fib (n + 1) := fib_add_two\n _ = (fib n + ∑ k in Finset.range n, fib k) + 1 := by rw [ih, add_assoc]\n _ = (∑ k in Finset.range (n + 1), fib k) + 1 := by simp [Finset.range_add_one]\n[GOAL]\nn : ℕ\nih : fib (n + 1) = ∑ k in Finset.range n, fib k + 1\n⊢ fib n + fib (n + 1) = fib n + ∑ k in Finset.range n, fib k + 1\n[PROOFSTEP]\nrw [ih, add_assoc]\n[GOAL]\nn : ℕ\nih : fib (n + 1) = ∑ k in Finset.range n, fib k + 1\n⊢ fib n + ∑ k in Finset.range n, fib k + 1 = ∑ k in Finset.range (n + 1), fib k + 1\n[PROOFSTEP]\nsimp [Finset.range_add_one]\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Fib", "llama_tokens": 11183, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9136765187126079, "lm_q2_score": 0.7310585669110203, "lm_q1q2_score": 0.6679510463902892}} {"text": "[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx✝ y : α\nfb : β → β\nm n k : ℕ\ne : Perm α\nx : α\nhx : IsFixedPt f x\n⊢ IsFixedPt f (f x)\n[PROOFSTEP]\nconvert hx\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n✝ k : ℕ\ne : Perm α\ns : Set α\nh : IsFixedPt (Set.preimage f) s\nn : ℕ\n⊢ IsFixedPt (Set.preimage f^[n]) s\n[PROOFSTEP]\nrw [Set.preimage_iterate_eq]\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n✝ k : ℕ\ne : Perm α\ns : Set α\nh : IsFixedPt (Set.preimage f) s\nn : ℕ\n⊢ IsFixedPt (Set.preimage f)^[n] s\n[PROOFSTEP]\nexact h.iterate n\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n✝ k : ℕ\ne : Perm α\nh : IsFixedPt (↑e) x\nn : ℕ\n⊢ IsFixedPt (↑(e ^ n)) x\n[PROOFSTEP]\nrw [Equiv.Perm.coe_pow]\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n✝ k : ℕ\ne : Perm α\nh : IsFixedPt (↑e) x\nn : ℕ\n⊢ IsFixedPt (↑e)^[n] x\n[PROOFSTEP]\nexact h.iterate _\n[GOAL]\nα✝ : Type u\nβ : Type v\nf✝ fa g : α✝ → α✝\nx✝ y : α✝\nfb : β → β\nm n k : ℕ\ne : Perm α✝\nα : Type u_1\nf : α → α\nx : α\n⊢ x ∈ fixedPoints f ↔ f x = x\n[PROOFSTEP]\nrfl\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n k : ℕ\ne : Perm α\nx✝ : α\n⊢ x✝ ∈ fixedPoints id ↔ x✝ ∈ Set.univ\n[PROOFSTEP]\nsimpa using isFixedPt_id _\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n k : ℕ\ne : Perm α\nh : Function.Commute f g\n⊢ Set.InvOn f g (fixedPoints (f ∘ g)) (fixedPoints (f ∘ g))\n[PROOFSTEP]\nsimpa only [h.comp_eq] using Function.invOn_fixedPoints_comp f g\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n k : ℕ\ne : Perm α\nh : Function.Commute f g\n⊢ Set.BijOn f (fixedPoints (f ∘ g)) (fixedPoints (f ∘ g))\n[PROOFSTEP]\nsimpa only [h.comp_eq] using bijOn_fixedPoints_comp g f\n[GOAL]\nα : Type u\nβ : Type v\nf fa g : α → α\nx y : α\nfb : β → β\nm n k : ℕ\ne : Perm α\nh : Function.Commute f g\n⊢ Set.BijOn g (fixedPoints (f ∘ g)) (fixedPoints (f ∘ g))\n[PROOFSTEP]\nsimpa only [h.comp_eq] using bijOn_fixedPoints_comp f g\n", "meta": {"mathlib_filename": "Mathlib.Dynamics.FixedPoints.Basic", "llama_tokens": 1048, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8311430394931456, "lm_q2_score": 0.8031738034238807, "lm_q1q2_score": 0.6675523162189945}} {"text": "[GOAL]\nA : Type u_1\nB : Type u_2\ni : SetLike A B\np q : A\n⊢ p < q ↔ p ≤ q ∧ ∃ x, x ∈ q ∧ ¬x ∈ p\n[PROOFSTEP]\nrw [lt_iff_le_not_le, not_le_iff_exists]\n", "meta": {"mathlib_filename": "Mathlib.Data.SetLike.Basic", "llama_tokens": 88, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.9207896715436482, "lm_q2_score": 0.7248702880639792, "lm_q1q2_score": 0.6674530744581811}} {"text": "[GOAL]\nG₁ : Type u_1\nG₂ : Type u_2\ninst✝¹ : Semigroup G₁\ninst✝ : Semigroup G₂\nx y : G₁ × G₂\n⊢ x ∣ y ↔ x.fst ∣ y.fst ∧ x.snd ∣ y.snd\n[PROOFSTEP]\ncases x\n[GOAL]\ncase mk\nG₁ : Type u_1\nG₂ : Type u_2\ninst✝¹ : Semigroup G₁\ninst✝ : Semigroup G₂\ny : G₁ × G₂\nfst✝ : G₁\nsnd✝ : G₂\n⊢ (fst✝, snd✝) ∣ y ↔ (fst✝, snd✝).fst ∣ y.fst ∧ (fst✝, snd✝).snd ∣ y.snd\n[PROOFSTEP]\ncases y\n[GOAL]\ncase mk.mk\nG₁ : Type u_1\nG₂ : Type u_2\ninst✝¹ : Semigroup G₁\ninst✝ : Semigroup G₂\nfst✝¹ : G₁\nsnd✝¹ : G₂\nfst✝ : G₁\nsnd✝ : G₂\n⊢ (fst✝¹, snd✝¹) ∣ (fst✝, snd✝) ↔ (fst✝¹, snd✝¹).fst ∣ (fst✝, snd✝).fst ∧ (fst✝¹, snd✝¹).snd ∣ (fst✝, snd✝).snd\n[PROOFSTEP]\nsimp only [dvd_def, Prod.exists, Prod.mk_mul_mk, Prod.mk.injEq, exists_and_left, exists_and_right, and_self, true_and]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Divisibility.Prod", "llama_tokens": 490, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8670357563664174, "lm_q2_score": 0.7690802423634961, "lm_q1q2_score": 0.6668200696441015}} {"text": "[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ : ℝ\n⊢ taylorWithin f (n + 1) s x₀ =\n taylorWithin f n s x₀ +\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀))\n[PROOFSTEP]\ndsimp only [taylorWithin]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ : ℝ\n⊢ ∑ k in Finset.range (n + 1 + 1),\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀)) =\n ∑ k in Finset.range (n + 1),\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀)) +\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀))\n[PROOFSTEP]\nrw [Finset.sum_range_succ]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ taylorWithinEval f (n + 1) s x₀ x =\n taylorWithinEval f n s x₀ x + (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀\n[PROOFSTEP]\nsimp_rw [taylorWithinEval, taylorWithin_succ, LinearMap.map_add, PolynomialModule.comp_eval]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ ↑(PolynomialModule.eval x) (taylorWithin f n s x₀) +\n ↑(PolynomialModule.eval (Polynomial.eval x (Polynomial.X - ↑Polynomial.C x₀)))\n (↑(PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀)) =\n ↑(PolynomialModule.eval x) (taylorWithin f n s x₀) +\n (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀\n[PROOFSTEP]\ncongr\n[GOAL]\ncase e_a\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ ↑(PolynomialModule.eval (Polynomial.eval x (Polynomial.X - ↑Polynomial.C x₀)))\n (↑(PolynomialModule.single ℝ (n + 1)) (taylorCoeffWithin f (n + 1) s x₀)) =\n (((↑n + 1) * ↑n !)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀\n[PROOFSTEP]\nsimp only [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C, PolynomialModule.eval_single, mul_inv_rev]\n[GOAL]\ncase e_a\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ (x - x₀) ^ (n + 1) • taylorCoeffWithin f (n + 1) s x₀ =\n ((↑n !)⁻¹ * (↑n + 1)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀\n[PROOFSTEP]\ndsimp only [taylorCoeffWithin]\n[GOAL]\ncase e_a\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ (x - x₀) ^ (n + 1) • (↑(n + 1)!)⁻¹ • iteratedDerivWithin (n + 1) f s x₀ =\n ((↑n !)⁻¹ * (↑n + 1)⁻¹ * (x - x₀) ^ (n + 1)) • iteratedDerivWithin (n + 1) f s x₀\n[PROOFSTEP]\nrw [← mul_smul, mul_comm, Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one, mul_inv_rev]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\n⊢ taylorWithinEval f 0 s x₀ x = f x₀\n[PROOFSTEP]\ndsimp only [taylorWithinEval]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\n⊢ ↑(PolynomialModule.eval x) (taylorWithin f 0 s x₀) = f x₀\n[PROOFSTEP]\ndsimp only [taylorWithin]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\n⊢ ↑(PolynomialModule.eval x)\n (∑ k in Finset.range (0 + 1),\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ k) (taylorCoeffWithin f k s x₀))) =\n f x₀\n[PROOFSTEP]\ndsimp only [taylorCoeffWithin]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\n⊢ ↑(PolynomialModule.eval x)\n (∑ k in Finset.range (0 + 1),\n ↑(PolynomialModule.comp (Polynomial.X - ↑Polynomial.C x₀))\n (↑(PolynomialModule.single ℝ k) ((↑k !)⁻¹ • iteratedDerivWithin k f s x₀))) =\n f x₀\n[PROOFSTEP]\nsimp\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ : ℝ\n⊢ taylorWithinEval f n s x₀ x₀ = f x₀\n[PROOFSTEP]\ninduction' n with k hk\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ : ℝ\n⊢ taylorWithinEval f Nat.zero s x₀ x₀ = f x₀\n[PROOFSTEP]\nexact taylor_within_zero_eval _ _ _ _\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ : ℝ\nk : ℕ\nhk : taylorWithinEval f k s x₀ x₀ = f x₀\n⊢ taylorWithinEval f (Nat.succ k) s x₀ x₀ = f x₀\n[PROOFSTEP]\nsimp [hk]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nn : ℕ\ns : Set ℝ\nx₀ x : ℝ\n⊢ taylorWithinEval f n s x₀ x = ∑ k in Finset.range (n + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀\n[PROOFSTEP]\ninduction' n with k hk\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\n⊢ taylorWithinEval f Nat.zero s x₀ x =\n ∑ k in Finset.range (Nat.zero + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\nk : ℕ\nhk : taylorWithinEval f k s x₀ x = ∑ k in Finset.range (k + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀\n⊢ taylorWithinEval f (Nat.succ k) s x₀ x =\n ∑ k in Finset.range (Nat.succ k + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀\n[PROOFSTEP]\nrw [taylorWithinEval_succ, Finset.sum_range_succ, hk]\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\ns : Set ℝ\nx₀ x : ℝ\nk : ℕ\nhk : taylorWithinEval f k s x₀ x = ∑ k in Finset.range (k + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀\n⊢ ∑ k in Finset.range (k + 1), ((↑k !)⁻¹ * (x - x₀) ^ k) • iteratedDerivWithin k f s x₀ +\n (((↑k + 1) * ↑k !)⁻¹ * (x - x₀) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s x₀ =\n ∑ x_1 in Finset.range (k + 1), ((↑x_1 !)⁻¹ * (x - x₀) ^ x_1) • iteratedDerivWithin x_1 f s x₀ +\n ((↑(k + 1)!)⁻¹ * (x - x₀) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s x₀\n[PROOFSTEP]\nsimp\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\nhf : ContDiffOn ℝ (↑n) f s\n⊢ ContinuousOn (fun t => taylorWithinEval f n s t x) s\n[PROOFSTEP]\nsimp_rw [taylor_within_apply]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\nhf : ContDiffOn ℝ (↑n) f s\n⊢ ContinuousOn (fun t => ∑ k in Finset.range (n + 1), ((↑k !)⁻¹ * (x - t) ^ k) • iteratedDerivWithin k f s t) s\n[PROOFSTEP]\nrefine' continuousOn_finset_sum (Finset.range (n + 1)) fun i hi => _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\nhf : ContDiffOn ℝ (↑n) f s\ni : ℕ\nhi : i ∈ Finset.range (n + 1)\n⊢ ContinuousOn (fun t => ((↑i !)⁻¹ * (x - t) ^ i) • iteratedDerivWithin i f s t) s\n[PROOFSTEP]\nrefine' (continuousOn_const.mul ((continuousOn_const.sub continuousOn_id).pow _)).smul _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\nhf : ContDiffOn ℝ (↑n) f s\ni : ℕ\nhi : i ∈ Finset.range (n + 1)\n⊢ ContinuousOn (fun t => iteratedDerivWithin i f s t) s\n[PROOFSTEP]\nrw [contDiffOn_iff_continuousOn_differentiableOn_deriv hs] at hf \n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\nhf :\n (∀ (m : ℕ), ↑m ≤ ↑n → ContinuousOn (iteratedDerivWithin m f s) s) ∧\n ∀ (m : ℕ), ↑m < ↑n → DifferentiableOn ℝ (iteratedDerivWithin m f s) s\ni : ℕ\nhi : i ∈ Finset.range (n + 1)\n⊢ ContinuousOn (fun t => iteratedDerivWithin i f s t) s\n[PROOFSTEP]\ncases' hf with hf_left\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\ni : ℕ\nhi : i ∈ Finset.range (n + 1)\nhf_left : ∀ (m : ℕ), ↑m ≤ ↑n → ContinuousOn (iteratedDerivWithin m f s) s\nright✝ : ∀ (m : ℕ), ↑m < ↑n → DifferentiableOn ℝ (iteratedDerivWithin m f s) s\n⊢ ContinuousOn (fun t => iteratedDerivWithin i f s t) s\n[PROOFSTEP]\nspecialize hf_left i\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\ni : ℕ\nhi : i ∈ Finset.range (n + 1)\nright✝ : ∀ (m : ℕ), ↑m < ↑n → DifferentiableOn ℝ (iteratedDerivWithin m f s) s\nhf_left : ↑i ≤ ↑n → ContinuousOn (iteratedDerivWithin i f s) s\n⊢ ContinuousOn (fun t => iteratedDerivWithin i f s t) s\n[PROOFSTEP]\nsimp only [Finset.mem_range] at hi \n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\ni : ℕ\nright✝ : ∀ (m : ℕ), ↑m < ↑n → DifferentiableOn ℝ (iteratedDerivWithin m f s) s\nhf_left : ↑i ≤ ↑n → ContinuousOn (iteratedDerivWithin i f s) s\nhi : i < n + 1\n⊢ ContinuousOn (fun t => iteratedDerivWithin i f s t) s\n[PROOFSTEP]\nrefine' hf_left _\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx : ℝ\nn : ℕ\ns : Set ℝ\nhs : UniqueDiffOn ℝ s\ni : ℕ\nright✝ : ∀ (m : ℕ), ↑m < ↑n → DifferentiableOn ℝ (iteratedDerivWithin m f s) s\nhf_left : ↑i ≤ ↑n → ContinuousOn (iteratedDerivWithin i f s) s\nhi : i < n + 1\n⊢ ↑i ≤ ↑n\n[PROOFSTEP]\nsimp only [WithTop.coe_le_coe, Nat.cast_le, Nat.lt_succ_iff.mp hi]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nt x : ℝ\nn : ℕ\n⊢ HasDerivAt (fun y => (x - y) ^ (n + 1)) (-(↑n + 1) * (x - t) ^ n) t\n[PROOFSTEP]\nsimp_rw [sub_eq_neg_add]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nt x : ℝ\nn : ℕ\n⊢ HasDerivAt (fun y => (-y + x) ^ (n + 1)) (-(↑n + 1) * (-t + x) ^ n) t\n[PROOFSTEP]\nrw [← neg_one_mul, mul_comm (-1 : ℝ), mul_assoc, mul_comm (-1 : ℝ), ← mul_assoc]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nt x : ℝ\nn : ℕ\n⊢ HasDerivAt (fun y => (-y + x) ^ (n + 1)) ((↑n + 1) * (-t + x) ^ n * -1) t\n[PROOFSTEP]\nconvert HasDerivAt.pow (n + 1) ((hasDerivAt_id t).neg.add_const x)\n[GOAL]\ncase h.e'_7.h.e'_5.h.e'_5\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nt x : ℝ\nn : ℕ\n⊢ ↑n + 1 = ↑(n + 1)\n[PROOFSTEP]\nsimp only [Nat.cast_add, Nat.cast_one]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : DifferentiableWithinAt ℝ (iteratedDerivWithin (k + 1) f s) s y\n⊢ HasDerivWithinAt (fun z => (((↑k + 1) * ↑k !)⁻¹ * (x - z) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s z)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n t y\n[PROOFSTEP]\nreplace hf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y :=\n by\n convert (hf.mono_of_mem hs).hasDerivWithinAt using 1\n rw [iteratedDerivWithin_succ (ht.mono_nhds (nhdsWithin_le_iff.mpr hs))]\n exact (derivWithin_of_mem hs ht hf).symm\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : DifferentiableWithinAt ℝ (iteratedDerivWithin (k + 1) f s) s y\n⊢ HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n[PROOFSTEP]\nconvert (hf.mono_of_mem hs).hasDerivWithinAt using 1\n[GOAL]\ncase h.e'_7\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : DifferentiableWithinAt ℝ (iteratedDerivWithin (k + 1) f s) s y\n⊢ iteratedDerivWithin (k + 2) f s y = derivWithin (iteratedDerivWithin (k + 1) f s) t y\n[PROOFSTEP]\nrw [iteratedDerivWithin_succ (ht.mono_nhds (nhdsWithin_le_iff.mpr hs))]\n[GOAL]\ncase h.e'_7\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : DifferentiableWithinAt ℝ (iteratedDerivWithin (k + 1) f s) s y\n⊢ derivWithin (iteratedDerivWithin (k + 1) f s) s y = derivWithin (iteratedDerivWithin (k + 1) f s) t y\n[PROOFSTEP]\nexact (derivWithin_of_mem hs ht hf).symm\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ HasDerivWithinAt (fun z => (((↑k + 1) * ↑k !)⁻¹ * (x - z) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s z)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n t y\n[PROOFSTEP]\nhave : HasDerivWithinAt (fun t => ((k + 1 : ℝ) * k !)⁻¹ * (x - t) ^ (k + 1)) (-((k ! : ℝ)⁻¹ * (x - y) ^ k)) t y := by\n -- Commuting the factors:\n have : -((k ! : ℝ)⁻¹ * (x - y) ^ k) = ((k + 1 : ℝ) * k !)⁻¹ * (-(k + 1) * (x - y) ^ k) :=\n by\n field_simp [k.factorial_ne_zero]\n -- Porting note: was `ring_nf`\n rw [mul_div_mul_right, ← neg_add_rev, neg_mul, neg_div, mul_div_cancel_left]\n · exact k.cast_add_one_ne_zero\n · simp [k.factorial_ne_zero]\n rw [this]\n exact (monomial_has_deriv_aux y x _).hasDerivWithinAt.const_mul _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (-((↑k !)⁻¹ * (x - y) ^ k)) t y\n[PROOFSTEP]\nhave : -((k ! : ℝ)⁻¹ * (x - y) ^ k) = ((k + 1 : ℝ) * k !)⁻¹ * (-(k + 1) * (x - y) ^ k) :=\n by\n field_simp [k.factorial_ne_zero]\n -- Porting note: was `ring_nf`\n rw [mul_div_mul_right, ← neg_add_rev, neg_mul, neg_div, mul_div_cancel_left]\n · exact k.cast_add_one_ne_zero\n · simp [k.factorial_ne_zero]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ -((↑k !)⁻¹ * (x - y) ^ k) = ((↑k + 1) * ↑k !)⁻¹ * (-(↑k + 1) * (x - y) ^ k)\n[PROOFSTEP]\nfield_simp [k.factorial_ne_zero]\n -- Porting note: was `ring_nf`\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ -(x - y) ^ k = (-1 + -↑k) * (x - y) ^ k * ↑k ! / ((↑k + 1) * ↑k !)\n[PROOFSTEP]\nrw [mul_div_mul_right, ← neg_add_rev, neg_mul, neg_div, mul_div_cancel_left]\n[GOAL]\ncase ha\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ ↑k + 1 ≠ 0\n[PROOFSTEP]\nexact k.cast_add_one_ne_zero\n[GOAL]\ncase hc\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\n⊢ ↑k ! ≠ 0\n[PROOFSTEP]\nsimp [k.factorial_ne_zero]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\nthis : -((↑k !)⁻¹ * (x - y) ^ k) = ((↑k + 1) * ↑k !)⁻¹ * (-(↑k + 1) * (x - y) ^ k)\n⊢ HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (-((↑k !)⁻¹ * (x - y) ^ k)) t y\n[PROOFSTEP]\nrw [this]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\nthis : -((↑k !)⁻¹ * (x - y) ^ k) = ((↑k + 1) * ↑k !)⁻¹ * (-(↑k + 1) * (x - y) ^ k)\n⊢ HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (((↑k + 1) * ↑k !)⁻¹ * (-(↑k + 1) * (x - y) ^ k))\n t y\n[PROOFSTEP]\nexact (monomial_has_deriv_aux y x _).hasDerivWithinAt.const_mul _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\nthis : HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (-((↑k !)⁻¹ * (x - y) ^ k)) t y\n⊢ HasDerivWithinAt (fun z => (((↑k + 1) * ↑k !)⁻¹ * (x - z) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s z)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n t y\n[PROOFSTEP]\nconvert this.smul hf using 1\n[GOAL]\ncase h.e'_7\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\nthis : HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (-((↑k !)⁻¹ * (x - y) ^ k)) t y\n⊢ (((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y =\n (((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y +\n -((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y\n[PROOFSTEP]\nfield_simp [Nat.cast_add_one_ne_zero k, Nat.factorial_ne_zero k]\n[GOAL]\ncase h.e'_7\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nk : ℕ\ns t : Set ℝ\nht : UniqueDiffWithinAt ℝ t y\nhs : s ∈ 𝓝[t] y\nhf : HasDerivWithinAt (iteratedDerivWithin (k + 1) f s) (iteratedDerivWithin (k + 2) f s y) t y\nthis : HasDerivWithinAt (fun t => ((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) (-((↑k !)⁻¹ * (x - y) ^ k)) t y\n⊢ ((x - y) ^ (k + 1) / ((↑k + 1) * ↑k !)) • iteratedDerivWithin (k + 2) f s y -\n ((x - y) ^ k / ↑k !) • iteratedDerivWithin (k + 1) f s y =\n ((x - y) ^ (k + 1) / ((↑k + 1) * ↑k !)) • iteratedDerivWithin (k + 2) f s y +\n (-(x - y) ^ k / ↑k !) • iteratedDerivWithin (k + 1) f s y\n[PROOFSTEP]\nrw [neg_div, neg_smul, sub_eq_add_neg]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf : ContDiffOn ℝ (↑n) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\n⊢ HasDerivWithinAt (fun t => taylorWithinEval f n s t x) (((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f s y)\n s' y\n[PROOFSTEP]\ninduction' n with k hk\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nhf : ContDiffOn ℝ (↑Nat.zero) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin Nat.zero f s) s y\n⊢ HasDerivWithinAt (fun t => taylorWithinEval f Nat.zero s t x)\n (((↑Nat.zero !)⁻¹ * (x - y) ^ Nat.zero) • iteratedDerivWithin (Nat.zero + 1) f s y) s' y\n[PROOFSTEP]\nsimp only [taylor_within_zero_eval, Nat.factorial_zero, Nat.cast_one, inv_one, pow_zero, mul_one, zero_add, one_smul]\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nhf : ContDiffOn ℝ (↑Nat.zero) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin Nat.zero f s) s y\n⊢ HasDerivWithinAt (fun t => f t) (iteratedDerivWithin (Nat.zero + 1) f s y) s' y\n[PROOFSTEP]\nsimp only [iteratedDerivWithin_zero] at hf' \n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nhf : ContDiffOn ℝ (↑Nat.zero) f s\nhf' : DifferentiableWithinAt ℝ f s y\n⊢ HasDerivWithinAt (fun t => f t) (iteratedDerivWithin (Nat.zero + 1) f s y) s' y\n[PROOFSTEP]\nrw [iteratedDerivWithin_one (hs_unique _ (h hy))]\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nhf : ContDiffOn ℝ (↑Nat.zero) f s\nhf' : DifferentiableWithinAt ℝ f s y\n⊢ HasDerivWithinAt (fun t => f t) (derivWithin f s y) s' y\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase zero\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nhf : ContDiffOn ℝ (↑Nat.zero) f s\nhf' : DifferentiableWithinAt ℝ f s y\n⊢ HasDerivWithinAt (fun t => f t) (derivWithin f s y) s' y\n[PROOFSTEP]\nexact hf'.hasDerivWithinAt.mono h\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\n⊢ HasDerivWithinAt (fun t => taylorWithinEval f (Nat.succ k) s t x)\n (((↑(Nat.succ k)!)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ k + 1) f s y) s' y\n[PROOFSTEP]\nsimp_rw [Nat.add_succ, taylorWithinEval_succ]\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\n⊢ HasDerivWithinAt\n (fun t =>\n taylorWithinEval f k s t x + (((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s t)\n (((↑(Nat.succ k)!)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ (Nat.succ k + 0)) f s y) s' y\n[PROOFSTEP]\nsimp only [add_zero, Nat.factorial_succ, Nat.cast_mul, Nat.cast_add, Nat.cast_one]\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\n⊢ HasDerivWithinAt\n (fun t =>\n taylorWithinEval f k s t x + (((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s t)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ (Nat.succ k)) f s y) s' y\n[PROOFSTEP]\nhave hdiff : DifferentiableOn ℝ (iteratedDerivWithin k f s) s' :=\n by\n have coe_lt_succ : (k : WithTop ℕ) < k.succ := Nat.cast_lt.2 k.lt_succ_self\n refine' DifferentiableOn.mono _ h\n exact hf.differentiableOn_iteratedDerivWithin coe_lt_succ hs_unique\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\n⊢ DifferentiableOn ℝ (iteratedDerivWithin k f s) s'\n[PROOFSTEP]\nhave coe_lt_succ : (k : WithTop ℕ) < k.succ := Nat.cast_lt.2 k.lt_succ_self\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\ncoe_lt_succ : ↑k < ↑(Nat.succ k)\n⊢ DifferentiableOn ℝ (iteratedDerivWithin k f s) s'\n[PROOFSTEP]\nrefine' DifferentiableOn.mono _ h\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\ncoe_lt_succ : ↑k < ↑(Nat.succ k)\n⊢ DifferentiableOn ℝ (iteratedDerivWithin k f s) s\n[PROOFSTEP]\nexact hf.differentiableOn_iteratedDerivWithin coe_lt_succ hs_unique\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhk :\n ContDiffOn ℝ (↑k) f s →\n DifferentiableWithinAt ℝ (iteratedDerivWithin k f s) s y →\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x)\n (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) s' y\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\nhdiff : DifferentiableOn ℝ (iteratedDerivWithin k f s) s'\n⊢ HasDerivWithinAt\n (fun t =>\n taylorWithinEval f k s t x + (((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s t)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ (Nat.succ k)) f s y) s' y\n[PROOFSTEP]\nspecialize hk hf.of_succ ((hdiff y hy).mono_of_mem hs')\n[GOAL]\ncase succ\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\nhdiff : DifferentiableOn ℝ (iteratedDerivWithin k f s) s'\nhk :\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x) (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n s' y\n⊢ HasDerivWithinAt\n (fun t =>\n taylorWithinEval f k s t x + (((↑k + 1) * ↑k !)⁻¹ * (x - t) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s t)\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ (Nat.succ k)) f s y) s' y\n[PROOFSTEP]\nconvert hk.add (hasDerivWithinAt_taylor_coeff_within hs'_unique (nhdsWithin_mono _ h self_mem_nhdsWithin) hf') using 1\n[GOAL]\ncase h.e'_7\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\nx y : ℝ\nn : ℕ\ns s' : Set ℝ\nhs'_unique : UniqueDiffWithinAt ℝ s' y\nhs_unique : UniqueDiffOn ℝ s\nhs' : s' ∈ 𝓝[s] y\nhy : y ∈ s'\nh : s' ⊆ s\nhf✝ : ContDiffOn ℝ (↑n) f s\nhf'✝ : DifferentiableWithinAt ℝ (iteratedDerivWithin n f s) s y\nk : ℕ\nhf : ContDiffOn ℝ (↑(Nat.succ k)) f s\nhf' : DifferentiableWithinAt ℝ (iteratedDerivWithin (Nat.succ k) f s) s y\nhdiff : DifferentiableOn ℝ (iteratedDerivWithin k f s) s'\nhk :\n HasDerivWithinAt (fun t => taylorWithinEval f k s t x) (((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n s' y\n⊢ (((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ Nat.succ k) • iteratedDerivWithin (Nat.succ (Nat.succ k)) f s y =\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y +\n ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -\n ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)\n[PROOFSTEP]\nexact (add_sub_cancel'_right _ _).symm\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - x') ^ n / ↑n ! * (g x - g x₀) / g' x') • iteratedDerivWithin (n + 1) f (Icc x₀ x) x'\n[PROOFSTEP]\nrcases exists_ratio_hasDerivAt_eq_ratio_slope (fun t => taylorWithinEval f n (Icc x₀ x) t x)\n (fun t => ((n ! : ℝ)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) t) hx\n (continuousOn_taylorWithinEval (uniqueDiffOn_Icc hx) hf)\n (fun _ hy => taylorWithinEval_hasDerivAt_Ioo x hx hy hf hf') g g' gcont gdiff with\n ⟨y, hy, h⟩\n[GOAL]\ncase intro.intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n (g x - g x₀) * ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n (taylorWithinEval f n (Icc x₀ x) x x - taylorWithinEval f n (Icc x₀ x) x₀ x) * g' y\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - x') ^ n / ↑n ! * (g x - g x₀) / g' x') • iteratedDerivWithin (n + 1) f (Icc x₀ x) x'\n[PROOFSTEP]\nuse y, hy\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n (g x - g x₀) * ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n (taylorWithinEval f n (Icc x₀ x) x x - taylorWithinEval f n (Icc x₀ x) x₀ x) * g' y\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (g x - g x₀) / g' y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n[PROOFSTEP]\nsimp only [taylorWithinEval_self] at h \n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n (g x - g x₀) * ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n (f x - taylorWithinEval f n (Icc x₀ x) x₀ x) * g' y\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (g x - g x₀) / g' y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n[PROOFSTEP]\nrw [mul_comm, ← div_left_inj' (g'_ne y hy), mul_div_cancel _ (g'_ne y hy)] at h \n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (g x - g x₀) / g' y =\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (g x - g x₀) / g' y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n[PROOFSTEP]\nrw [← h]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (g x - g x₀) / g' y =\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x\n⊢ ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (g x - g x₀) / g' y =\n ((x - y) ^ n / ↑n ! * (g x - g x₀) / g' y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n[PROOFSTEP]\nfield_simp [g'_ne y hy, n.factorial_ne_zero]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf g g' : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn g (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt g (g' x_1) x_1\ng'_ne : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → g' x_1 ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n ((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (g x - g x₀) / g' y =\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x\n⊢ (x - y) ^ n * iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (g x - g x₀) =\n (x - y) ^ n * (g x - g x₀) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n[PROOFSTEP]\nring\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nhave gcont : ContinuousOn (fun t : ℝ => (x - t) ^ (n + 1)) (Icc x₀ x) :=\n by\n refine' Continuous.continuousOn _\n exact\n (continuous_const.sub continuous_id').pow\n _\n -- Porting note: was `continuity`\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\n⊢ ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\n[PROOFSTEP]\nrefine' Continuous.continuousOn _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\n⊢ Continuous fun t => (x - t) ^ (n + 1)\n[PROOFSTEP]\nexact\n (continuous_const.sub continuous_id').pow\n _\n -- Porting note: was `continuity`\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nhave xy_ne : ∀ y : ℝ, y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0 :=\n by\n intro y hy\n refine' pow_ne_zero _ _\n rw [mem_Ioo] at hy \n rw [sub_ne_zero]\n exact hy.2.ne.symm\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\n⊢ ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\n[PROOFSTEP]\nintro y hy\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\ny : ℝ\nhy : y ∈ Ioo x₀ x\n⊢ (x - y) ^ n ≠ 0\n[PROOFSTEP]\nrefine' pow_ne_zero _ _\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\ny : ℝ\nhy : y ∈ Ioo x₀ x\n⊢ x - y ≠ 0\n[PROOFSTEP]\nrw [mem_Ioo] at hy \n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\ny : ℝ\nhy : x₀ < y ∧ y < x\n⊢ x - y ≠ 0\n[PROOFSTEP]\nrw [sub_ne_zero]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\ny : ℝ\nhy : x₀ < y ∧ y < x\n⊢ x ≠ y\n[PROOFSTEP]\nexact hy.2.ne.symm\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nhave hg' : ∀ y : ℝ, y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0 := fun y hy =>\n mul_ne_zero (neg_ne_zero.mpr (Nat.cast_add_one_ne_zero n))\n (xy_ne y hy)\n -- We apply the general theorem with g(t) = (x - t)^(n+1)\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nrcases taylor_mean_remainder hx hf hf' gcont (fun y _ => monomial_has_deriv_aux y x _) hg' with ⟨y, hy, h⟩\n[GOAL]\ncase intro.intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nuse y, hy\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * ((x - x) ^ (n + 1) - (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nsimp only [sub_self, zero_pow', Ne.def, Nat.succ_ne_zero, not_false_iff, zero_sub, mul_neg] at h \n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nrw [h, neg_div, ← div_neg, neg_mul, neg_neg]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ ((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1) / ((↑n + 1) * (x - y) ^ n)) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ↑(n + 1)!\n[PROOFSTEP]\nfield_simp\n -- Porting note: was `ring`\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * ((↑n + 1) * (x - y) ^ n)) =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)\n[PROOFSTEP]\nconv_lhs =>\n arg 2\n rw [← mul_assoc, mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * ((↑n + 1) * (x - y) ^ n))\n[PROOFSTEP]\n arg 2\n rw [← mul_assoc, mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * ((↑n + 1) * (x - y) ^ n))\n[PROOFSTEP]\n arg 2\n rw [← mul_assoc, mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * ((↑n + 1) * (x - y) ^ n))\n[PROOFSTEP]\narg 2\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| ↑n ! * ((↑n + 1) * (x - y) ^ n)\n[PROOFSTEP]\nrw [← mul_assoc, mul_comm]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ (x - y) ^ n * (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / ((x - y) ^ n * (↑n ! * (↑n + 1))) =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)\n[PROOFSTEP]\nrw [mul_assoc, mul_div_mul_left _ _ (xy_ne y hy)]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * (↑n + 1)) =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)\n[PROOFSTEP]\nconv_lhs =>\n arg 2\n rw [mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * (↑n + 1))\n[PROOFSTEP]\n arg 2\n rw [mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * (↑n + 1))\n[PROOFSTEP]\n arg 2\n rw [mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / (↑n ! * (↑n + 1))\n[PROOFSTEP]\narg 2\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n| ↑n ! * (↑n + 1)\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn (fun t => (x - t) ^ (n + 1)) (Icc x₀ x)\nxy_ne : ∀ (y : ℝ), y ∈ Ioo x₀ x → (x - y) ^ n ≠ 0\nhg' : ∀ (y : ℝ), y ∈ Ioo x₀ x → -(↑n + 1) * (x - y) ^ n ≠ 0\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n (-((x - y) ^ n / ↑n ! * (x - x₀) ^ (n + 1)) / (-(↑n + 1) * (x - y) ^ n)) •\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ (x - x₀) ^ (n + 1) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y / ((↑n + 1) * ↑n !) =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - x₀) ^ (n + 1) / ((↑n + 1) * ↑n !)\n[PROOFSTEP]\nnth_rw 1 [mul_comm]\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x') ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nhave gcont : ContinuousOn id (Icc x₀ x) := Continuous.continuousOn (by continuity)\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\n⊢ Continuous id\n[PROOFSTEP]\ncontinuity\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x') ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nhave gdiff : ∀ x_1 : ℝ, x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun _ : ℝ => (1 : ℝ)) x_1) x_1 := fun _ _ =>\n hasDerivAt_id\n _\n -- We apply the general theorem with g = id\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x') ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nrcases taylor_mean_remainder hx hf hf' gcont gdiff fun _ _ => by simp with ⟨y, hy, h⟩\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\nx✝¹ : ℝ\nx✝ : x✝¹ ∈ Ioo x₀ x\n⊢ (fun x => 1) x✝¹ ≠ 0\n[PROOFSTEP]\nsimp\n[GOAL]\ncase intro.intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (id x - id x₀) / (fun x => 1) y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ ∃ x' x_1,\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) x' * (x - x') ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nuse y, hy\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (id x - id x₀) / (fun x => 1) y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - y) ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nrw [h]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (id x - id x₀) / (fun x => 1) y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ ((x - y) ^ n / ↑n ! * (id x - id x₀) / (fun x => 1) y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - y) ^ n / ↑n ! * (x - x₀)\n[PROOFSTEP]\nfield_simp [n.factorial_ne_zero]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → ℝ\nx x₀ : ℝ\nn : ℕ\nhx : x₀ < x\nhf : ContDiffOn ℝ (↑n) f (Icc x₀ x)\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc x₀ x)) (Ioo x₀ x)\ngcont : ContinuousOn id (Icc x₀ x)\ngdiff : ∀ (x_1 : ℝ), x_1 ∈ Ioo x₀ x → HasDerivAt id ((fun x => 1) x_1) x_1\ny : ℝ\nhy : y ∈ Ioo x₀ x\nh :\n f x - taylorWithinEval f n (Icc x₀ x) x₀ x =\n ((x - y) ^ n / ↑n ! * (id x - id x₀) / (fun x => 1) y) • iteratedDerivWithin (n + 1) f (Icc x₀ x) y\n⊢ (x - y) ^ n * (x - x₀) * iteratedDerivWithin (n + 1) f (Icc x₀ x) y =\n iteratedDerivWithin (n + 1) f (Icc x₀ x) y * (x - y) ^ n * (x - x₀)\n[PROOFSTEP]\nring\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nrcases eq_or_lt_of_le hab with (rfl | h)\n[GOAL]\ncase inl\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na C x : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\nhx : x ∈ Icc a a\nhC : ∀ (y : ℝ), y ∈ Icc a a → ‖iteratedDerivWithin (n + 1) f (Icc a a) y‖ ≤ C\n⊢ ‖f x - taylorWithinEval f n (Icc a a) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nrw [Icc_self, mem_singleton_iff] at hx \n[GOAL]\ncase inl\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na C x : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\nhx : x = a\nhC : ∀ (y : ℝ), y ∈ Icc a a → ‖iteratedDerivWithin (n + 1) f (Icc a a) y‖ ≤ C\n⊢ ‖f x - taylorWithinEval f n (Icc a a) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nsimp [hx]\n -- The nth iterated derivative is differentiable\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nhave hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b) :=\n hf.differentiableOn_iteratedDerivWithin (WithTop.coe_lt_coe.mpr n.lt_succ_self)\n (uniqueDiffOn_Icc h)\n -- We can uniformly bound the derivative of the Taylor polynomial\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nhave h' :\n ∀ (y : ℝ) (_ : y ∈ Ico a x),\n ‖((n ! : ℝ)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (n ! : ℝ)⁻¹ * |x - a| ^ n * C :=\n by\n rintro y ⟨hay, hyx⟩\n rw [norm_smul, Real.norm_eq_abs]\n -- Estimate the iterated derivative by `C`\n refine'\n mul_le_mul _ (hC y ⟨hay, hyx.le.trans hx.2⟩) (by positivity)\n (by positivity)\n -- The rest is a trivial calculation\n rw [abs_mul, abs_pow, abs_inv, Nat.abs_cast]\n -- Porting note: was `mono* with 0 ≤ (n ! : ℝ)⁻¹; any_goals positivity; linarith [hx.1, hyx]`\n gcongr\n rw [abs_of_nonneg, abs_of_nonneg] <;>\n linarith\n -- Apply the mean value theorem for vector valued functions:\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\n⊢ ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\n[PROOFSTEP]\nrintro y ⟨hay, hyx⟩\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\n[PROOFSTEP]\nrw [norm_smul, Real.norm_eq_abs]\n -- Estimate the iterated derivative by `C`\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ |(↑n !)⁻¹ * (x - y) ^ n| * ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\n[PROOFSTEP]\nrefine'\n mul_le_mul _ (hC y ⟨hay, hyx.le.trans hx.2⟩) (by positivity)\n (by positivity)\n -- The rest is a trivial calculation\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ 0 ≤ ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\n[PROOFSTEP]\npositivity\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ 0 ≤ (↑n !)⁻¹ * |x - a| ^ n\n[PROOFSTEP]\npositivity\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ |(↑n !)⁻¹ * (x - y) ^ n| ≤ (↑n !)⁻¹ * |x - a| ^ n\n[PROOFSTEP]\nrw [abs_mul, abs_pow, abs_inv, Nat.abs_cast]\n -- Porting note: was `mono* with 0 ≤ (n ! : ℝ)⁻¹; any_goals positivity; linarith [hx.1, hyx]`\n[GOAL]\ncase intro\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ (↑n !)⁻¹ * |x - y| ^ n ≤ (↑n !)⁻¹ * |x - a| ^ n\n[PROOFSTEP]\ngcongr\n[GOAL]\ncase intro.h.hab\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ |x - y| ≤ |x - a|\n[PROOFSTEP]\nrw [abs_of_nonneg, abs_of_nonneg]\n[GOAL]\ncase intro.h.hab\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ x - y ≤ x - a\n[PROOFSTEP]\nlinarith\n -- Apply the mean value theorem for vector valued functions:\n[GOAL]\ncase intro.h.hab\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ 0 ≤ x - a\n[PROOFSTEP]\nlinarith\n -- Apply the mean value theorem for vector valued functions:\n[GOAL]\ncase intro.h.hab\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\ny : ℝ\nhay : a ≤ y\nhyx : y < x\n⊢ 0 ≤ x - y\n[PROOFSTEP]\nlinarith\n -- Apply the mean value theorem for vector valued functions:\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nhave A :\n ∀ t ∈ Icc a x,\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t :=\n by\n intro t ht\n have I : Icc a x ⊆ Icc a b := Icc_subset_Icc_right hx.2\n exact (has_deriv_within_taylorWithinEval_at_Icc x h (I ht) hf.of_succ hf').mono I\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\n⊢ ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\n[PROOFSTEP]\nintro t ht\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nt : ℝ\nht : t ∈ Icc a x\n⊢ HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\n[PROOFSTEP]\nhave I : Icc a x ⊆ Icc a b := Icc_subset_Icc_right hx.2\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nt : ℝ\nht : t ∈ Icc a x\nI : Icc a x ⊆ Icc a b\n⊢ HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\n[PROOFSTEP]\nexact (has_deriv_within_taylorWithinEval_at_Icc x h (I ht) hf.of_succ hf').mono I\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nA :\n ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nhave := norm_image_sub_le_of_norm_deriv_le_segment' A h' x (right_mem_Icc.2 hx.1)\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nA :\n ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\nthis : ‖taylorWithinEval f n (Icc a b) x x - taylorWithinEval f n (Icc a b) a x‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C * (x - a)\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nsimp only [taylorWithinEval_self] at this \n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nA :\n ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\nthis : ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C * (x - a)\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nrefine'\n this.trans_eq\n _\n -- The rest is a trivial calculation\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nA :\n ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\nthis : ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C * (x - a)\n⊢ (↑n !)⁻¹ * |x - a| ^ n * C * (x - a) = C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nrw [abs_of_nonneg (sub_nonneg.mpr hx.1)]\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b C x : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nhx : x ∈ Icc a b\nhC : ∀ (y : ℝ), y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ C\nh : a < b\nhf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)\nh' :\n ∀ (y : ℝ),\n y ∈ Ico a x → ‖((↑n !)⁻¹ * (x - y) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C\nA :\n ∀ (t : ℝ),\n t ∈ Icc a x →\n HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)\n (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a x) t\nthis : ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ (↑n !)⁻¹ * |x - a| ^ n * C * (x - a)\n⊢ (↑n !)⁻¹ * (x - a) ^ n * C * (x - a) = C * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nring\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\n⊢ ∃ C, ∀ (x : ℝ), x ∈ Icc a b → ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1)\n[PROOFSTEP]\nrcases eq_or_lt_of_le hab with (rfl | h)\n[GOAL]\ncase inl\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\n⊢ ∃ C, ∀ (x : ℝ), x ∈ Icc a a → ‖f x - taylorWithinEval f n (Icc a a) a x‖ ≤ C * (x - a) ^ (n + 1)\n[PROOFSTEP]\nrefine' ⟨0, fun x hx => _⟩\n[GOAL]\ncase inl\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\nx : ℝ\nhx : x ∈ Icc a a\n⊢ ‖f x - taylorWithinEval f n (Icc a a) a x‖ ≤ 0 * (x - a) ^ (n + 1)\n[PROOFSTEP]\nhave : x = a := by simpa [← le_antisymm_iff] using hx\n[GOAL]\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\nx : ℝ\nhx : x ∈ Icc a a\n⊢ x = a\n[PROOFSTEP]\nsimpa [← le_antisymm_iff] using hx\n[GOAL]\ncase inl\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na : ℝ\nn : ℕ\nhab : a ≤ a\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a a)\nx : ℝ\nhx : x ∈ Icc a a\nthis : x = a\n⊢ ‖f x - taylorWithinEval f n (Icc a a) a x‖ ≤ 0 * (x - a) ^ (n + 1)\n[PROOFSTEP]\nsimp [← this]\n -- We estimate by the supremum of the norm of the iterated derivative\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\n⊢ ∃ C, ∀ (x : ℝ), x ∈ Icc a b → ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1)\n[PROOFSTEP]\nlet g : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\n[GOAL]\ncase inr\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\ng : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\n⊢ ∃ C, ∀ (x : ℝ), x ∈ Icc a b → ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ C * (x - a) ^ (n + 1)\n[PROOFSTEP]\nuse SupSet.sSup (g '' Icc a b) / (n !)\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\ng : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\n⊢ ∀ (x : ℝ), x ∈ Icc a b → ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ sSup (g '' Icc a b) / ↑n ! * (x - a) ^ (n + 1)\n[PROOFSTEP]\nintro x hx\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\ng : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\nx : ℝ\nhx : x ∈ Icc a b\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ sSup (g '' Icc a b) / ↑n ! * (x - a) ^ (n + 1)\n[PROOFSTEP]\nrw [div_mul_eq_mul_div₀]\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\ng : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\nx : ℝ\nhx : x ∈ Icc a b\n⊢ ‖f x - taylorWithinEval f n (Icc a b) a x‖ ≤ sSup (g '' Icc a b) * (x - a) ^ (n + 1) / ↑n !\n[PROOFSTEP]\nrefine' taylor_mean_remainder_bound hab hf hx fun y => _\n[GOAL]\ncase h\n𝕜 : Type u_1\nE : Type u_2\nF : Type u_3\ninst✝¹ : NormedAddCommGroup E\ninst✝ : NormedSpace ℝ E\nf : ℝ → E\na b : ℝ\nn : ℕ\nhab : a ≤ b\nhf : ContDiffOn ℝ (↑n + 1) f (Icc a b)\nh : a < b\ng : ℝ → ℝ := fun y => ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖\nx : ℝ\nhx : x ∈ Icc a b\ny : ℝ\n⊢ y ∈ Icc a b → ‖iteratedDerivWithin (n + 1) f (Icc a b) y‖ ≤ sSup (g '' Icc a b)\n[PROOFSTEP]\nexact (hf.continuousOn_iteratedDerivWithin rfl.le <| uniqueDiffOn_Icc h).norm.le_sSup_image_Icc\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Calculus.Taylor", "llama_tokens": 43769, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8962513675912912, "lm_q2_score": 0.7431680086124812, "lm_q1q2_score": 0.6660653440690327}} {"text": "[GOAL]\nn : ℕ\nh : n ≠ 0\nd m : ℕ\n⊢ ((fun a => a + d) ∘ fun x => n • id x) m ≡ d [MOD n]\n[PROOFSTEP]\nsimp [Nat.modEq_iff_dvd, ← sub_sub]\n[GOAL]\nd n : ℕ\nh : d < n\n⊢ ∃ᶠ (m : ℕ) in atTop, m % n = d\n[PROOFSTEP]\nsimpa only [Nat.ModEq, mod_eq_of_lt h] using frequently_modEq h.ne_bot d\n[GOAL]\n⊢ ∃ᶠ (m : ℕ) in atTop, Even m\n[PROOFSTEP]\nsimpa only [even_iff] using frequently_mod_eq zero_lt_two\n[GOAL]\n⊢ ∃ᶠ (m : ℕ) in atTop, Odd m\n[PROOFSTEP]\nsimpa only [odd_iff] using frequently_mod_eq one_lt_two\n", "meta": {"mathlib_filename": "Mathlib.Order.Filter.ModEq", "llama_tokens": 260, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9149009596336303, "lm_q2_score": 0.7279754430043072, "lm_q1q2_score": 0.6660254313943578}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : DivisionRing α\nsrc✝² : DivisionSemiring αᵐᵒᵖ := divisionSemiring α\nsrc✝¹ : Ring αᵐᵒᵖ := ring α\nsrc✝ : RatCast αᵐᵒᵖ := ratCast α\na : ℤ\nb : ℕ\nhb : b ≠ 0\nh : Nat.coprime (Int.natAbs a) b\n⊢ unop ↑(Rat.mk' a b) = unop (↑a * (↑b)⁻¹)\n[PROOFSTEP]\nrw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast, Int.commute_cast, div_eq_mul_inv]\n[GOAL]\nα : Type ?u.3697\ninst✝ : DivisionRing α\nsrc✝² : Ring αᵃᵒᵖ := ring α\nsrc✝¹ : GroupWithZero αᵃᵒᵖ := groupWithZero α\nsrc✝ : RatCast αᵃᵒᵖ := ratCast α\na : ℤ\nb : ℕ\nhb : b ≠ 0\nh : Nat.coprime (Int.natAbs a) b\n⊢ unop ↑(Rat.mk' a b) = unop (↑a * (↑b)⁻¹)\n[PROOFSTEP]\nrw [unop_ratCast, Rat.cast_def, unop_mul, unop_inv, unop_natCast, unop_intCast, div_eq_mul_inv]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Field.Opposite", "llama_tokens": 425, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.880797068590724, "lm_q2_score": 0.7549149758396752, "lm_q1q2_score": 0.6649268977548232}} {"text": "[GOAL]\nR : Type u_1\nV : Type u_2\nP : Type u_3\ninst✝⁴ : DivisionRing R\ninst✝³ : CharZero R\ninst✝² : AddCommGroup V\ninst✝¹ : Module R V\ninst✝ : AddTorsor V P\na b : P\n⊢ ↑(lineMap a b) (1 / 2) = midpoint R a b\n[PROOFSTEP]\nrw [one_div, lineMap_inv_two]\n[GOAL]\nk : Type u_1\nV : Type u_2\nP : Type u_3\ninst✝⁴ : Field k\ninst✝³ : CharZero k\ninst✝² : AddCommGroup V\ninst✝¹ : Module k V\ninst✝ : AddTorsor V P\na b : P\n⊢ ↑(homothety a (1 / 2)) b = midpoint k a b\n[PROOFSTEP]\nrw [one_div, homothety_inv_two]\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.AffineSpace.MidpointZero", "llama_tokens": 255, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.8840392817460332, "lm_q2_score": 0.7520125737597972, "lm_q1q2_score": 0.664808655570597}} {"text": "[GOAL]\nn k : ℕ\n⊢ List.toFinset (factors (n ^ (k + 1))) = List.toFinset (factors n)\n[PROOFSTEP]\nrcases eq_or_ne n 0 with (rfl | hn)\n[GOAL]\ncase inl\nk : ℕ\n⊢ List.toFinset (factors (0 ^ (k + 1))) = List.toFinset (factors 0)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nn k : ℕ\nhn : n ≠ 0\n⊢ List.toFinset (factors (n ^ (k + 1))) = List.toFinset (factors n)\n[PROOFSTEP]\ninduction' k with k ih\n[GOAL]\ncase inr.zero\nn : ℕ\nhn : n ≠ 0\n⊢ List.toFinset (factors (n ^ (zero + 1))) = List.toFinset (factors n)\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr.succ\nn : ℕ\nhn : n ≠ 0\nk : ℕ\nih : List.toFinset (factors (n ^ (k + 1))) = List.toFinset (factors n)\n⊢ List.toFinset (factors (n ^ (succ k + 1))) = List.toFinset (factors n)\n[PROOFSTEP]\nrw [pow_succ', factors_mul_toFinset hn (pow_ne_zero _ hn), ih, Finset.union_idempotent]\n[GOAL]\nn k : ℕ\nhk : k ≠ 0\n⊢ List.toFinset (factors (n ^ k)) = List.toFinset (factors n)\n[PROOFSTEP]\ncases k\n[GOAL]\ncase zero\nn : ℕ\nhk : zero ≠ 0\n⊢ List.toFinset (factors (n ^ zero)) = List.toFinset (factors n)\n[PROOFSTEP]\nsimp at hk \n[GOAL]\ncase succ\nn n✝ : ℕ\nhk : succ n✝ ≠ 0\n⊢ List.toFinset (factors (n ^ succ n✝)) = List.toFinset (factors n)\n[PROOFSTEP]\nrw [pow_succ_factors_toFinset]\n[GOAL]\np k : ℕ\nhk : k ≠ 0\nhp : Prime p\n⊢ List.toFinset (factors (p ^ k)) = {p}\n[PROOFSTEP]\nsimp [pow_factors_toFinset p hk, factors_prime hp]\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.PrimeFin", "llama_tokens": 662, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8670357563664174, "lm_q2_score": 0.7662936377487304, "lm_q1q2_score": 0.6644039838042439}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : OrderedSemiring α\nx : ↑(Icc 0 1)\n⊢ ↑x = 0 ↔ x = 0\n[PROOFSTEP]\nsymm\n[GOAL]\nα : Type u_1\ninst✝ : OrderedSemiring α\nx : ↑(Icc 0 1)\n⊢ x = 0 ↔ ↑x = 0\n[PROOFSTEP]\nexact Subtype.ext_iff\n[GOAL]\nα : Type u_1\ninst✝ : OrderedSemiring α\nx : ↑(Icc 0 1)\n⊢ ↑x = 1 ↔ x = 1\n[PROOFSTEP]\nsymm\n[GOAL]\nα : Type u_1\ninst✝ : OrderedSemiring α\nx : ↑(Icc 0 1)\n⊢ x = 1 ↔ ↑x = 1\n[PROOFSTEP]\nexact Subtype.ext_iff\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nt : β\nht : t ∈ Icc 0 1\n⊢ 1 - t ∈ Icc 0 1\n[PROOFSTEP]\nrw [mem_Icc] at *\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nt : β\nht : 0 ≤ t ∧ t ≤ 1\n⊢ 0 ≤ 1 - t ∧ 1 - t ≤ 1\n[PROOFSTEP]\nexact ⟨sub_nonneg.2 ht.2, (sub_le_self_iff _).2 ht.1⟩\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nx : ↑(Icc 0 1)\n⊢ 0 ≤ 1 - ↑x\n[PROOFSTEP]\nsimpa using x.2.2\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nx : ↑(Icc 0 1)\n⊢ 1 - ↑x ≤ 1\n[PROOFSTEP]\nsimpa using x.2.1\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\ninst✝ : Nontrivial α\nx : ↑(Ico 0 1)\n⊢ ↑x = 0 ↔ x = 0\n[PROOFSTEP]\nsymm\n[GOAL]\nα : Type u_1\ninst✝¹ : OrderedSemiring α\ninst✝ : Nontrivial α\nx : ↑(Ico 0 1)\n⊢ x = 0 ↔ ↑x = 0\n[PROOFSTEP]\nexact Subtype.ext_iff\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\ninst✝ : Nontrivial α\nx : ↑(Ioc 0 1)\n⊢ ↑x = 1 ↔ x = 1\n[PROOFSTEP]\nsymm\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\ninst✝ : Nontrivial α\nx : ↑(Ioc 0 1)\n⊢ x = 1 ↔ ↑x = 1\n[PROOFSTEP]\nexact Subtype.ext_iff\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nt : β\nht : t ∈ Ioo 0 1\n⊢ 1 - t ∈ Ioo 0 1\n[PROOFSTEP]\nrw [mem_Ioo] at *\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nt : β\nht : 0 < t ∧ t < 1\n⊢ 0 < 1 - t ∧ 1 - t < 1\n[PROOFSTEP]\nrefine' ⟨sub_pos.2 ht.2, _⟩\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nt : β\nht : 0 < t ∧ t < 1\n⊢ 1 - t < 1\n[PROOFSTEP]\nexact lt_of_le_of_ne ((sub_le_self_iff 1).2 ht.1.le) (mt sub_eq_self.mp ht.1.ne')\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nx : ↑(Ioo 0 1)\n⊢ 0 < 1 - ↑x\n[PROOFSTEP]\nsimpa using x.2.2\n[GOAL]\nα : Type u_1\ninst✝¹ : StrictOrderedSemiring α\nβ : Type u_2\ninst✝ : OrderedRing β\nx : ↑(Ioo 0 1)\n⊢ 1 - ↑x < 1\n[PROOFSTEP]\nsimpa using x.2.1\n", "meta": {"mathlib_filename": "Mathlib.Data.Set.Intervals.Instances", "llama_tokens": 1430, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.839733983715524, "lm_q2_score": 0.7905303162021596, "lm_q1q2_score": 0.6638351716723323}} {"text": "[GOAL]\nx y : ℂ\n⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ arg x = arg y\n[PROOFSTEP]\nrcases eq_or_ne x 0 with (rfl | hx)\n[GOAL]\ncase inl\ny : ℂ\n⊢ SameRay ℝ 0 y ↔ 0 = 0 ∨ y = 0 ∨ arg 0 = arg y\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr\nx y : ℂ\nhx : x ≠ 0\n⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ arg x = arg y\n[PROOFSTEP]\nrcases eq_or_ne y 0 with (rfl | hy)\n[GOAL]\ncase inr.inl\nx : ℂ\nhx : x ≠ 0\n⊢ SameRay ℝ x 0 ↔ x = 0 ∨ 0 = 0 ∨ arg x = arg 0\n[PROOFSTEP]\nsimp\n[GOAL]\ncase inr.inr\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ arg x = arg y\n[PROOFSTEP]\nsimp only [hx, hy, false_or_iff, sameRay_iff_norm_smul_eq, arg_eq_arg_iff hx hy]\n[GOAL]\ncase inr.inr\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ ‖x‖ • y = ‖y‖ • x ↔ ↑(↑abs y) / ↑(↑abs x) * x = y\n[PROOFSTEP]\nfield_simp [hx, hy]\n[GOAL]\ncase inr.inr\nx y : ℂ\nhx : x ≠ 0\nhy : y ≠ 0\n⊢ ↑(↑abs x) * y = ↑(↑abs y) * x ↔ ↑(↑abs y) * x = y * ↑(↑abs x)\n[PROOFSTEP]\nrw [mul_comm, eq_comm]\n[GOAL]\nx y : ℂ\n⊢ SameRay ℝ x y ↔ arg (x / y) = 0\n[PROOFSTEP]\nrw [← Real.Angle.toReal_zero, ← arg_coe_angle_eq_iff_eq_toReal, sameRay_iff]\n[GOAL]\nx y : ℂ\n⊢ x = 0 ∨ y = 0 ∨ arg x = arg y ↔ ↑(arg (x / y)) = 0\n[PROOFSTEP]\nby_cases hx : x = 0\n[GOAL]\ncase pos\nx y : ℂ\nhx : x = 0\n⊢ x = 0 ∨ y = 0 ∨ arg x = arg y ↔ ↑(arg (x / y)) = 0\n[PROOFSTEP]\nsimp [hx]\n[GOAL]\ncase neg\nx y : ℂ\nhx : ¬x = 0\n⊢ x = 0 ∨ y = 0 ∨ arg x = arg y ↔ ↑(arg (x / y)) = 0\n[PROOFSTEP]\nby_cases hy : y = 0\n[GOAL]\ncase pos\nx y : ℂ\nhx : ¬x = 0\nhy : y = 0\n⊢ x = 0 ∨ y = 0 ∨ arg x = arg y ↔ ↑(arg (x / y)) = 0\n[PROOFSTEP]\nsimp [hy]\n[GOAL]\ncase neg\nx y : ℂ\nhx : ¬x = 0\nhy : ¬y = 0\n⊢ x = 0 ∨ y = 0 ∨ arg x = arg y ↔ ↑(arg (x / y)) = 0\n[PROOFSTEP]\nsimp [hx, hy, arg_div_coe_angle, sub_eq_zero]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Complex.Arg", "llama_tokens": 1005, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8757869851639066, "lm_q2_score": 0.7577943712746406, "lm_q1q2_score": 0.6636664477927956}} {"text": "[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\nhx : x ∈ s\n⊢ ↑(BoundedContinuousFunction.const X a + (b - a) • f) x = Function.const X a x\n[PROOFSTEP]\nsimp [hfs hx]\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\nhx : x ∈ t\n⊢ ↑(BoundedContinuousFunction.const X a + (b - a) • f) x = Function.const X b x\n[PROOFSTEP]\nsimp [hft hx]\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\n⊢ a ≤ ↑(BoundedContinuousFunction.const X a + (b - a) • f) x\n[PROOFSTEP]\ndsimp\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\n⊢ a ≤ a + (b - a) * ↑f x\n[PROOFSTEP]\nnlinarith [(hf01 x).1]\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\n⊢ ↑(BoundedContinuousFunction.const X a + (b - a) • f) x ≤ b\n[PROOFSTEP]\ndsimp\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : NormalSpace X\ns t : Set X\nhs : IsClosed s\nht : IsClosed t\nhd : Disjoint s t\na b : ℝ\nhle : a ≤ b\nf : X →ᵇ ℝ\nhfs : EqOn (↑f) 0 s\nhft : EqOn (↑f) 1 t\nhf01 : ∀ (x : X), ↑f x ∈ Icc 0 1\nx : X\n⊢ a + (b - a) * ↑f x ≤ b\n[PROOFSTEP]\nnlinarith [(hf01 x).2]\n", "meta": {"mathlib_filename": "Mathlib.Topology.UrysohnsBounded", "llama_tokens": 1088, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8499711604559846, "lm_q2_score": 0.7799929002541068, "lm_q1q2_score": 0.6629714705764123}} {"text": "[GOAL]\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nf : SingleObj α ⥤q SingleObj β\ng : SingleObj β ⥤q SingleObj γ\n⊢ ↑toPrefunctor.symm (f ⋙q g) = ↑toPrefunctor.symm g ∘ ↑toPrefunctor.symm f\n[PROOFSTEP]\nsimp only [Equiv.symm_apply_eq, toPrefunctor_comp, Equiv.apply_symm_apply]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nx : SingleObj α\np : Path (star α) x\n⊢ listToPath (pathToList p) = Path.cast (_ : star α = star α) (_ : x = star α) p\n[PROOFSTEP]\ninduction' p with y z p a ih\n[GOAL]\ncase nil\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nx : SingleObj α\n⊢ listToPath (pathToList Path.nil) = Path.cast (_ : star α = star α) (_ : star α = star α) Path.nil\n[PROOFSTEP]\nrfl\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nx y z : SingleObj α\np : Path (star α) y\na : y ⟶ z\nih : listToPath (pathToList p) = Path.cast (_ : star α = star α) (_ : y = star α) p\n⊢ listToPath (pathToList (Path.cons p a)) = Path.cast (_ : star α = star α) (_ : z = star α) (Path.cons p a)\n[PROOFSTEP]\ndsimp at *\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nx y z : SingleObj α\np : Path (star α) y\na : y ⟶ z\nih : listToPath (pathToList p) = p\n⊢ Path.cons (listToPath (pathToList p)) a = Path.cons p a\n[PROOFSTEP]\nrw [ih]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\nl : List α\n⊢ pathToList (listToPath l) = l\n[PROOFSTEP]\ninduction' l with a l ih\n[GOAL]\ncase nil\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\n⊢ pathToList (listToPath []) = []\n[PROOFSTEP]\nrfl\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\na : α\nl : List α\nih : pathToList (listToPath l) = l\n⊢ pathToList (listToPath (a :: l)) = a :: l\n[PROOFSTEP]\nchange a :: pathToList (listToPath l) = a :: l\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nγ : Type u_3\na : α\nl : List α\nih : pathToList (listToPath l) = l\n⊢ a :: pathToList (listToPath l) = a :: l\n[PROOFSTEP]\nrw [ih]\n", "meta": {"mathlib_filename": "Mathlib.Combinatorics.Quiver.SingleObj", "llama_tokens": 823, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8438951143326726, "lm_q2_score": 0.7853085708384736, "lm_q1q2_score": 0.6627180661741614}} {"text": "[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\nF : Type u_5\ninst✝ : Monoid F\nc : F → M → M\nh1 : c 1 = id\nhmul : ∀ (f g : F), c (f * g) = c f ∘ c g\nf : F\n⊢ c (f ^ 0) = (c f)^[0]\n[PROOFSTEP]\nrw [pow_zero, h1]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\nF : Type u_5\ninst✝ : Monoid F\nc : F → M → M\nh1 : c 1 = id\nhmul : ∀ (f g : F), c (f * g) = c f ∘ c g\nf : F\n⊢ id = (c f)^[0]\n[PROOFSTEP]\nrfl\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\nF : Type u_5\ninst✝ : Monoid F\nc : F → M → M\nh1 : c 1 = id\nhmul : ∀ (f g : F), c (f * g) = c f ∘ c g\nf : F\nn : ℕ\n⊢ c (f ^ (n + 1)) = (c f)^[n + 1]\n[PROOFSTEP]\nrw [pow_succ, iterate_succ', hmul, hom_coe_pow c h1 hmul f n]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝¹ : Monoid G\na : G\nn : ℕ\ninst✝ : MulAction G H\nb : H\n⊢ (fun x => a • x)^[Nat.zero] b = a ^ Nat.zero • b\n[PROOFSTEP]\nrw [iterate_zero, id.def, pow_zero, one_smul]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝¹ : Monoid G\na : G\nn✝ : ℕ\ninst✝ : MulAction G H\nb : H\nn : ℕ\nih : (fun x => a • x)^[n] b = a ^ n • b\n⊢ (fun x => a • x)^[Nat.succ n] b = a ^ Nat.succ n • b\n[PROOFSTEP]\nrw [iterate_succ', comp_apply, ih, pow_succ, mul_smul]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝ : Monoid G\na : G\nn : ℕ\n⊢ (fun x => x * a)^[n] 1 = a ^ n\n[PROOFSTEP]\nsimp [mul_right_iterate]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝ : Semigroup G\na b c : G\nh : SemiconjBy a b c\nj : G\n⊢ (fun x => a * x) ((fun x => b * x) j) = (fun x => c * x) ((fun x => a * x) j)\n[PROOFSTEP]\ndsimp only\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝ : Semigroup G\na b c : G\nh : SemiconjBy a b c\nj : G\n⊢ a * (b * j) = c * (a * j)\n[PROOFSTEP]\nrw [← mul_assoc, h.eq, mul_assoc]\n[GOAL]\nM : Type u_1\nN : Type u_2\nG : Type u_3\nH : Type u_4\ninst✝ : Semigroup G\na b c : G\nh : SemiconjBy a b c\nj : G\n⊢ (fun x => x * a) ((fun x => x * c) j) = (fun x => x * b) ((fun x => x * a) j)\n[PROOFSTEP]\nsimp_rw [mul_assoc, ← h.eq]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Hom.Iterate", "llama_tokens": 1107, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8459424373085146, "lm_q2_score": 0.782662489091802, "lm_q1q2_score": 0.6620874136122678}} {"text": "[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nι : Type u_4\nκ : Type u_5\ninst✝⁴ : CommRing R\ninst✝³ : AddCommGroup M\ninst✝² : Module R M\ninst✝¹ : AddCommGroup N\ninst✝ : Module R N\nb : Basis ι R M\nc : Basis κ R N\ni : ι\nj : κ\n⊢ ↑(tensorProduct b c) (i, j) = ↑b i ⊗ₜ[R] ↑c j\n[PROOFSTEP]\nsimp [Basis.tensorProduct]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nι : Type u_4\nκ : Type u_5\ninst✝⁴ : CommRing R\ninst✝³ : AddCommGroup M\ninst✝² : Module R M\ninst✝¹ : AddCommGroup N\ninst✝ : Module R N\nb : Basis ι R M\nc : Basis κ R N\ni : ι × κ\n⊢ ↑(tensorProduct b c) i = ↑b i.fst ⊗ₜ[R] ↑c i.snd\n[PROOFSTEP]\nsimp [Basis.tensorProduct]\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\nι : Type u_4\nκ : Type u_5\ninst✝⁴ : CommRing R\ninst✝³ : AddCommGroup M\ninst✝² : Module R M\ninst✝¹ : AddCommGroup N\ninst✝ : Module R N\nb : Basis ι R M\nc : Basis κ R N\nm : M\nn : N\ni : ι\nj : κ\n⊢ ↑(↑(tensorProduct b c).repr (m ⊗ₜ[R] n)) (i, j) = ↑(↑b.repr m) i * ↑(↑c.repr n) j\n[PROOFSTEP]\nsimp [Basis.tensorProduct]\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.TensorProductBasis", "llama_tokens": 535, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8596637612961506, "lm_q2_score": 0.7690802370707281, "lm_q1q2_score": 0.6611504093387573}} {"text": "[GOAL]\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁶ : CommSemiring R\ninst✝⁵ : CommSemiring A\ninst✝⁴ : Semiring B\ninst✝³ : Algebra R A\ninst✝² : Algebra A B\ninst✝¹ : Algebra R B\ninst✝ : IsScalarTower R A B\nx : B\np : R[X]\n⊢ ↑(aeval x) (map (algebraMap R A) p) = ↑(aeval x) p\n[PROOFSTEP]\nrw [aeval_def, aeval_def, eval₂_map, IsScalarTower.algebraMap_eq R A B]\n[GOAL]\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁶ : CommSemiring R\ninst✝⁵ : CommSemiring A\ninst✝⁴ : Semiring B\ninst✝³ : Algebra R A\ninst✝² : Algebra A B\ninst✝¹ : Algebra R B\ninst✝ : IsScalarTower R A B\nx : A\np : R[X]\n⊢ ↑(aeval (↑(algebraMap A B) x)) p = ↑(algebraMap A B) (↑(aeval x) p)\n[PROOFSTEP]\nrw [aeval_def, aeval_def, hom_eval₂, ← IsScalarTower.algebraMap_eq]\n[GOAL]\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁸ : CommSemiring R\ninst✝⁷ : CommSemiring A\ninst✝⁶ : Semiring B\ninst✝⁵ : Algebra R A\ninst✝⁴ : Algebra A B\ninst✝³ : Algebra R B\ninst✝² : IsScalarTower R A B\ninst✝¹ : NoZeroSMulDivisors A B\ninst✝ : Nontrivial B\nx : A\np : R[X]\n⊢ ↑(aeval (↑(algebraMap A B) x)) p = 0 ↔ ↑(aeval x) p = 0\n[PROOFSTEP]\nrw [aeval_algebraMap_apply, Algebra.algebraMap_eq_smul_one, smul_eq_zero, iff_false_intro (one_ne_zero' B),\n or_false_iff]\n[GOAL]\nR : Type u_1\nA : Type u_2\nB : Type u_3\ninst✝⁶ : CommSemiring R\ninst✝⁵ : CommSemiring A\ninst✝⁴ : Semiring B\ninst✝³ : Algebra R A\ninst✝² : Algebra A B\ninst✝¹ : Algebra R B\ninst✝ : IsScalarTower R A B\nx : A\np : R[X]\nh : Function.Injective ↑(algebraMap A B)\n⊢ ↑(aeval (↑(algebraMap A B) x)) p = 0 ↔ ↑(aeval x) p = 0\n[PROOFSTEP]\nrw [aeval_algebraMap_apply, ← (algebraMap A B).map_zero, h.eq_iff]\n", "meta": {"mathlib_filename": "Mathlib.RingTheory.Polynomial.Tower", "llama_tokens": 812, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8418256313782276, "lm_q2_score": 0.785308580887758, "lm_q1q2_score": 0.6610928919325768}} {"text": "[GOAL]\nz : ℂ\n⊢ z ∈ circle ↔ ↑normSq z = 1\n[PROOFSTEP]\nsimp [Complex.abs]\n[GOAL]\nz : { x // x ∈ circle }\n⊢ ↑normSq ↑z = 1\n[PROOFSTEP]\nsimp [normSq_eq_abs]\n[GOAL]\nz : { x // x ∈ circle }\n⊢ ↑z⁻¹ = ↑(starRingEnd ℂ) ↑z\n[PROOFSTEP]\nrw [coe_inv_circle, inv_def, normSq_eq_of_mem_circle, inv_one, ofReal_one, mul_one]\n[GOAL]\nz : ℂ\nhz : z ≠ 0\n⊢ ↑Complex.abs (↑(starRingEnd ℂ) z / z) = 1\n[PROOFSTEP]\nrw [map_div₀, abs_conj, div_self]\n[GOAL]\nz : ℂ\nhz : z ≠ 0\n⊢ ↑Complex.abs z ≠ 0\n[PROOFSTEP]\nexact Complex.abs.ne_zero hz\n[GOAL]\nt : ℝ\n⊢ exp (↑t * I) ∈ circle\n[PROOFSTEP]\nsimp [exp_mul_I, abs_cos_add_sin_mul_I]\n[GOAL]\n⊢ ↑(↑expMapCircle 0) = ↑1\n[PROOFSTEP]\nrw [expMapCircle_apply, ofReal_zero, zero_mul, exp_zero, Submonoid.coe_one]\n[GOAL]\nx y : ℝ\n⊢ ↑(↑expMapCircle (x + y)) = ↑(↑expMapCircle x * ↑expMapCircle y)\n[PROOFSTEP]\nsimp only [expMapCircle_apply, Submonoid.coe_mul, ofReal_add, add_mul, Complex.exp_add]\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Complex.Circle", "llama_tokens": 491, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8723473813156295, "lm_q2_score": 0.7577943767446202, "lm_q1q2_score": 0.661059940128879}} {"text": "[GOAL]\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(↑(traceForm R L M) ⁅x, y⁆) z = ↑(↑(traceForm R L M) x) ⁅y, z⁆\n[PROOFSTEP]\ncalc\n traceForm R L M ⁅x, y⁆ z = trace R _ (φ ⁅x, y⁆ ∘ₗ φ z) := by simp only [traceForm_apply_apply]\n _ = trace R _ ((φ x * φ y - φ y * φ x) * φ z) := ?_\n _ = trace R _ (φ x * (φ y * φ z)) - trace R _ (φ y * (φ x * φ z)) := ?_\n _ = trace R _ (φ x * (φ y * φ z)) - trace R _ (φ x * (φ z * φ y)) := ?_\n _ = traceForm R L M x ⁅y, z⁆ := ?_\n[GOAL]\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(↑(traceForm R L M) ⁅x, y⁆) z = ↑(trace R M) (LinearMap.comp (↑φ ⁅x, y⁆) (↑φ z))\n[PROOFSTEP]\nsimp only [traceForm_apply_apply]\n[GOAL]\ncase calc_1\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(trace R M) (LinearMap.comp (↑φ ⁅x, y⁆) (↑φ z)) = ↑(trace R M) ((↑φ x * ↑φ y - ↑φ y * ↑φ x) * ↑φ z)\n[PROOFSTEP]\nsimp only [LieHom.map_lie, Ring.lie_def, ← LinearMap.mul_eq_comp]\n[GOAL]\ncase calc_2\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(trace R M) ((↑φ x * ↑φ y - ↑φ y * ↑φ x) * ↑φ z) =\n ↑(trace R M) (↑φ x * (↑φ y * ↑φ z)) - ↑(trace R M) (↑φ y * (↑φ x * ↑φ z))\n[PROOFSTEP]\nsimp only [sub_mul, mul_sub, map_sub, mul_assoc]\n[GOAL]\ncase calc_3\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(trace R M) (↑φ x * (↑φ y * ↑φ z)) - ↑(trace R M) (↑φ y * (↑φ x * ↑φ z)) =\n ↑(trace R M) (↑φ x * (↑φ y * ↑φ z)) - ↑(trace R M) (↑φ x * (↑φ z * ↑φ y))\n[PROOFSTEP]\nsimp only [LinearMap.trace_mul_cycle' R (φ x) (φ z) (φ y)]\n[GOAL]\ncase calc_4\nR : Type u_1\nL : Type u_2\ninst✝⁸ : CommRing R\ninst✝⁷ : LieRing L\ninst✝⁶ : LieAlgebra R L\nM : Type u_3\ninst✝⁵ : AddCommGroup M\ninst✝⁴ : Module R M\ninst✝³ : LieRingModule L M\ninst✝² : LieModule R L M\ninst✝¹ : Module.Free R M\ninst✝ : Module.Finite R M\nx y z : L\n⊢ ↑(trace R M) (↑φ x * (↑φ y * ↑φ z)) - ↑(trace R M) (↑φ x * (↑φ z * ↑φ y)) = ↑(↑(traceForm R L M) x) ⁅y, z⁆\n[PROOFSTEP]\nsimp only [traceForm_apply_apply, LieHom.map_lie, Ring.lie_def, mul_sub, map_sub, ← LinearMap.mul_eq_comp]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Lie.Killing", "llama_tokens": 1612, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8991213691605412, "lm_q2_score": 0.7341195327172402, "lm_q1q2_score": 0.6600625593842218}} {"text": "[GOAL]\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\n⊢ ∃ c, c ∈ Ioo a b ∧ deriv f c = 0\n[PROOFSTEP]\nby_cases h : ∀ x ∈ Ioo a b, DifferentiableAt ℝ f x\n[GOAL]\ncase pos\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\nh : ∀ (x : ℝ), x ∈ Ioo a b → DifferentiableAt ℝ f x\n⊢ ∃ c, c ∈ Ioo a b ∧ deriv f c = 0\n[PROOFSTEP]\nexact exists_hasDerivAt_eq_zero' hab hfa hfb fun x hx => (h x hx).hasDerivAt\n[GOAL]\ncase neg\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\nh : ¬∀ (x : ℝ), x ∈ Ioo a b → DifferentiableAt ℝ f x\n⊢ ∃ c, c ∈ Ioo a b ∧ deriv f c = 0\n[PROOFSTEP]\nobtain ⟨c, hc, hcdiff⟩ : ∃ x ∈ Ioo a b, ¬DifferentiableAt ℝ f x\n[GOAL]\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\nh : ¬∀ (x : ℝ), x ∈ Ioo a b → DifferentiableAt ℝ f x\n⊢ ∃ x, x ∈ Ioo a b ∧ ¬DifferentiableAt ℝ f x\n[PROOFSTEP]\npush_neg at h \n[GOAL]\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\nh : ∃ x, x ∈ Ioo a b ∧ ¬DifferentiableAt ℝ f x\n⊢ ∃ x, x ∈ Ioo a b ∧ ¬DifferentiableAt ℝ f x\n[PROOFSTEP]\nexact h\n[GOAL]\ncase neg.intro.intro\nf f' : ℝ → ℝ\na b l : ℝ\nhab : a < b\nhfa : Tendsto f (𝓝[Ioi a] a) (𝓝 l)\nhfb : Tendsto f (𝓝[Iio b] b) (𝓝 l)\nh : ¬∀ (x : ℝ), x ∈ Ioo a b → DifferentiableAt ℝ f x\nc : ℝ\nhc : c ∈ Ioo a b\nhcdiff : ¬DifferentiableAt ℝ f c\n⊢ ∃ c, c ∈ Ioo a b ∧ deriv f c = 0\n[PROOFSTEP]\nexact ⟨c, hc, deriv_zero_of_not_differentiableAt hcdiff⟩\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "llama_tokens": 918, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8459424295406088, "lm_q2_score": 0.7799929053683038, "lm_q1q2_score": 0.6598290933917011}} {"text": "[GOAL]\nR : Type u_1\ninst✝¹ : Ring R\nn m : ℕ\ninst✝ : CharP R m\nh : m ∣ n\nsrc✝ : ZMod n →+* R := castHom h R\na : ZMod n\nr : (fun x => R) a\n⊢ ↑a * r = r * ↑a\n[PROOFSTEP]\nrcases ZMod.int_cast_surjective a with ⟨k, rfl⟩\n[GOAL]\ncase intro\nR : Type u_1\ninst✝¹ : Ring R\nn m : ℕ\ninst✝ : CharP R m\nh : m ∣ n\nsrc✝ : ZMod n →+* R := castHom h R\nk : ℤ\nr : R\n⊢ ↑↑k * r = r * ↑↑k\n[PROOFSTEP]\nshow ZMod.castHom h R k * r = r * ZMod.castHom h R k\n[GOAL]\ncase intro\nR : Type u_1\ninst✝¹ : Ring R\nn m : ℕ\ninst✝ : CharP R m\nh : m ∣ n\nsrc✝ : ZMod n →+* R := castHom h R\nk : ℤ\nr : R\n⊢ ↑(castHom h R) ↑k * r = r * ↑(castHom h R) ↑k\n[PROOFSTEP]\nrw [map_intCast]\n[GOAL]\ncase intro\nR : Type u_1\ninst✝¹ : Ring R\nn m : ℕ\ninst✝ : CharP R m\nh : m ∣ n\nsrc✝ : ZMod n →+* R := castHom h R\nk : ℤ\nr : R\n⊢ ↑k * r = r * ↑k\n[PROOFSTEP]\nexact Commute.cast_int_left r k\n", "meta": {"mathlib_filename": "Mathlib.Data.ZMod.Algebra", "llama_tokens": 463, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.863391624034103, "lm_q2_score": 0.7634837743174788, "lm_q1q2_score": 0.6591854958316546}} {"text": "[GOAL]\nα : Type u_1\nβ : Type u_2\nhead✝ : α\nl : List α\n⊢ (head✝ :: l) ×ˢ [] = []\n[PROOFSTEP]\nsimp [product_cons, product_nil]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nl₁ : List α\nl₂ : List β\na : α\nb : β\n⊢ (a, b) ∈ l₁ ×ˢ l₂ ↔ a ∈ l₁ ∧ b ∈ l₂\n[PROOFSTEP]\nsimp_all [SProd.sprod, product, mem_bind, mem_map, Prod.ext_iff, exists_prop, and_left_comm, exists_and_left,\n exists_eq_left, exists_eq_right]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nl₁ : List α\nl₂ : List β\n⊢ length (l₁ ×ˢ l₂) = length l₁ * length l₂\n[PROOFSTEP]\ninduction' l₁ with x l₁ IH\n[GOAL]\ncase nil\nα : Type u_1\nβ : Type u_2\nl₂ : List β\n⊢ length ([] ×ˢ l₂) = length [] * length l₂\n[PROOFSTEP]\nexact (zero_mul _).symm\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nl₂ : List β\nx : α\nl₁ : List α\nIH : length (l₁ ×ˢ l₂) = length l₁ * length l₂\n⊢ length ((x :: l₁) ×ˢ l₂) = length (x :: l₁) * length l₂\n[PROOFSTEP]\nsimp only [length, product_cons, length_append, IH, right_distrib, one_mul, length_map, add_comm]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nσ : α → Type u_3\nhead✝ : α\nl : List α\n⊢ (List.sigma (head✝ :: l) fun a => []) = []\n[PROOFSTEP]\nsimp [sigma_cons, sigma_nil]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nσ : α → Type u_3\nl₁ : List α\nl₂ : (a : α) → List (σ a)\na : α\nb : σ a\n⊢ { fst := a, snd := b } ∈ List.sigma l₁ l₂ ↔ a ∈ l₁ ∧ b ∈ l₂ a\n[PROOFSTEP]\nsimp [List.sigma, mem_bind, mem_map, exists_prop, exists_and_left, and_left_comm, exists_eq_left, heq_iff_eq,\n exists_eq_right]\n[GOAL]\nα : Type u_1\nβ : Type u_2\nσ : α → Type u_3\nl₁ : List α\nl₂ : (a : α) → List (σ a)\n⊢ length (List.sigma l₁ l₂) = sum (map (fun a => length (l₂ a)) l₁)\n[PROOFSTEP]\ninduction' l₁ with x l₁ IH\n[GOAL]\ncase nil\nα : Type u_1\nβ : Type u_2\nσ : α → Type u_3\nl₂ : (a : α) → List (σ a)\n⊢ length (List.sigma [] l₂) = sum (map (fun a => length (l₂ a)) [])\n[PROOFSTEP]\nrfl\n[GOAL]\ncase cons\nα : Type u_1\nβ : Type u_2\nσ : α → Type u_3\nl₂ : (a : α) → List (σ a)\nx : α\nl₁ : List α\nIH : length (List.sigma l₁ l₂) = sum (map (fun a => length (l₂ a)) l₁)\n⊢ length (List.sigma (x :: l₁) l₂) = sum (map (fun a => length (l₂ a)) (x :: l₁))\n[PROOFSTEP]\nsimp only [map, sigma_cons, length_append, length_map, IH, sum_cons]\n", "meta": {"mathlib_filename": "Mathlib.Data.List.ProdSigma", "llama_tokens": 1038, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8418256512199033, "lm_q2_score": 0.7826624840223698, "lm_q1q2_score": 0.6588653552975187}} {"text": "[GOAL]\nα : Type u_1\ninst✝¹ : UniformSpace α\ninst✝ : SeparatedSpace α\ns : Set α\nh : IsComplete s\na : α\nha : ClusterPt a (𝓟 s)\n⊢ a ∈ s\n[PROOFSTEP]\nlet f := 𝓝[s] a\n[GOAL]\nα : Type u_1\ninst✝¹ : UniformSpace α\ninst✝ : SeparatedSpace α\ns : Set α\nh : IsComplete s\na : α\nha : ClusterPt a (𝓟 s)\nf : Filter α := 𝓝[s] a\n⊢ a ∈ s\n[PROOFSTEP]\nhave : Cauchy f := cauchy_nhds.mono' ha inf_le_left\n[GOAL]\nα : Type u_1\ninst✝¹ : UniformSpace α\ninst✝ : SeparatedSpace α\ns : Set α\nh : IsComplete s\na : α\nha : ClusterPt a (𝓟 s)\nf : Filter α := 𝓝[s] a\nthis : Cauchy f\n⊢ a ∈ s\n[PROOFSTEP]\nrcases h f this inf_le_right with ⟨y, ys, fy⟩\n[GOAL]\ncase intro.intro\nα : Type u_1\ninst✝¹ : UniformSpace α\ninst✝ : SeparatedSpace α\ns : Set α\nh : IsComplete s\na : α\nha : ClusterPt a (𝓟 s)\nf : Filter α := 𝓝[s] a\nthis : Cauchy f\ny : α\nys : y ∈ s\nfy : f ≤ 𝓝 y\n⊢ a ∈ s\n[PROOFSTEP]\nrwa [(tendsto_nhds_unique' ha inf_le_left fy : a = y)]\n", "meta": {"mathlib_filename": "Mathlib.Topology.UniformSpace.CompleteSeparated", "llama_tokens": 468, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8688267898240861, "lm_q2_score": 0.7577943658046609, "lm_q1q2_score": 0.6583920461888427}} {"text": "[GOAL]\nk : ℕ\n⊢ 0 < W k\n[PROOFSTEP]\ninduction' k with k hk\n[GOAL]\ncase zero\n⊢ 0 < W Nat.zero\n[PROOFSTEP]\nunfold W\n[GOAL]\ncase zero\n⊢ 0 < ∏ i in range Nat.zero, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3))\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nk : ℕ\nhk : 0 < W k\n⊢ 0 < W (Nat.succ k)\n[PROOFSTEP]\nrw [W_succ]\n[GOAL]\ncase succ\nk : ℕ\nhk : 0 < W k\n⊢ 0 < W k * ((2 * ↑k + 2) / (2 * ↑k + 1) * ((2 * ↑k + 2) / (2 * ↑k + 3)))\n[PROOFSTEP]\nrefine' mul_pos hk (mul_pos (div_pos _ _) (div_pos _ _))\n[GOAL]\ncase succ.refine'_1\nk : ℕ\nhk : 0 < W k\n⊢ 0 < 2 * ↑k + 2\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_2\nk : ℕ\nhk : 0 < W k\n⊢ 0 < 2 * ↑k + 1\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_3\nk : ℕ\nhk : 0 < W k\n⊢ 0 < 2 * ↑k + 2\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_4\nk : ℕ\nhk : 0 < W k\n⊢ 0 < 2 * ↑k + 3\n[PROOFSTEP]\npositivity\n[GOAL]\nn : ℕ\n⊢ W n = ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n[PROOFSTEP]\ninduction' n with n IH\n[GOAL]\ncase zero\n⊢ W Nat.zero = ↑(2 ^ (4 * Nat.zero)) * ↑(Nat.zero ! ^ 4) / (↑((2 * Nat.zero)! ^ 2) * (2 * ↑Nat.zero + 1))\n[PROOFSTEP]\nsimp only [W, prod_range_zero, Nat.factorial_zero, mul_zero, pow_zero, algebraMap.coe_one, one_pow, mul_one,\n algebraMap.coe_zero, zero_add, div_self, Ne.def, one_ne_zero, not_false_iff]\n[GOAL]\ncase zero\n⊢ 1 = ↑(2 ^ (4 * Nat.zero)) * ↑1 / (↑((2 * Nat.zero)! ^ 2) * (2 * ↑Nat.zero + 1))\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase succ\nn : ℕ\nIH : W n = ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ W (Nat.succ n) = ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))\n[PROOFSTEP]\nunfold W at IH ⊢\n[GOAL]\ncase succ\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ∏ i in range (Nat.succ n), (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))\n[PROOFSTEP]\nrw [prod_range_succ, IH, _root_.div_mul_div_comm, _root_.div_mul_div_comm]\n[GOAL]\ncase succ\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) /\n (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3))) =\n ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) / (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1))\n[PROOFSTEP]\nrefine' (div_eq_div_iff _ _).mpr _\n[GOAL]\ncase succ.refine'_1\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)) ≠ 0\ncase succ.refine'_2\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1) ≠ 0\ncase succ.refine'_3\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =\n ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))\n[PROOFSTEP]\nany_goals exact ne_of_gt (by positivity)\n[GOAL]\ncase succ.refine'_1\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)) ≠ 0\n[PROOFSTEP]\nexact ne_of_gt (by positivity)\n[GOAL]\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ 0 < ↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3))\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_2\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1) ≠ 0\n[PROOFSTEP]\nexact ne_of_gt (by positivity)\n[GOAL]\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ 0 < ↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_3\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =\n ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))\n[PROOFSTEP]\nexact ne_of_gt (by positivity)\n[GOAL]\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ?m.19110 < ?m.19109\n[PROOFSTEP]\npositivity\n[GOAL]\ncase succ.refine'_3\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) * ((2 * ↑n + 2) * (2 * ↑n + 2)) * (↑((2 * Nat.succ n)! ^ 2) * (2 * ↑(Nat.succ n) + 1)) =\n ↑(2 ^ (4 * Nat.succ n)) * ↑((Nat.succ n)! ^ 4) * (↑((2 * n)! ^ 2) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))\n[PROOFSTEP]\nsimp_rw [Nat.mul_succ, Nat.factorial_succ, pow_succ]\n[GOAL]\ncase succ.refine'_3\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ ↑(2 ^ (4 * n)) * ↑(n ! * (n ! * (n ! * (n ! * n ! ^ 0)))) * ((2 * ↑n + 2) * (2 * ↑n + 2)) *\n (↑((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!) *\n ((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!) * ((2 * n + 1 + 1) * ((2 * n + 1) * (2 * n)!)) ^ 0)) *\n (2 * ↑(Nat.succ n) + 1)) =\n ↑(2 * (2 * (2 * (2 * 2 ^ (4 * n))))) *\n ↑((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n ! * ((n + 1) * n !) ^ 0)))) *\n (↑((2 * n)! * ((2 * n)! * (2 * n)! ^ 0)) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))\n[PROOFSTEP]\npush_cast\n[GOAL]\ncase succ.refine'_3\nn : ℕ\nIH :\n ∏ i in range n, (2 * ↑i + 2) / (2 * ↑i + 1) * ((2 * ↑i + 2) / (2 * ↑i + 3)) =\n ↑(2 ^ (4 * n)) * ↑(n ! ^ 4) / (↑((2 * n)! ^ 2) * (2 * ↑n + 1))\n⊢ 2 ^ (4 * n) * (↑n ! * (↑n ! * (↑n ! * (↑n ! * ↑n ! ^ 0)))) * ((2 * ↑n + 2) * (2 * ↑n + 2)) *\n ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!) *\n ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!) * ((2 * ↑n + 1 + 1) * ((2 * ↑n + 1) * ↑(2 * n)!)) ^ 0) *\n (2 * (↑n + 1) + 1)) =\n 2 * (2 * (2 * (2 * 2 ^ (4 * n)))) *\n ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n ! * ((↑n + 1) * ↑n !) ^ 0)))) *\n (↑(2 * n)! * (↑(2 * n)! * ↑(2 * n)! ^ 0) * (2 * ↑n + 1) * ((2 * ↑n + 1) * (2 * ↑n + 3)))\n[PROOFSTEP]\nring_nf\n[GOAL]\nk : ℕ\n⊢ (π / 2)⁻¹ * W k = (∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k + 1)) / ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k)\n[PROOFSTEP]\nrw [integral_sin_pow_even, integral_sin_pow_odd, mul_div_mul_comm, ← prod_div_distrib, inv_div]\n[GOAL]\nk : ℕ\n⊢ 2 / π * W k = 2 / π * ∏ x in range k, (2 * ↑x + 2) / (2 * ↑x + 3) / ((2 * ↑x + 1) / (2 * ↑x + 2))\n[PROOFSTEP]\nsimp_rw [div_div_div_comm, div_div_eq_mul_div, mul_div_assoc]\n[GOAL]\nk : ℕ\n⊢ 2 / π * W k = 2 / π * ∏ x in range k, (2 * ↑x + 2) / (2 * ↑x + 1) * ((2 * ↑x + 2) / (2 * ↑x + 3))\n[PROOFSTEP]\nrfl\n[GOAL]\nk : ℕ\n⊢ W k ≤ π / 2\n[PROOFSTEP]\nrw [← div_le_one pi_div_two_pos, div_eq_inv_mul]\n[GOAL]\nk : ℕ\n⊢ (π / 2)⁻¹ * W k ≤ 1\n[PROOFSTEP]\nrw [W_eq_integral_sin_pow_div_integral_sin_pow, div_le_one (integral_sin_pow_pos _)]\n[GOAL]\nk : ℕ\n⊢ ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k + 1) ≤ ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k)\n[PROOFSTEP]\napply integral_sin_pow_succ_le\n[GOAL]\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) * (π / 2) ≤ W k\n[PROOFSTEP]\nrw [← le_div_iff pi_div_two_pos, div_eq_inv_mul (W k) _]\n[GOAL]\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) ≤ (π / 2)⁻¹ * W k\n[PROOFSTEP]\nrw [W_eq_integral_sin_pow_div_integral_sin_pow, le_div_iff (integral_sin_pow_pos _)]\n[GOAL]\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k) ≤ ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k + 1)\n[PROOFSTEP]\nconvert integral_sin_pow_succ_le (2 * k + 1)\n[GOAL]\ncase h.e'_3\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k) = ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k + 1 + 1)\n[PROOFSTEP]\nrw [integral_sin_pow (2 * k)]\n[GOAL]\ncase h.e'_3\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k) =\n (sin 0 ^ (2 * k + 1) * cos 0 - sin π ^ (2 * k + 1) * cos π) / (↑(2 * k) + 2) +\n (↑(2 * k) + 1) / (↑(2 * k) + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k)\n[PROOFSTEP]\nsimp only [sin_zero, zero_pow', Ne.def, Nat.succ_ne_zero, zero_mul, sin_pi, tsub_zero, zero_div, zero_add]\n[GOAL]\ncase h.e'_3\nk : ℕ\n⊢ (2 * ↑k + 1) / (2 * ↑k + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k) =\n (↑(2 * k) + 1) / (↑(2 * k) + 2) * ∫ (x : ℝ) in 0 ..π, sin x ^ (2 * k)\n[PROOFSTEP]\nnorm_cast\n[GOAL]\n⊢ Tendsto W atTop (𝓝 (π / 2))\n[PROOFSTEP]\nrefine' tendsto_of_tendsto_of_tendsto_of_le_of_le _ tendsto_const_nhds le_W W_le\n[GOAL]\n⊢ Tendsto (fun i => (2 * ↑i + 1) / (2 * ↑i + 2) * (π / 2)) atTop (𝓝 (π / 2))\n[PROOFSTEP]\nhave : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2)) := by rw [sub_zero, one_mul]\n[GOAL]\n⊢ 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\n[PROOFSTEP]\nrw [sub_zero, one_mul]\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\n⊢ Tendsto (fun i => (2 * ↑i + 1) / (2 * ↑i + 2) * (π / 2)) atTop (𝓝 (π / 2))\n[PROOFSTEP]\nrw [this]\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\n⊢ Tendsto (fun i => (2 * ↑i + 1) / (2 * ↑i + 2) * (π / 2)) atTop (𝓝 ((1 - 0) * (π / 2)))\n[PROOFSTEP]\nrefine' Tendsto.mul _ tendsto_const_nhds\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\n⊢ Tendsto (fun i => (2 * ↑i + 1) / (2 * ↑i + 2)) atTop (𝓝 (1 - 0))\n[PROOFSTEP]\nhave h : ∀ n : ℕ, ((2 : ℝ) * n + 1) / (2 * n + 2) = 1 - 1 / (2 * n + 2) :=\n by\n intro n\n rw [sub_div' _ _ _\n (ne_of_gt (add_pos_of_nonneg_of_pos (mul_nonneg (two_pos : 0 < (2 : ℝ)).le (Nat.cast_nonneg _)) two_pos)),\n one_mul]\n congr 1; ring\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\n⊢ ∀ (n : ℕ), (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n[PROOFSTEP]\nintro n\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nn : ℕ\n⊢ (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n[PROOFSTEP]\nrw [sub_div' _ _ _\n (ne_of_gt (add_pos_of_nonneg_of_pos (mul_nonneg (two_pos : 0 < (2 : ℝ)).le (Nat.cast_nonneg _)) two_pos)),\n one_mul]\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nn : ℕ\n⊢ (2 * ↑n + 1) / (2 * ↑n + 2) = (2 * ↑n + 2 - 1) / (2 * ↑n + 2)\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase e_a\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nn : ℕ\n⊢ 2 * ↑n + 1 = 2 * ↑n + 2 - 1\n[PROOFSTEP]\nring\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nh : ∀ (n : ℕ), (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n⊢ Tendsto (fun i => (2 * ↑i + 1) / (2 * ↑i + 2)) atTop (𝓝 (1 - 0))\n[PROOFSTEP]\nsimp_rw [h]\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nh : ∀ (n : ℕ), (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n⊢ Tendsto (fun i => 1 - 1 / (2 * ↑i + 2)) atTop (𝓝 (1 - 0))\n[PROOFSTEP]\nrefine' (tendsto_const_nhds.div_atTop _).const_sub _\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nh : ∀ (n : ℕ), (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n⊢ Tendsto (fun i => 2 * ↑i + 2) atTop atTop\n[PROOFSTEP]\nrefine' Tendsto.atTop_add _ tendsto_const_nhds\n[GOAL]\nthis : 𝓝 (π / 2) = 𝓝 ((1 - 0) * (π / 2))\nh : ∀ (n : ℕ), (2 * ↑n + 1) / (2 * ↑n + 2) = 1 - 1 / (2 * ↑n + 2)\n⊢ Tendsto (fun i => 2 * ↑i) atTop atTop\n[PROOFSTEP]\nexact tendsto_nat_cast_atTop_atTop.const_mul_atTop two_pos\n", "meta": {"mathlib_filename": "Mathlib.Data.Real.Pi.Wallis", "llama_tokens": 7374, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.9149009596336303, "lm_q2_score": 0.7185943925708561, "lm_q1q2_score": 0.6574426993504219}} {"text": "[GOAL]\nα : Type u\nβ : Type v\ninst✝² : Mul α\ninst✝¹ : Mul β\nγ : Type u_1\ninst✝ : Mul γ\nf : α → β\ng : β → γ\nhf : IsMulHom f\nhg : IsMulHom g\nx y : α\n⊢ (g ∘ f) (x * y) = (g ∘ f) x * (g ∘ f) y\n[PROOFSTEP]\nsimp only [Function.comp, hf.map_mul, hg.map_mul]\n[GOAL]\nα✝ : Type u\nβ✝ : Type v\ninst✝⁴ : Mul α✝\ninst✝³ : Mul β✝\nγ : Type u_1\ninst✝² : Mul γ\nα : Type u_2\nβ : Type u_3\ninst✝¹ : Semigroup α\ninst✝ : CommSemigroup β\nf g : α → β\nhf : IsMulHom f\nhg : IsMulHom g\na b : α\n⊢ f (a * b) * g (a * b) = f a * g a * (f b * g b)\n[PROOFSTEP]\nsimp only [hf.map_mul, hg.map_mul, mul_comm, mul_assoc, mul_left_comm]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : MulOneClass α\ninst✝ : Group β\nf : α → β\nhf : IsMulHom f\n⊢ ?m.13736 hf * f 1 = ?m.13736 hf\n[PROOFSTEP]\nrw [← hf.map_mul, one_mul]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝² : MulOneClass α\ninst✝¹ : MulOneClass β\nf : α → β\nhf : IsMonoidHom f\nγ : Type u_1\ninst✝ : MulOneClass γ\ng : β → γ\nhg : IsMonoidHom g\nsrc✝ : IsMulHom (g ∘ f) := IsMulHom.comp hf.toIsMulHom hg.toIsMulHom\n⊢ g (f 1) = 1\n[PROOFSTEP]\nrw [hf.map_one, hg.map_one]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : Group α\ninst✝ : Group β\nf : α → β\nhf✝ hf : IsGroupHom f\na : α\n⊢ f a⁻¹ * f a = 1\n[PROOFSTEP]\nrw [← hf.map_mul, inv_mul_self, hf.map_one]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : Group α\ninst✝ : Group β\nf : α → β\nhf✝ hf : IsGroupHom f\na b : α\n⊢ f (a / b) = f a / f b\n[PROOFSTEP]\nsimp_rw [div_eq_mul_inv, hf.map_mul, hf.map_inv]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : Group α\ninst✝ : Group β\nf✝ : α → β\nhf✝ : IsGroupHom f✝\nf : α → β\nhf : IsGroupHom f\nh : Function.Injective f\nx✝ : α\n⊢ f x✝ = 1 → x✝ = 1\n[PROOFSTEP]\nrw [← hf.map_one]\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : Group α\ninst✝ : Group β\nf✝ : α → β\nhf✝ : IsGroupHom f✝\nf : α → β\nhf : IsGroupHom f\nh : Function.Injective f\nx✝ : α\n⊢ f x✝ = f 1 → x✝ = 1\n[PROOFSTEP]\nexact @h _ _\n[GOAL]\nα : Type u\nβ : Type v\ninst✝¹ : Group α\ninst✝ : Group β\nf✝ : α → β\nhf✝ : IsGroupHom f✝\nf : α → β\nhf : IsGroupHom f\nh : ∀ (a : α), f a = 1 → a = 1\nx y : α\nhxy : f x = f y\n⊢ f (x / y) = 1\n[PROOFSTEP]\nrwa [hf.map_div, div_eq_one]\n[GOAL]\nα✝ : Type u\nβ✝ : Type v\nα : Type u_1\nβ : Type u_2\ninst✝¹ : AddGroup α\ninst✝ : AddCommGroup β\nf g : α → β\nhf : IsAddGroupHom f\nhg : IsAddGroupHom g\n⊢ IsAddGroupHom fun a => f a - g a\n[PROOFSTEP]\nsimpa only [sub_eq_add_neg] using hf.add hg.neg\n", "meta": {"mathlib_filename": "Mathlib.Deprecated.Group", "llama_tokens": 1325, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8705972583359805, "lm_q2_score": 0.7549149868676283, "lm_q1q2_score": 0.6572269178436998}} {"text": "[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf : ι → ℝ\ng : ι' → ℝ\nhf : Summable f\nhg : Summable g\nhf' : 0 ≤ f\nhg' : 0 ≤ g\n⊢ Summable fun x => ∑' (y : ι'), f (x, y).fst * g (x, y).snd\n[PROOFSTEP]\nsimpa only [hg.tsum_mul_left _] using hf.mul_right (∑' x, g x)\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\n⊢ Summable fun n => ‖∑ kl in antidiagonal n, f kl.fst * g kl.snd‖\n[PROOFSTEP]\nhave :=\n summable_sum_mul_antidiagonal_of_summable_mul\n (Summable.mul_of_nonneg hf hg (fun _ => norm_nonneg _) fun _ => norm_nonneg _)\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\nthis : Summable fun n => ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\n⊢ Summable fun n => ‖∑ kl in antidiagonal n, f kl.fst * g kl.snd‖\n[PROOFSTEP]\nrefine' summable_of_nonneg_of_le (fun _ => norm_nonneg _) _ this\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\nthis : Summable fun n => ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\n⊢ ∀ (b : ℕ), ‖∑ kl in antidiagonal b, f kl.fst * g kl.snd‖ ≤ ∑ kl in antidiagonal b, ‖f kl.fst‖ * ‖g kl.snd‖\n[PROOFSTEP]\nintro n\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\nthis : Summable fun n => ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\nn : ℕ\n⊢ ‖∑ kl in antidiagonal n, f kl.fst * g kl.snd‖ ≤ ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\n[PROOFSTEP]\ncalc\n ‖∑ kl in antidiagonal n, f kl.1 * g kl.2‖ ≤ ∑ kl in antidiagonal n, ‖f kl.1 * g kl.2‖ := norm_sum_le _ _\n _ ≤ ∑ kl in antidiagonal n, ‖f kl.1‖ * ‖g kl.2‖ := by gcongr; apply norm_mul_le\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\nthis : Summable fun n => ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\nn : ℕ\n⊢ ∑ kl in antidiagonal n, ‖f kl.fst * g kl.snd‖ ≤ ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\n[PROOFSTEP]\ngcongr\n[GOAL]\ncase h\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\nthis : Summable fun n => ∑ kl in antidiagonal n, ‖f kl.fst‖ * ‖g kl.snd‖\nn : ℕ\ni✝ : ℕ × ℕ\na✝ : i✝ ∈ antidiagonal n\n⊢ ‖f i✝.fst * g i✝.snd‖ ≤ ‖f i✝.fst‖ * ‖g i✝.snd‖\n[PROOFSTEP]\napply norm_mul_le\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\n⊢ Summable fun n => ‖∑ k in range (n + 1), f k * g (n - k)‖\n[PROOFSTEP]\nsimp_rw [← sum_antidiagonal_eq_sum_range_succ fun k l => f k * g l]\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝ : NormedRing R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\n⊢ Summable fun n => ‖∑ ij in antidiagonal n, f ij.fst * g ij.snd‖\n[PROOFSTEP]\nexact summable_norm_sum_mul_antidiagonal_of_summable_norm hf hg\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝¹ : NormedRing R\ninst✝ : CompleteSpace R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\n⊢ (∑' (n : ℕ), f n) * ∑' (n : ℕ), g n = ∑' (n : ℕ), ∑ k in range (n + 1), f k * g (n - k)\n[PROOFSTEP]\nsimp_rw [← sum_antidiagonal_eq_sum_range_succ fun k l => f k * g l]\n[GOAL]\nR : Type u_1\nι : Type u_2\nι' : Type u_3\ninst✝¹ : NormedRing R\ninst✝ : CompleteSpace R\nf g : ℕ → R\nhf : Summable fun x => ‖f x‖\nhg : Summable fun x => ‖g x‖\n⊢ (∑' (n : ℕ), f n) * ∑' (n : ℕ), g n = ∑' (n : ℕ), ∑ ij in antidiagonal n, f ij.fst * g ij.snd\n[PROOFSTEP]\nexact tsum_mul_tsum_eq_tsum_sum_antidiagonal_of_summable_norm hf hg\n", "meta": {"mathlib_filename": "Mathlib.Analysis.Normed.Field.InfiniteSum", "llama_tokens": 2024, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8840392817460333, "lm_q2_score": 0.743167997235783, "lm_q1q2_score": 0.6569897024929596}} {"text": "[GOAL]\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\n⊢ IsLocalMaxOn f (closure s) a\n[PROOFSTEP]\nrcases mem_nhdsWithin.1 h with ⟨U, Uo, aU, hU⟩\n[GOAL]\ncase intro.intro.intro\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\n⊢ IsLocalMaxOn f (closure s) a\n[PROOFSTEP]\nrefine' mem_nhdsWithin.2 ⟨U, Uo, aU, _⟩\n[GOAL]\ncase intro.intro.intro\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\n⊢ U ∩ closure s ⊆ {x | (fun x => f x ≤ f a) x}\n[PROOFSTEP]\nrintro x ⟨hxU, hxs⟩\n[GOAL]\ncase intro.intro.intro.intro\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\nx : X\nhxU : x ∈ U\nhxs : x ∈ closure s\n⊢ x ∈ {x | (fun x => f x ≤ f a) x}\n[PROOFSTEP]\nrefine' ContinuousWithinAt.closure_le _ _ continuousWithinAt_const hU\n[GOAL]\ncase intro.intro.intro.intro.refine'_1\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\nx : X\nhxU : x ∈ U\nhxs : x ∈ closure s\n⊢ x ∈ closure (U ∩ s)\n[PROOFSTEP]\nrwa [mem_closure_iff_nhdsWithin_neBot, nhdsWithin_inter_of_mem, ← mem_closure_iff_nhdsWithin_neBot]\n[GOAL]\ncase intro.intro.intro.intro.refine'_1\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\nx : X\nhxU : x ∈ U\nhxs : x ∈ closure s\n⊢ U ∈ 𝓝[s] x\n[PROOFSTEP]\nexact nhdsWithin_le_nhds (Uo.mem_nhds hxU)\n[GOAL]\ncase intro.intro.intro.intro.refine'_2\nX : Type u_1\nY : Type u_2\ninst✝³ : TopologicalSpace X\ninst✝² : TopologicalSpace Y\ninst✝¹ : Preorder Y\ninst✝ : OrderClosedTopology Y\nf g : X → Y\ns : Set X\na : X\nh : IsLocalMaxOn f s a\nhc : ContinuousOn f (closure s)\nU : Set X\nUo : IsOpen U\naU : a ∈ U\nhU : U ∩ s ⊆ {x | (fun x => f x ≤ f a) x}\nx : X\nhxU : x ∈ U\nhxs : x ∈ closure s\n⊢ ContinuousWithinAt f (U ∩ s) x\n[PROOFSTEP]\nexact (hc _ hxs).mono ((inter_subset_right _ _).trans subset_closure)\n", "meta": {"mathlib_filename": "Mathlib.Topology.Algebra.Order.ExtrClosure", "llama_tokens": 1493, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.863391617003942, "lm_q2_score": 0.7606506526772884, "lm_q1q2_score": 0.6567393969901478}} {"text": "[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nh₀ : x 0 ≤ y 0\nhx : ∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\n⊢ x n ≤ y n\n[PROOFSTEP]\ninduction' n with n ihn\n[GOAL]\ncase zero\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)\nhy✝ : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\nhx : ∀ (k : ℕ), k < Nat.zero → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < Nat.zero → f (y k) ≤ y (k + 1)\n⊢ x Nat.zero ≤ y Nat.zero\n[PROOFSTEP]\nexact h₀\n[GOAL]\ncase succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) ≤ f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : (∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n ≤ y n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ x (Nat.succ n) ≤ y (Nat.succ n)\n[PROOFSTEP]\nrefine' (hx _ n.lt_succ_self).trans ((hf $ ihn _ _).trans (hy _ n.lt_succ_self))\n[GOAL]\ncase succ.refine'_1\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) ≤ f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : (∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n ≤ y n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ ∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)\ncase succ.refine'_2\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) ≤ f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : (∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n ≤ y n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\n[PROOFSTEP]\nexact fun k hk => hx _ (hk.trans n.lt_succ_self)\n[GOAL]\ncase succ.refine'_2\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) ≤ f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : (∀ (k : ℕ), k < n → x (k + 1) ≤ f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n ≤ y n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) ≤ f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\n[PROOFSTEP]\nexact fun k hk => hy _ (hk.trans n.lt_succ_self)\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nhn : 0 < n\nh₀ : x 0 ≤ y 0\nhx : ∀ (k : ℕ), k < n → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\n⊢ x n < y n\n[PROOFSTEP]\ninduction' n with n ihn\n[GOAL]\ncase zero\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nhn✝ : 0 < n\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\nhn : 0 < Nat.zero\nhx : ∀ (k : ℕ), k < Nat.zero → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.zero → f (y k) ≤ y (k + 1)\n⊢ x Nat.zero < y Nat.zero\n[PROOFSTEP]\nexact hn.false.elim\n[GOAL]\ncase succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : 0 < n → (∀ (k : ℕ), k < n → x (k + 1) < f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n < y n\nhn : 0 < Nat.succ n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ x (Nat.succ n) < y (Nat.succ n)\n[PROOFSTEP]\nsuffices x n ≤ y n from (hx n n.lt_succ_self).trans_le ((hf this).trans $ hy n n.lt_succ_self)\n[GOAL]\ncase succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : 0 < n → (∀ (k : ℕ), k < n → x (k + 1) < f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n < y n\nhn : 0 < Nat.succ n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ x n ≤ y n\n[PROOFSTEP]\ncases n with\n| zero => exact h₀\n| succ n =>\n refine' (ihn n.zero_lt_succ (fun k hk => hx _ _) fun k hk => hy _ _).le <;> exact hk.trans n.succ.lt_succ_self\n[GOAL]\ncase succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn : 0 < n → (∀ (k : ℕ), k < n → x (k + 1) < f (x k)) → (∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)) → x n < y n\nhn : 0 < Nat.succ n\nhx : ∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)\n⊢ x n ≤ y n\n[PROOFSTEP]\ncases n with\n| zero => exact h₀\n| succ n =>\n refine' (ihn n.zero_lt_succ (fun k hk => hx _ _) fun k hk => hy _ _).le <;> exact hk.trans n.succ.lt_succ_self\n[GOAL]\ncase succ.zero\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nhn✝ : 0 < n\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\nihn :\n 0 < Nat.zero →\n (∀ (k : ℕ), k < Nat.zero → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.zero → f (y k) ≤ y (k + 1)) → x Nat.zero < y Nat.zero\nhn : 0 < Nat.succ Nat.zero\nhx : ∀ (k : ℕ), k < Nat.succ Nat.zero → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ Nat.zero → f (y k) ≤ y (k + 1)\n⊢ x Nat.zero ≤ y Nat.zero\n[PROOFSTEP]\n\n| zero => exact h₀\n[GOAL]\ncase succ.zero\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nhn✝ : 0 < n\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\nihn :\n 0 < Nat.zero →\n (∀ (k : ℕ), k < Nat.zero → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.zero → f (y k) ≤ y (k + 1)) → x Nat.zero < y Nat.zero\nhn : 0 < Nat.succ Nat.zero\nhx : ∀ (k : ℕ), k < Nat.succ Nat.zero → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ Nat.zero → f (y k) ≤ y (k + 1)\n⊢ x Nat.zero ≤ y Nat.zero\n[PROOFSTEP]\nexact h₀\n[GOAL]\ncase succ.succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn :\n 0 < Nat.succ n →\n (∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)) → x (Nat.succ n) < y (Nat.succ n)\nhn : 0 < Nat.succ (Nat.succ n)\nhx : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → f (y k) ≤ y (k + 1)\n⊢ x (Nat.succ n) ≤ y (Nat.succ n)\n[PROOFSTEP]\n\n| succ n =>\n refine' (ihn n.zero_lt_succ (fun k hk => hx _ _) fun k hk => hy _ _).le <;> exact hk.trans n.succ.lt_succ_self\n[GOAL]\ncase succ.succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn :\n 0 < Nat.succ n →\n (∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)) → x (Nat.succ n) < y (Nat.succ n)\nhn : 0 < Nat.succ (Nat.succ n)\nhx : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → f (y k) ≤ y (k + 1)\n⊢ x (Nat.succ n) ≤ y (Nat.succ n)\n[PROOFSTEP]\nrefine' (ihn n.zero_lt_succ (fun k hk => hx _ _) fun k hk => hy _ _).le\n[GOAL]\ncase succ.succ.refine'_1\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn :\n 0 < Nat.succ n →\n (∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)) → x (Nat.succ n) < y (Nat.succ n)\nhn : 0 < Nat.succ (Nat.succ n)\nhx : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → f (y k) ≤ y (k + 1)\nk : ℕ\nhk : k < Nat.succ n\n⊢ k < Nat.succ (Nat.succ n)\n[PROOFSTEP]\nexact hk.trans n.succ.lt_succ_self\n[GOAL]\ncase succ.succ.refine'_2\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn✝ : ℕ\nhn✝ : 0 < n✝\nh₀ : x 0 ≤ y 0\nhx✝ : ∀ (k : ℕ), k < n✝ → x (k + 1) < f (x k)\nhy✝ : ∀ (k : ℕ), k < n✝ → f (y k) ≤ y (k + 1)\nn : ℕ\nihn :\n 0 < Nat.succ n →\n (∀ (k : ℕ), k < Nat.succ n → x (k + 1) < f (x k)) →\n (∀ (k : ℕ), k < Nat.succ n → f (y k) ≤ y (k + 1)) → x (Nat.succ n) < y (Nat.succ n)\nhn : 0 < Nat.succ (Nat.succ n)\nhx : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ (Nat.succ n) → f (y k) ≤ y (k + 1)\nk : ℕ\nhk : k < Nat.succ n\n⊢ k < Nat.succ (Nat.succ n)\n[PROOFSTEP]\nexact hk.trans n.succ.lt_succ_self\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nn : ℕ\nh₀ : x 0 < y 0\nhx : ∀ (k : ℕ), k < n → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < n → f (y k) ≤ y (k + 1)\n⊢ x n < y n\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nh₀ : x 0 < y 0\nhx : ∀ (k : ℕ), k < Nat.zero → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.zero → f (y k) ≤ y (k + 1)\n⊢ x Nat.zero < y Nat.zero\ncase succ\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx y : ℕ → α\nhf : Monotone f\nh₀ : x 0 < y 0\nn✝ : ℕ\nhx : ∀ (k : ℕ), k < Nat.succ n✝ → x (k + 1) < f (x k)\nhy : ∀ (k : ℕ), k < Nat.succ n✝ → f (y k) ≤ y (k + 1)\n⊢ x (Nat.succ n✝) < y (Nat.succ n✝)\n[PROOFSTEP]\nexacts [h₀, hf.seq_pos_lt_seq_of_lt_of_le (Nat.zero_lt_succ _) h₀.le hx hy]\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\n⊢ (h ∘ g^[n]) x ≤ (f^[n] ∘ h) x\n[PROOFSTEP]\napply hf.seq_le_seq n\n[GOAL]\ncase h₀\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\n⊢ (h ∘ g^[0]) x ≤ (f^[0] ∘ h) x\n[PROOFSTEP]\nintros\n[GOAL]\ncase hx\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\n⊢ ∀ (k : ℕ), k < n → (h ∘ g^[k + 1]) x ≤ f ((h ∘ g^[k]) x)\n[PROOFSTEP]\nintros\n[GOAL]\ncase hy\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\n⊢ ∀ (k : ℕ), k < n → f ((f^[k] ∘ h) x) ≤ (f^[k + 1] ∘ h) x\n[PROOFSTEP]\nintros\n[GOAL]\ncase h₀\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\n⊢ (h ∘ g^[0]) x ≤ (f^[0] ∘ h) x\n[PROOFSTEP]\nsimp [iterate_succ', -iterate_succ, comp_apply, id_eq, le_refl]\n[GOAL]\ncase hx\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\nk✝ : ℕ\na✝ : k✝ < n\n⊢ (h ∘ g^[k✝ + 1]) x ≤ f ((h ∘ g^[k✝]) x)\n[PROOFSTEP]\nsimp [iterate_succ', -iterate_succ, comp_apply, id_eq, le_refl]\n[GOAL]\ncase hy\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\nk✝ : ℕ\na✝ : k✝ < n\n⊢ f ((f^[k✝] ∘ h) x) ≤ (f^[k✝ + 1] ∘ h) x\n[PROOFSTEP]\nsimp [iterate_succ', -iterate_succ, comp_apply, id_eq, le_refl]\n[GOAL]\ncase hx\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\nk✝ : ℕ\na✝ : k✝ < n\n⊢ h (g (g^[k✝] x)) ≤ f (h (g^[k✝] x))\n[PROOFSTEP]\ncase hx => exact H _\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\nk✝ : ℕ\na✝ : k✝ < n\n⊢ h (g (g^[k✝] x)) ≤ f (h (g^[k✝] x))\n[PROOFSTEP]\ncase hx => exact H _\n[GOAL]\nα : Type u_1\nβ : Type u_2\ninst✝ : Preorder α\nf : α → α\nx✝ y : ℕ → α\ng : β → β\nh : β → α\nhf : Monotone f\nH : h ∘ g ≤ f ∘ h\nn : ℕ\nx : β\nk✝ : ℕ\na✝ : k✝ < n\n⊢ h (g (g^[k✝] x)) ≤ f (h (g^[k✝] x))\n[PROOFSTEP]\nexact H _\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nh : id ≤ f\nn : ℕ\n⊢ id ≤ f^[n]\n[PROOFSTEP]\nsimpa only [iterate_id] using monotone_id.iterate_le_of_le h n\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nh : id ≤ f\nn : ℕ\nx : α\n⊢ f^[n] x ≤ f^[n + 1] x\n[PROOFSTEP]\nrw [iterate_succ_apply']\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nh : id ≤ f\nn : ℕ\nx : α\n⊢ f^[n] x ≤ f (f^[n] x)\n[PROOFSTEP]\nexact h _\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn : ℕ\n⊢ f^[n] x ≤ g^[n] x\n[PROOFSTEP]\napply hf.seq_le_seq n\n[GOAL]\ncase h₀\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn : ℕ\n⊢ f^[0] x ≤ g^[0] x\n[PROOFSTEP]\nrfl\n[GOAL]\ncase hx\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn : ℕ\n⊢ ∀ (k : ℕ), k < n → f^[k + 1] x ≤ f (f^[k] x)\n[PROOFSTEP]\nintros\n[GOAL]\ncase hx\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn k✝ : ℕ\na✝ : k✝ < n\n⊢ f^[k✝ + 1] x ≤ f (f^[k✝] x)\n[PROOFSTEP]\nrw [iterate_succ_apply']\n[GOAL]\ncase hy\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn : ℕ\n⊢ ∀ (k : ℕ), k < n → f (g^[k] x) ≤ g^[k + 1] x\n[PROOFSTEP]\nintros\n[GOAL]\ncase hy\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : Monotone g\nx : α\nhx : f x ≤ g x\nn k✝ : ℕ\na✝ : k✝ < n\n⊢ f (g^[k✝] x) ≤ g^[k✝ + 1] x\n[PROOFSTEP]\nsimp [h.iterate_right _ _, hg.iterate _ hx]\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\n⊢ f^[n] x < g^[n] x\n[PROOFSTEP]\napply hf.seq_pos_lt_seq_of_le_of_lt hn\n[GOAL]\ncase h₀\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\n⊢ f^[0] x ≤ g^[0] x\n[PROOFSTEP]\nrfl\n[GOAL]\ncase hx\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\n⊢ ∀ (k : ℕ), k < n → f^[k + 1] x ≤ f (f^[k] x)\n[PROOFSTEP]\nintros\n[GOAL]\ncase hx\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\nk✝ : ℕ\na✝ : k✝ < n\n⊢ f^[k✝ + 1] x ≤ f (f^[k✝] x)\n[PROOFSTEP]\nrw [iterate_succ_apply']\n[GOAL]\ncase hy\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\n⊢ ∀ (k : ℕ), k < n → f (g^[k] x) < g^[k + 1] x\n[PROOFSTEP]\nintros\n[GOAL]\ncase hy\nα : Type u_1\ninst✝ : Preorder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nhx : f x < g x\nn : ℕ\nhn : 0 < n\nk✝ : ℕ\na✝ : k✝ < n\n⊢ f (g^[k✝] x) < g^[k✝ + 1] x\n[PROOFSTEP]\nsimp [h.iterate_right _ _, hg.iterate _ hx]\n[GOAL]\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\n⊢ f^[n] x < g^[n] x ↔ f x < g x\n[PROOFSTEP]\nrcases lt_trichotomy (f x) (g x) with (H | H | H)\n[GOAL]\ncase inl\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\nH : f x < g x\n⊢ f^[n] x < g^[n] x ↔ f x < g x\n[PROOFSTEP]\nsimp only [*, iterate_pos_lt_of_map_lt]\n[GOAL]\ncase inr.inl\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\nH : f x = g x\n⊢ f^[n] x < g^[n] x ↔ f x < g x\n[PROOFSTEP]\nsimp only [*, h.iterate_eq_of_map_eq, lt_irrefl]\n[GOAL]\ncase inr.inr\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\nH : g x < f x\n⊢ f^[n] x < g^[n] x ↔ f x < g x\n[PROOFSTEP]\nsimp only [lt_asymm H, lt_asymm (h.symm.iterate_pos_lt_of_map_lt' hg hf H hn)]\n[GOAL]\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\n⊢ f^[n] x ≤ g^[n] x ↔ f x ≤ g x\n[PROOFSTEP]\nsimpa only [not_lt] using not_congr (h.symm.iterate_pos_lt_iff_map_lt' hg hf hn)\n[GOAL]\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : StrictMono f\nhg : Monotone g\nx : α\nn : ℕ\nhn : 0 < n\n⊢ f^[n] x ≤ g^[n] x ↔ f x ≤ g x\n[PROOFSTEP]\nsimpa only [not_lt] using not_congr (h.symm.iterate_pos_lt_iff_map_lt hg hf hn)\n[GOAL]\nα : Type u_1\ninst✝ : LinearOrder α\nf g : α → α\nh : Commute f g\nhf : Monotone f\nhg : StrictMono g\nx : α\nn : ℕ\nhn : 0 < n\n⊢ f^[n] x = g^[n] x ↔ f x = g x\n[PROOFSTEP]\nsimp only [le_antisymm_iff, h.iterate_pos_le_iff_map_le hf hg hn, h.symm.iterate_pos_le_iff_map_le' hg hf hn]\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx : α\nhf : Monotone f\nhx : x ≤ f x\nn : ℕ\n⊢ f^[n] x ≤ f^[n + 1] x\n[PROOFSTEP]\nrw [iterate_succ_apply]\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx : α\nhf : Monotone f\nhx : x ≤ f x\nn : ℕ\n⊢ f^[n] x ≤ f^[n] (f x)\n[PROOFSTEP]\nexact hf.iterate n hx\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx : α\nhf : StrictMono f\nhx : x < f x\nn : ℕ\n⊢ f^[n] x < f^[n + 1] x\n[PROOFSTEP]\nrw [iterate_succ_apply]\n[GOAL]\nα : Type u_1\ninst✝ : Preorder α\nf : α → α\nx : α\nhf : StrictMono f\nhx : x < f x\nn : ℕ\n⊢ f^[n] x < f^[n] (f x)\n[PROOFSTEP]\nexact hf.iterate n hx\n", "meta": {"mathlib_filename": "Mathlib.Order.Iterate", "llama_tokens": 10646, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8596637577007394, "lm_q2_score": 0.7634837581726991, "lm_q1q2_score": 0.6563393164942252}} {"text": "[GOAL]\nn : ℕ\n⊢ 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) < π\n[PROOFSTEP]\nhave : sqrt (2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) * (2 : ℝ) ^ (n + 2) < π :=\n by\n rw [← lt_div_iff, ← sin_pi_over_two_pow_succ]; apply sin_lt; apply div_pos pi_pos\n all_goals apply pow_pos; norm_num\n[GOAL]\nn : ℕ\n⊢ sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) < π\n[PROOFSTEP]\nrw [← lt_div_iff, ← sin_pi_over_two_pow_succ]\n[GOAL]\nn : ℕ\n⊢ sin (π / 2 ^ (n + 2)) < π / 2 ^ (n + 2)\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply sin_lt\n[GOAL]\ncase h\nn : ℕ\n⊢ 0 < π / 2 ^ (n + 2)\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply div_pos pi_pos\n[GOAL]\ncase h\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nall_goals apply pow_pos; norm_num\n[GOAL]\ncase h\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase h.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\nthis : sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) < π\n⊢ 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) < π\n[PROOFSTEP]\napply lt_of_le_of_lt (le_of_eq _) this\n[GOAL]\nn : ℕ\nthis : sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) < π\n⊢ 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) = sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2)\n[PROOFSTEP]\nrw [pow_succ _ (n + 1), ← mul_assoc, div_mul_cancel, mul_comm]\n[GOAL]\ncase h\nn : ℕ\nthis : sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) < π\n⊢ 2 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\n⊢ π < 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) + 1 / 4 ^ n\n[PROOFSTEP]\nhave : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / (2 : ℝ) + (1 : ℝ) / ((2 : ℝ) ^ n) ^ 3 / 4) * (2 : ℝ) ^ (n + 2) :=\n by\n rw [← div_lt_iff, ← sin_pi_over_two_pow_succ]\n refine' lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube _ _)) _\n · apply div_pos pi_pos; apply pow_pos; norm_num\n · rw [div_le_iff']\n · refine' le_trans pi_le_four _\n simp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one]\n apply pow_le_pow; norm_num; apply le_add_of_nonneg_left; apply Nat.zero_le\n · apply pow_pos; norm_num\n apply add_le_add_left; rw [div_le_div_right]\n rw [le_div_iff, ← mul_pow]\n refine' le_trans _ (le_of_eq (one_pow 3)); apply pow_le_pow_of_le_left\n · apply le_of_lt; apply mul_pos; apply div_pos pi_pos; apply pow_pos; norm_num; apply pow_pos\n norm_num\n rw [← le_div_iff]\n refine' le_trans ((div_le_div_right _).mpr pi_le_four) _; apply pow_pos; norm_num\n rw [pow_succ, pow_succ, ← mul_assoc, ← div_div]\n -- Porting note: removed `convert le_rfl`\n all_goals (repeat' apply pow_pos); norm_num\n[GOAL]\nn : ℕ\n⊢ π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n[PROOFSTEP]\nrw [← div_lt_iff, ← sin_pi_over_two_pow_succ]\n[GOAL]\nn : ℕ\n⊢ π / 2 ^ (n + 2) < sin (π / 2 ^ (n + 2)) + 1 / (2 ^ n) ^ 3 / 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrefine' lt_of_lt_of_le (lt_add_of_sub_right_lt (sin_gt_sub_cube _ _)) _\n[GOAL]\ncase refine'_1\nn : ℕ\n⊢ 0 < π / 2 ^ (n + 2)\n[PROOFSTEP]\napply div_pos pi_pos\n[GOAL]\ncase refine'_1\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_1.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_2\nn : ℕ\n⊢ π / 2 ^ (n + 2) ≤ 1\n[PROOFSTEP]\nrw [div_le_iff']\n[GOAL]\ncase refine'_2\nn : ℕ\n⊢ π ≤ 2 ^ (n + 2) * 1\n[PROOFSTEP]\nrefine' le_trans pi_le_four _\n[GOAL]\ncase refine'_2\nn : ℕ\n⊢ 4 ≤ 2 ^ (n + 2) * 1\n[PROOFSTEP]\nsimp only [show (4 : ℝ) = (2 : ℝ) ^ 2 by norm_num, mul_one]\n[GOAL]\nn : ℕ\n⊢ 4 = 2 ^ 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_2\nn : ℕ\n⊢ 2 ^ 2 ≤ 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_le_pow\n[GOAL]\ncase refine'_2.ha\nn : ℕ\n⊢ 1 ≤ 2\ncase refine'_2.h n : ℕ ⊢ 2 ≤ n + 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_2.h\nn : ℕ\n⊢ 2 ≤ n + 2\n[PROOFSTEP]\napply le_add_of_nonneg_left\n[GOAL]\ncase refine'_2.h.h\nn : ℕ\n⊢ 0 ≤ n\n[PROOFSTEP]\napply Nat.zero_le\n[GOAL]\ncase refine'_2\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_2.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3\nn : ℕ\n⊢ sin (π / 2 ^ (n + 2)) + (π / 2 ^ (n + 2)) ^ 3 / 4 ≤ sin (π / 2 ^ (n + 2)) + 1 / (2 ^ n) ^ 3 / 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply add_le_add_left\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ (π / 2 ^ (n + 2)) ^ 3 / 4 ≤ 1 / (2 ^ n) ^ 3 / 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrw [div_le_div_right]\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ (π / 2 ^ (n + 2)) ^ 3 ≤ 1 / (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrw [le_div_iff, ← mul_pow]\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ (π / 2 ^ (n + 2) * 2 ^ n) ^ 3 ≤ 1\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrefine' le_trans _ (le_of_eq (one_pow 3))\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ (π / 2 ^ (n + 2) * 2 ^ n) ^ 3 ≤ 1 ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_le_pow_of_le_left\n[GOAL]\ncase refine'_3.bc.ha\nn : ℕ\n⊢ 0 ≤ π / 2 ^ (n + 2) * 2 ^ n\n[PROOFSTEP]\napply le_of_lt\n[GOAL]\ncase refine'_3.bc.ha.a\nn : ℕ\n⊢ 0 < π / 2 ^ (n + 2) * 2 ^ n\n[PROOFSTEP]\napply mul_pos\n[GOAL]\ncase refine'_3.bc.ha.a.ha\nn : ℕ\n⊢ 0 < π / 2 ^ (n + 2)\ncase refine'_3.bc.ha.a.hb n : ℕ ⊢ 0 < 2 ^ n\n[PROOFSTEP]\napply div_pos pi_pos\n[GOAL]\ncase refine'_3.bc.ha.a.ha\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\ncase refine'_3.bc.ha.a.hb n : ℕ ⊢ 0 < 2 ^ n\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.ha.a.ha.H\nn : ℕ\n⊢ 0 < 2\ncase refine'_3.bc.ha.a.hb n : ℕ ⊢ 0 < 2 ^ n\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc.ha.a.hb\nn : ℕ\n⊢ 0 < 2 ^ n\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.ha.a.hb.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc.hab\nn : ℕ\n⊢ π / 2 ^ (n + 2) * 2 ^ n ≤ 1\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrw [← le_div_iff]\n[GOAL]\ncase refine'_3.bc.hab\nn : ℕ\n⊢ π / 2 ^ (n + 2) ≤ 1 / 2 ^ n\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrefine' le_trans ((div_le_div_right _).mpr pi_le_four) _\n[GOAL]\ncase refine'_3.bc.hab.refine'_1\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / 2 ^ (n + 2) ≤ 1 / 2 ^ n\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.hab.refine'_1.H\nn : ℕ\n⊢ 0 < 2\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / 2 ^ (n + 2) ≤ 1 / 2 ^ n\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / 2 ^ (n + 2) ≤ 1 / 2 ^ n\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrw [pow_succ, pow_succ, ← mul_assoc, ← div_div]\n -- Porting note: removed `convert le_rfl`\n[GOAL]\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / (2 * 2) / 2 ^ n ≤ 1 / 2 ^ n\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\nn : ℕ ⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nall_goals (repeat' apply pow_pos); norm_num\n[GOAL]\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / (2 * 2) / 2 ^ n ≤ 1 / 2 ^ n\n[PROOFSTEP]\nrepeat' apply pow_pos\n[GOAL]\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / (2 * 2) / 2 ^ n ≤ 1 / 2 ^ n\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.hab.refine'_2\nn : ℕ\n⊢ 4 / (2 * 2) / 2 ^ n ≤ 1 / 2 ^ n\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\n[PROOFSTEP]\nrepeat' apply pow_pos\n[GOAL]\ncase refine'_3.bc.hab\nn : ℕ\n⊢ 0 < 2 ^ n\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.hab.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.hab.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\n[PROOFSTEP]\nrepeat' apply pow_pos\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < (2 ^ n) ^ 3\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.H\nn : ℕ\n⊢ 0 < 2 ^ n\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.H.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc.H.H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\n[PROOFSTEP]\nrepeat' apply pow_pos\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase refine'_3.bc\nn : ℕ\n⊢ 0 < 4\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\nrepeat' apply pow_pos\n[GOAL]\nn : ℕ\n⊢ 0 < 2 ^ (n + 2)\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\napply pow_pos\n[GOAL]\ncase H\nn : ℕ\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ π < 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) + 1 / 4 ^ n\n[PROOFSTEP]\napply lt_of_lt_of_le this (le_of_eq _)\n[GOAL]\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2) =\n 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) + 1 / 4 ^ n\n[PROOFSTEP]\nrw [add_mul]\n[GOAL]\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) + 1 / (2 ^ n) ^ 3 / 4 * 2 ^ (n + 2) =\n 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) + 1 / 4 ^ n\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase e_a\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ sqrt (2 - sqrtTwoAddSeries 0 n) / 2 * 2 ^ (n + 2) = 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n)\n[PROOFSTEP]\nrw [pow_succ _ (n + 1), ← mul_assoc, div_mul_cancel, mul_comm]\n[GOAL]\ncase e_a.h\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 2 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase e_a\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 1 / (2 ^ n) ^ 3 / 4 * 2 ^ (n + 2) = 1 / 4 ^ n\n[PROOFSTEP]\nrw [pow_succ, ← pow_mul, mul_comm n 2, pow_mul, show (2 : ℝ) ^ 2 = 4 by norm_num, pow_succ, pow_succ, ←\n mul_assoc (2 : ℝ), show (2 : ℝ) * 2 = 4 by norm_num, ← mul_assoc, div_mul_cancel, mul_comm ((2 : ℝ) ^ n), ← div_div,\n div_mul_cancel]\n[GOAL]\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 2 ^ 2 = 4\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 2 * 2 = 4\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase e_a.h\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 2 ^ n ≠ 0\ncase e_a.h n : ℕ this : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2) ⊢ 4 ≠ 0\n[PROOFSTEP]\napply pow_ne_zero\n[GOAL]\ncase e_a.h.h\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 2 ≠ 0\ncase e_a.h n : ℕ this : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2) ⊢ 4 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\ncase e_a.h\nn : ℕ\nthis : π < (sqrt (2 - sqrtTwoAddSeries 0 n) / 2 + 1 / (2 ^ n) ^ 3 / 4) * 2 ^ (n + 2)\n⊢ 4 ≠ 0\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ a < π\n[PROOFSTEP]\nrefine' lt_of_le_of_lt _ (pi_gt_sqrtTwoAddSeries n)\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ a ≤ 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n)\n[PROOFSTEP]\nrw [mul_comm]\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ a ≤ sqrt (2 - sqrtTwoAddSeries 0 n) * 2 ^ (n + 1)\n[PROOFSTEP]\nrefine' (div_le_iff (pow_pos (by norm_num) _ : (0 : ℝ) < _)).mp (le_sqrt_of_sq_le _)\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ 0 < 2\n[PROOFSTEP]\nnorm_num\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ (a / 2 ^ (n + 1)) ^ 2 ≤ 2 - sqrtTwoAddSeries 0 n\n[PROOFSTEP]\nrwa [le_sub_comm, show (0 : ℝ) = (0 : ℕ) / (1 : ℕ) by rw [Nat.cast_zero, zero_div]]\n[GOAL]\nn : ℕ\na : ℝ\nh : sqrtTwoAddSeries (↑0 / ↑1) n ≤ 2 - (a / 2 ^ (n + 1)) ^ 2\n⊢ 0 = ↑0 / ↑1\n[PROOFSTEP]\nrw [Nat.cast_zero, zero_div]\n[GOAL]\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\n⊢ sqrtTwoAddSeries (↑a / ↑b) (n + 1) ≤ z\n[PROOFSTEP]\nrefine' le_trans _ hz\n[GOAL]\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\n⊢ sqrtTwoAddSeries (↑a / ↑b) (n + 1) ≤ sqrtTwoAddSeries (↑c / ↑d) n\n[PROOFSTEP]\nrw [sqrtTwoAddSeries_succ]\n[GOAL]\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\n⊢ sqrtTwoAddSeries (sqrt (2 + ↑a / ↑b)) n ≤ sqrtTwoAddSeries (↑c / ↑d) n\n[PROOFSTEP]\napply sqrtTwoAddSeries_monotone_left\n[GOAL]\ncase h\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\n⊢ sqrt (2 + ↑a / ↑b) ≤ ↑c / ↑d\n[PROOFSTEP]\nhave hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb\n[GOAL]\ncase h\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\nhb' : 0 < ↑b\n⊢ sqrt (2 + ↑a / ↑b) ≤ ↑c / ↑d\n[PROOFSTEP]\nhave hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd\n[GOAL]\ncase h\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\nhb' : 0 < ↑b\nhd' : 0 < ↑d\n⊢ sqrt (2 + ↑a / ↑b) ≤ ↑c / ↑d\n[PROOFSTEP]\nrw [sqrt_le_left (div_nonneg c.cast_nonneg d.cast_nonneg), div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hb'),\n div_le_div_iff hb' (pow_pos hd' _)]\n[GOAL]\ncase h\nc d a b n : ℕ\nz : ℝ\nhz : sqrtTwoAddSeries (↑c / ↑d) n ≤ z\nhb : 0 < b\nhd : 0 < d\nh : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b\nhb' : 0 < ↑b\nhd' : 0 < ↑d\n⊢ (2 * ↑b + ↑a) * ↑d ^ 2 ≤ ↑c ^ 2 * ↑b\n[PROOFSTEP]\nexact_mod_cast h\n[GOAL]\nn : ℕ\na : ℝ\nh : 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries (↑0 / ↑1) n\nh₂ : 1 / 4 ^ n ≤ a\n⊢ π < a\n[PROOFSTEP]\nrefine' lt_of_lt_of_le (pi_lt_sqrtTwoAddSeries n) _\n[GOAL]\nn : ℕ\na : ℝ\nh : 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries (↑0 / ↑1) n\nh₂ : 1 / 4 ^ n ≤ a\n⊢ 2 ^ (n + 1) * sqrt (2 - sqrtTwoAddSeries 0 n) + 1 / 4 ^ n ≤ a\n[PROOFSTEP]\nrw [← le_sub_iff_add_le, ← le_div_iff', sqrt_le_left, sub_le_comm]\n[GOAL]\nn : ℕ\na : ℝ\nh : 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries (↑0 / ↑1) n\nh₂ : 1 / 4 ^ n ≤ a\n⊢ 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries 0 n\n[PROOFSTEP]\nrwa [Nat.cast_zero, zero_div] at h \n[GOAL]\nn : ℕ\na : ℝ\nh : 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries (↑0 / ↑1) n\nh₂ : 1 / 4 ^ n ≤ a\n⊢ 0 ≤ (a - 1 / 4 ^ n) / 2 ^ (n + 1)\n[PROOFSTEP]\nexact div_nonneg (sub_nonneg.2 h₂) (pow_nonneg (le_of_lt zero_lt_two) _)\n[GOAL]\nn : ℕ\na : ℝ\nh : 2 - ((a - 1 / 4 ^ n) / 2 ^ (n + 1)) ^ 2 ≤ sqrtTwoAddSeries (↑0 / ↑1) n\nh₂ : 1 / 4 ^ n ≤ a\n⊢ 0 < 2 ^ (n + 1)\n[PROOFSTEP]\nexact pow_pos zero_lt_two _\n[GOAL]\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\n⊢ z ≤ sqrtTwoAddSeries (↑c / ↑d) (n + 1)\n[PROOFSTEP]\napply le_trans hz\n[GOAL]\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\n⊢ sqrtTwoAddSeries (↑a / ↑b) n ≤ sqrtTwoAddSeries (↑c / ↑d) (n + 1)\n[PROOFSTEP]\nrw [sqrtTwoAddSeries_succ]\n[GOAL]\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\n⊢ sqrtTwoAddSeries (↑a / ↑b) n ≤ sqrtTwoAddSeries (sqrt (2 + ↑c / ↑d)) n\n[PROOFSTEP]\napply sqrtTwoAddSeries_monotone_left\n[GOAL]\ncase h\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\n⊢ ↑a / ↑b ≤ sqrt (2 + ↑c / ↑d)\n[PROOFSTEP]\napply le_sqrt_of_sq_le\n[GOAL]\ncase h.h\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\n⊢ (↑a / ↑b) ^ 2 ≤ 2 + ↑c / ↑d\n[PROOFSTEP]\nhave hb' : 0 < (b : ℝ) := Nat.cast_pos.2 hb\n[GOAL]\ncase h.h\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\nhb' : 0 < ↑b\n⊢ (↑a / ↑b) ^ 2 ≤ 2 + ↑c / ↑d\n[PROOFSTEP]\nhave hd' : 0 < (d : ℝ) := Nat.cast_pos.2 hd\n[GOAL]\ncase h.h\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\nhb' : 0 < ↑b\nhd' : 0 < ↑d\n⊢ (↑a / ↑b) ^ 2 ≤ 2 + ↑c / ↑d\n[PROOFSTEP]\nrw [div_pow, add_div_eq_mul_add_div _ _ (ne_of_gt hd'), div_le_div_iff (pow_pos hb' _) hd']\n[GOAL]\ncase h.h\na b c d n : ℕ\nz : ℝ\nhz : z ≤ sqrtTwoAddSeries (↑a / ↑b) n\nhb : 0 < b\nhd : 0 < d\nh : a ^ 2 * d ≤ (2 * d + c) * b ^ 2\nhb' : 0 < ↑b\nhd' : 0 < ↑d\n⊢ ↑a ^ 2 * ↑d ≤ (2 * ↑d + ↑c) * ↑b ^ 2\n[PROOFSTEP]\nexact_mod_cast h\n[GOAL]\n⊢ 3 < π\n[PROOFSTEP]\npi_lower_bound [23 / 16]\n[GOAL]\n⊢ 3.14 < π\n[PROOFSTEP]\npi_lower_bound [99 / 70, 874 / 473, 1940 / 989, 1447 / 727]\n[GOAL]\n⊢ π < 3.15\n[PROOFSTEP]\npi_upper_bound [140 / 99, 279 / 151, 51 / 26, 412 / 207]\n[GOAL]\n⊢ 3.1415 < π\n[PROOFSTEP]\npi_lower_bound [11482 / 8119, 5401 / 2923, 2348 / 1197, 11367 / 5711, 25705 / 12868, 23235 / 11621]\n[GOAL]\n⊢ π < 3.1416\n[PROOFSTEP]\npi_upper_bound [4756 / 3363, 101211 / 54775, 505534 / 257719, 83289 / 41846, 411278 / 205887, 438142 / 219137,\n 451504 / 225769, 265603 / 132804, 849938 / 424971]\n[GOAL]\n⊢ 3.141592 < π\n[PROOFSTEP]\npi_lower_bound [11482 / 8119, 7792 / 4217, 54055 / 27557, 949247 / 476920, 3310126 / 1657059, 2635492 / 1318143,\n 1580265 / 790192, 1221775 / 610899, 3612247 / 1806132, 849943 / 424972]\n[GOAL]\n⊢ π < 3.141593\n[PROOFSTEP]\npi_upper_bound [27720 / 19601, 56935 / 30813, 49359 / 25163, 258754 / 130003, 113599 / 56868, 1101994 / 551163,\n 8671537 / 4336095, 3877807 / 1938940, 52483813 / 26242030, 56946167 / 28473117, 23798415 / 11899211]\n", "meta": {"mathlib_filename": "Mathlib.Data.Real.Pi.Bounds", "llama_tokens": 10773, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8757869916479466, "lm_q2_score": 0.7490872131147275, "lm_q1q2_score": 0.6560408368556915}} {"text": "[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\n⊢ ↑(trans e (dualMap (symm (flip e)))) = Dual.eval R N\n[PROOFSTEP]\next\n[GOAL]\ncase h.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\nx✝¹ : N\nx✝ : Dual R N\n⊢ ↑(↑↑(trans e (dualMap (symm (flip e)))) x✝¹) x✝ = ↑(↑(Dual.eval R N) x✝¹) x✝\n[PROOFSTEP]\nsimp\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\n⊢ IsReflexive R N\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase bijective_dual_eval'\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\n⊢ Function.Bijective ↑(Dual.eval R N)\n[PROOFSTEP]\nrw [← trans_dualMap_symm_flip e]\n[GOAL]\ncase bijective_dual_eval'\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\n⊢ Function.Bijective ↑↑(trans e (dualMap (symm (flip e))))\n[PROOFSTEP]\nexact LinearEquiv.bijective _\n[GOAL]\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\nh : optParam (IsReflexive R N) (_ : IsReflexive R N)\n⊢ flip (flip e) = e\n[PROOFSTEP]\next\n[GOAL]\ncase h.h\nR : Type u_1\nM : Type u_2\nN : Type u_3\ninst✝⁵ : CommRing R\ninst✝⁴ : AddCommGroup M\ninst✝³ : Module R M\ninst✝² : AddCommGroup N\ninst✝¹ : Module R N\ninst✝ : IsReflexive R M\ne : N ≃ₗ[R] Dual R M\nh : optParam (IsReflexive R N) (_ : IsReflexive R N)\nx✝¹ : N\nx✝ : M\n⊢ ↑(↑(flip (flip e)) x✝¹) x✝ = ↑(↑e x✝¹) x✝\n[PROOFSTEP]\nrfl\n", "meta": {"mathlib_filename": "Mathlib.LinearAlgebra.PerfectPairing", "llama_tokens": 1109, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8459424373085146, "lm_q2_score": 0.7745833737577158, "lm_q1q2_score": 0.6552529470952543}} {"text": "[GOAL]\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ HEq (evenOddRec h0 h_even h_odd (bit false n)) (h_even n (evenOddRec h0 h_even h_odd n))\n[PROOFSTEP]\nrw [evenOddRec, binaryRec_eq]\n[GOAL]\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ HEq\n (match false, n,\n binaryRec h0\n (fun x x_1 x_2 =>\n match x, x_1, x_2 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi)\n n with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi)\n (h_even n (evenOddRec h0 h_even h_odd n))\ncase h\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ (match false, 0, h0 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi) =\n h0\n[PROOFSTEP]\napply eq_rec_heq\n[GOAL]\ncase h\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ (match false, 0, h0 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi) =\n h0\n[PROOFSTEP]\nexact H\n[GOAL]\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ HEq (evenOddRec h0 h_even h_odd (bit true n)) (h_odd n (evenOddRec h0 h_even h_odd n))\n[PROOFSTEP]\nrw [evenOddRec, binaryRec_eq]\n[GOAL]\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ HEq\n (match true, n,\n binaryRec h0\n (fun x x_1 x_2 =>\n match x, x_1, x_2 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi)\n n with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi)\n (h_odd n (evenOddRec h0 h_even h_odd n))\ncase h\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ (match false, 0, h0 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi) =\n h0\n[PROOFSTEP]\napply eq_rec_heq\n[GOAL]\ncase h\nn : ℕ\nP : ℕ → Sort u_1\nh0 : P 0\nh_even : (i : ℕ) → P i → P (2 * i)\nh_odd : (i : ℕ) → P i → P (2 * i + 1)\nH : h_even 0 h0 = h0\n⊢ (match false, 0, h0 with\n | false, i, hi => (_ : 2 * i = bit0 i) ▸ h_even i hi\n | true, i, hi => (_ : 2 * i + 1 = bit1 i) ▸ h_odd i hi) =\n h0\n[PROOFSTEP]\nexact H\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.EvenOddRec", "llama_tokens": 1528, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8887587934924569, "lm_q2_score": 0.7371581684030623, "lm_q1q2_score": 0.655155804363015}} {"text": "[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\n⊢ (x + y) ^ n = ∑ m in range (n + 1), x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\n[PROOFSTEP]\nlet t : ℕ → ℕ → R := fun n m ↦ x ^ m * y ^ (n - m) * choose n m\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\n⊢ (x + y) ^ n = ∑ m in range (n + 1), x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\n[PROOFSTEP]\nchange (x + y) ^ n = ∑ m in range (n + 1), t n m\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\n⊢ (x + y) ^ n = ∑ m in range (n + 1), t n m\n[PROOFSTEP]\nhave h_first : ∀ n, t n 0 = y ^ n := fun n ↦ by\n simp only [choose_zero_right, _root_.pow_zero, Nat.cast_one, mul_one, one_mul, tsub_zero]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nn : ℕ\n⊢ t n 0 = y ^ n\n[PROOFSTEP]\nsimp only [choose_zero_right, _root_.pow_zero, Nat.cast_one, mul_one, one_mul, tsub_zero]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\n⊢ (x + y) ^ n = ∑ m in range (n + 1), t n m\n[PROOFSTEP]\nhave h_last : ∀ n, t n n.succ = 0 := fun n ↦ by simp only [ge_iff_le, choose_succ_self, cast_zero, mul_zero]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nn : ℕ\n⊢ t n (succ n) = 0\n[PROOFSTEP]\nsimp only [ge_iff_le, choose_succ_self, cast_zero, mul_zero]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\n⊢ (x + y) ^ n = ∑ m in range (n + 1), t n m\n[PROOFSTEP]\nhave h_middle : ∀ n i : ℕ, i ∈ range n.succ → (t n.succ ∘ Nat.succ) i = x * t n i + y * t n i.succ :=\n by\n intro n i h_mem\n have h_le : i ≤ n := Nat.le_of_lt_succ (mem_range.mp h_mem)\n dsimp only\n rw [Function.comp_apply, choose_succ_succ, Nat.cast_add, mul_add]\n congr 1\n · rw [pow_succ x, succ_sub_succ, mul_assoc, mul_assoc, mul_assoc]\n · rw [← mul_assoc y, ← mul_assoc y, (h.symm.pow_right i.succ).eq]\n by_cases h_eq : i = n\n · rw [h_eq, choose_succ_self, Nat.cast_zero, mul_zero, mul_zero]\n · rw [succ_sub (lt_of_le_of_ne h_le h_eq)]\n rw [pow_succ y, mul_assoc, mul_assoc, mul_assoc, mul_assoc]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\n⊢ ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n[PROOFSTEP]\nintro n i h_mem\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\n⊢ (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n[PROOFSTEP]\nhave h_le : i ≤ n := Nat.le_of_lt_succ (mem_range.mp h_mem)\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n[PROOFSTEP]\ndsimp only\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ ((fun m => x ^ m * y ^ (succ n - m) * ↑(Nat.choose (succ n) m)) ∘ succ) i =\n x * (x ^ i * y ^ (n - i) * ↑(Nat.choose n i)) + y * (x ^ succ i * y ^ (n - succ i) * ↑(Nat.choose n (succ i)))\n[PROOFSTEP]\nrw [Function.comp_apply, choose_succ_succ, Nat.cast_add, mul_add]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n i) +\n x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n (succ i)) =\n x * (x ^ i * y ^ (n - i) * ↑(Nat.choose n i)) + y * (x ^ succ i * y ^ (n - succ i) * ↑(Nat.choose n (succ i)))\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase e_a\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n i) = x * (x ^ i * y ^ (n - i) * ↑(Nat.choose n i))\n[PROOFSTEP]\nrw [pow_succ x, succ_sub_succ, mul_assoc, mul_assoc, mul_assoc]\n[GOAL]\ncase e_a\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n (succ i)) =\n y * (x ^ succ i * y ^ (n - succ i) * ↑(Nat.choose n (succ i)))\n[PROOFSTEP]\nrw [← mul_assoc y, ← mul_assoc y, (h.symm.pow_right i.succ).eq]\n[GOAL]\ncase e_a\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n (succ i)) =\n x ^ succ i * y * y ^ (n - succ i) * ↑(Nat.choose n (succ i))\n[PROOFSTEP]\nby_cases h_eq : i = n\n[GOAL]\ncase pos\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\nh_eq : i = n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n (succ i)) =\n x ^ succ i * y * y ^ (n - succ i) * ↑(Nat.choose n (succ i))\n[PROOFSTEP]\nrw [h_eq, choose_succ_self, Nat.cast_zero, mul_zero, mul_zero]\n[GOAL]\ncase neg\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\nh_eq : ¬i = n\n⊢ x ^ succ i * y ^ (succ n - succ i) * ↑(Nat.choose n (succ i)) =\n x ^ succ i * y * y ^ (n - succ i) * ↑(Nat.choose n (succ i))\n[PROOFSTEP]\nrw [succ_sub (lt_of_le_of_ne h_le h_eq)]\n[GOAL]\ncase neg\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn✝ : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nn i : ℕ\nh_mem : i ∈ range (succ n)\nh_le : i ≤ n\nh_eq : ¬i = n\n⊢ x ^ succ i * y ^ succ (n - succ i) * ↑(Nat.choose n (succ i)) =\n x ^ succ i * y * y ^ (n - succ i) * ↑(Nat.choose n (succ i))\n[PROOFSTEP]\nrw [pow_succ y, mul_assoc, mul_assoc, mul_assoc, mul_assoc]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n⊢ (x + y) ^ n = ∑ m in range (n + 1), t n m\n[PROOFSTEP]\ninduction' n with n ih\n[GOAL]\ncase zero\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n⊢ (x + y) ^ zero = ∑ m in range (zero + 1), t zero m\n[PROOFSTEP]\nrw [_root_.pow_zero, sum_range_succ, range_zero, sum_empty, zero_add]\n[GOAL]\ncase zero\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n⊢ 1 = t zero zero\n[PROOFSTEP]\ndsimp only\n[GOAL]\ncase zero\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\n⊢ 1 = x ^ zero * y ^ (zero - zero) * ↑(Nat.choose zero zero)\n[PROOFSTEP]\nrw [_root_.pow_zero, _root_.pow_zero, choose_self, Nat.cast_one, mul_one, mul_one]\n[GOAL]\ncase succ\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\nn : ℕ\nih : (x + y) ^ n = ∑ m in range (n + 1), t n m\n⊢ (x + y) ^ succ n = ∑ m in range (succ n + 1), t (succ n) m\n[PROOFSTEP]\nrw [sum_range_succ', h_first]\n[GOAL]\ncase succ\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\nn : ℕ\nih : (x + y) ^ n = ∑ m in range (n + 1), t n m\n⊢ (x + y) ^ succ n = ∑ k in range (n + 1), t (succ n) (k + 1) + y ^ succ n\n[PROOFSTEP]\nerw [sum_congr rfl (h_middle n), sum_add_distrib, add_assoc]\n[GOAL]\ncase succ\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\nn : ℕ\nih : (x + y) ^ n = ∑ m in range (n + 1), t n m\n⊢ (x + y) ^ succ n = ∑ x_1 in range (succ n), x * t n x_1 + (∑ x in range (succ n), y * t n (succ x) + y ^ succ n)\n[PROOFSTEP]\nrw [pow_succ (x + y), ih, add_mul, mul_sum, mul_sum]\n[GOAL]\ncase succ\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\nn : ℕ\nih : (x + y) ^ n = ∑ m in range (n + 1), t n m\n⊢ ∑ x_1 in range (n + 1), x * t n x_1 + ∑ x in range (n + 1), y * t n x =\n ∑ x_1 in range (succ n), x * t n x_1 + (∑ x in range (succ n), y * t n (succ x) + y ^ succ n)\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase succ.e_a\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nt : ℕ → ℕ → R := fun n m => x ^ m * y ^ (n - m) * ↑(Nat.choose n m)\nh_first : ∀ (n : ℕ), t n 0 = y ^ n\nh_last : ∀ (n : ℕ), t n (succ n) = 0\nh_middle : ∀ (n i : ℕ), i ∈ range (succ n) → (t (succ n) ∘ succ) i = x * t n i + y * t n (succ i)\nn : ℕ\nih : (x + y) ^ n = ∑ m in range (n + 1), t n m\n⊢ ∑ x in range (n + 1), y * t n x = ∑ x in range (succ n), y * t n (succ x) + y ^ succ n\n[PROOFSTEP]\nrw [sum_range_succ', sum_range_succ, h_first, h_last, mul_zero, add_zero, _root_.pow_succ]\n[GOAL]\nR : Type u_1\ninst✝ : Semiring R\nx y : R\nh : Commute x y\nn : ℕ\n⊢ (x + y) ^ n = ∑ m in Nat.antidiagonal n, Nat.choose n m.fst • (x ^ m.fst * y ^ m.snd)\n[PROOFSTEP]\nsimp_rw [Finset.Nat.sum_antidiagonal_eq_sum_range_succ fun m p ↦ choose n m • (x ^ m * y ^ p), _root_.nsmul_eq_mul,\n cast_comm, h.add_pow]\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (n + 1), choose n m = 2 ^ n\n[PROOFSTEP]\nhave := (add_pow 1 1 n).symm\n[GOAL]\nR : Type u_1\nn : ℕ\nthis : ∑ m in range (n + 1), 1 ^ m * 1 ^ (n - m) * ↑(choose n m) = (1 + 1) ^ n\n⊢ ∑ m in range (n + 1), choose n m = 2 ^ n\n[PROOFSTEP]\nsimpa [one_add_one_eq_two] using this\n[GOAL]\nR : Type u_1\nm i : ℕ\nhi : i ∈ range (m + 1)\n⊢ i ≤ 2 * m + 1\n[PROOFSTEP]\nlinarith [mem_range.1 hi]\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ 2 * ∑ i in range (m + 1), choose (2 * m + 1) i =\n ∑ i in range (m + 1), choose (2 * m + 1) i + ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i)\n[PROOFSTEP]\nrw [two_mul, this]\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ ∑ i in range (m + 1), choose (2 * m + 1) i + ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) =\n ∑ i in range (m + 1), choose (2 * m + 1) i + ∑ i in Ico (m + 1) (2 * m + 2), choose (2 * m + 1) i\n[PROOFSTEP]\n{ rw [range_eq_Ico, sum_Ico_reflect]\n · congr\n have A : m + 1 ≤ 2 * m + 1 := by linarith\n rw [add_comm, add_tsub_assoc_of_le A, ← add_comm]\n congr\n rw [tsub_eq_iff_eq_add_of_le A]\n ring\n · linarith\n}\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ ∑ i in range (m + 1), choose (2 * m + 1) i + ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) =\n ∑ i in range (m + 1), choose (2 * m + 1) i + ∑ i in Ico (m + 1) (2 * m + 2), choose (2 * m + 1) i\n[PROOFSTEP]\nrw [range_eq_Ico, sum_Ico_reflect]\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ ∑ i in Ico 0 (m + 1), choose (2 * m + 1) i +\n ∑ j in Ico (2 * m + 1 + 1 - (m + 1)) (2 * m + 1 + 1 - 0), choose (2 * m + 1) j =\n ∑ i in Ico 0 (m + 1), choose (2 * m + 1) i + ∑ i in Ico (m + 1) (2 * m + 2), choose (2 * m + 1) i\n[PROOFSTEP]\ncongr\n[GOAL]\ncase e_a.e_s.e_a\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ 2 * m + 1 + 1 - (m + 1) = m + 1\n[PROOFSTEP]\nhave A : m + 1 ≤ 2 * m + 1 := by linarith\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ m + 1 ≤ 2 * m + 1\n[PROOFSTEP]\nlinarith\n[GOAL]\ncase e_a.e_s.e_a\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\nA : m + 1 ≤ 2 * m + 1\n⊢ 2 * m + 1 + 1 - (m + 1) = m + 1\n[PROOFSTEP]\nrw [add_comm, add_tsub_assoc_of_le A, ← add_comm]\n[GOAL]\ncase e_a.e_s.e_a\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\nA : m + 1 ≤ 2 * m + 1\n⊢ 2 * m + 1 - (m + 1) + 1 = m + 1\n[PROOFSTEP]\ncongr\n[GOAL]\ncase e_a.e_s.e_a.e_a\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\nA : m + 1 ≤ 2 * m + 1\n⊢ 2 * m + 1 - (m + 1) = m\n[PROOFSTEP]\nrw [tsub_eq_iff_eq_add_of_le A]\n[GOAL]\ncase e_a.e_s.e_a.e_a\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\nA : m + 1 ≤ 2 * m + 1\n⊢ 2 * m + 1 = m + (m + 1)\n[PROOFSTEP]\nring\n[GOAL]\ncase h\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ m + 1 ≤ 2 * m + 1 + 1\n[PROOFSTEP]\nlinarith\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ m + 1 ≤ 2 * m + 2\n[PROOFSTEP]\nlinarith\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ 2 ^ (2 * m + 1) = 2 * 4 ^ m\n[PROOFSTEP]\nrw [pow_succ, pow_mul, mul_comm]\n[GOAL]\nR : Type u_1\nm : ℕ\nthis : ∑ i in range (m + 1), choose (2 * m + 1) (2 * m + 1 - i) = ∑ i in range (m + 1), choose (2 * m + 1) i\n⊢ 2 * (2 ^ 2) ^ m = 2 * 4 ^ m\n[PROOFSTEP]\nrfl\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ choose (2 * n + 1) n ≤ 4 ^ n\n[PROOFSTEP]\nhave t : choose (2 * n + 1) n ≤ ∑ i in range (n + 1), choose (2 * n + 1) i :=\n single_le_sum (fun x _ ↦ by linarith) (self_mem_range_succ n)\n[GOAL]\nR : Type u_1\nn x : ℕ\nx✝ : x ∈ range (n + 1)\n⊢ 0 ≤ choose (2 * n + 1) x\n[PROOFSTEP]\nlinarith\n[GOAL]\nR : Type u_1\nn : ℕ\nt : choose (2 * n + 1) n ≤ ∑ i in range (n + 1), choose (2 * n + 1) i\n⊢ choose (2 * n + 1) n ≤ 4 ^ n\n[PROOFSTEP]\nsimpa [sum_range_choose_halfway n] using t\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ 4 ^ n = (1 + 1) ^ (2 * n)\n[PROOFSTEP]\nsimp only [pow_mul, one_add_one_eq_two]\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ 4 ^ n = (2 ^ 2) ^ n\n[PROOFSTEP]\nrfl\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ (1 + 1) ^ (2 * n) = ∑ m in range (2 * n + 1), choose (2 * n) m\n[PROOFSTEP]\nsimp [add_pow]\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (2 * n + 1), choose (2 * n) m ≤ ∑ m in range (2 * n + 1), choose (2 * n) (2 * n / 2)\n[PROOFSTEP]\ngcongr\n[GOAL]\ncase h\nR : Type u_1\nn i✝ : ℕ\na✝ : i✝ ∈ range (2 * n + 1)\n⊢ choose (2 * n) i✝ ≤ choose (2 * n) (2 * n / 2)\n[PROOFSTEP]\napply choose_le_middle\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (2 * n + 1), choose (2 * n) (2 * n / 2) = (2 * n + 1) * choose (2 * n) n\n[PROOFSTEP]\nsimp\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (n + 1), (-1) ^ m * ↑(Nat.choose n m) = if n = 0 then 1 else 0\n[PROOFSTEP]\ncases n\n[GOAL]\ncase zero\nR : Type u_1\n⊢ ∑ m in range (zero + 1), (-1) ^ m * ↑(Nat.choose zero m) = if zero = 0 then 1 else 0\n[PROOFSTEP]\nsimp\n[GOAL]\ncase succ\nR : Type u_1\nn✝ : ℕ\n⊢ ∑ m in range (Nat.succ n✝ + 1), (-1) ^ m * ↑(Nat.choose (Nat.succ n✝) m) = if Nat.succ n✝ = 0 then 1 else 0\n[PROOFSTEP]\ncase succ n =>\n have h := add_pow (-1 : ℤ) 1 n.succ\n simp only [one_pow, mul_one, add_left_neg] at h \n rw [← h, zero_pow (Nat.succ_pos n), if_neg (Nat.succ_ne_zero n)]\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (Nat.succ n + 1), (-1) ^ m * ↑(Nat.choose (Nat.succ n) m) = if Nat.succ n = 0 then 1 else 0\n[PROOFSTEP]\ncase succ n =>\n have h := add_pow (-1 : ℤ) 1 n.succ\n simp only [one_pow, mul_one, add_left_neg] at h \n rw [← h, zero_pow (Nat.succ_pos n), if_neg (Nat.succ_ne_zero n)]\n[GOAL]\nR : Type u_1\nn : ℕ\n⊢ ∑ m in range (Nat.succ n + 1), (-1) ^ m * ↑(Nat.choose (Nat.succ n) m) = if Nat.succ n = 0 then 1 else 0\n[PROOFSTEP]\nhave h := add_pow (-1 : ℤ) 1 n.succ\n[GOAL]\nR : Type u_1\nn : ℕ\nh :\n (-1 + 1) ^ Nat.succ n = ∑ m in range (Nat.succ n + 1), (-1) ^ m * 1 ^ (Nat.succ n - m) * ↑(Nat.choose (Nat.succ n) m)\n⊢ ∑ m in range (Nat.succ n + 1), (-1) ^ m * ↑(Nat.choose (Nat.succ n) m) = if Nat.succ n = 0 then 1 else 0\n[PROOFSTEP]\nsimp only [one_pow, mul_one, add_left_neg] at h \n[GOAL]\nR : Type u_1\nn : ℕ\nh : 0 ^ Nat.succ n = ∑ x in range (Nat.succ n + 1), (-1) ^ x * ↑(Nat.choose (Nat.succ n) x)\n⊢ ∑ m in range (Nat.succ n + 1), (-1) ^ m * ↑(Nat.choose (Nat.succ n) m) = if Nat.succ n = 0 then 1 else 0\n[PROOFSTEP]\nrw [← h, zero_pow (Nat.succ_pos n), if_neg (Nat.succ_ne_zero n)]\n[GOAL]\nR : Type u_1\nn : ℕ\nh0 : n ≠ 0\n⊢ ∑ m in range (n + 1), (-1) ^ m * ↑(Nat.choose n m) = 0\n[PROOFSTEP]\nrw [Int.alternating_sum_range_choose, if_neg h0]\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\n⊢ ∑ m in powerset x, f (card m) = ∑ m in range (card x + 1), Nat.choose (card x) m • f m\n[PROOFSTEP]\ntrans ∑ m in range (x.card + 1), ∑ j in x.powerset.filter fun z ↦ z.card = m, f j.card\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\n⊢ ∑ m in powerset x, f (card m) =\n ∑ m in range (card x + 1), ∑ j in filter (fun z => card z = m) (powerset x), f (card j)\n[PROOFSTEP]\nrefine' (sum_fiberwise_of_maps_to _ _).symm\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\n⊢ ∀ (x_1 : Finset β), x_1 ∈ powerset x → card x_1 ∈ range (card x + 1)\n[PROOFSTEP]\nintro y hy\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx y : Finset β\nhy : y ∈ powerset x\n⊢ card y ∈ range (card x + 1)\n[PROOFSTEP]\nrw [mem_range, Nat.lt_succ_iff]\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx y : Finset β\nhy : y ∈ powerset x\n⊢ card y ≤ card x\n[PROOFSTEP]\nrw [mem_powerset] at hy \n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx y : Finset β\nhy : y ⊆ x\n⊢ card y ≤ card x\n[PROOFSTEP]\nexact card_le_of_subset hy\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\n⊢ ∑ m in range (card x + 1), ∑ j in filter (fun z => card z = m) (powerset x), f (card j) =\n ∑ m in range (card x + 1), Nat.choose (card x) m • f m\n[PROOFSTEP]\nrefine' sum_congr rfl fun y _ ↦ _\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\ny : ℕ\nx✝ : y ∈ range (card x + 1)\n⊢ ∑ j in filter (fun z => card z = y) (powerset x), f (card j) = Nat.choose (card x) y • f y\n[PROOFSTEP]\nrw [← card_powersetLen, ← sum_const]\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\ny : ℕ\nx✝ : y ∈ range (card x + 1)\n⊢ ∑ j in filter (fun z => card z = y) (powerset x), f (card j) = ∑ _x in powersetLen y x, f y\n[PROOFSTEP]\nrefine' sum_congr powersetLen_eq_filter.symm fun z hz ↦ _\n[GOAL]\nR : Type u_1\nα : Type u_2\nβ : Type u_3\ninst✝ : AddCommMonoid α\nf : ℕ → α\nx : Finset β\ny : ℕ\nx✝ : y ∈ range (card x + 1)\nz : Finset β\nhz : z ∈ powersetLen y x\n⊢ f (card z) = f y\n[PROOFSTEP]\nrw [(mem_powersetLen.1 hz).2]\n[GOAL]\nR : Type u_1\nα : Type u_2\ninst✝ : DecidableEq α\nx : Finset α\n⊢ ∑ m in powerset x, (-1) ^ card m = if x = ∅ then 1 else 0\n[PROOFSTEP]\nrw [sum_powerset_apply_card]\n[GOAL]\nR : Type u_1\nα : Type u_2\ninst✝ : DecidableEq α\nx : Finset α\n⊢ ∑ m in range (card x + 1), Nat.choose (card x) m • (-1) ^ m = if x = ∅ then 1 else 0\n[PROOFSTEP]\nsimp only [nsmul_eq_mul', ← card_eq_zero, Int.alternating_sum_range_choose]\n[GOAL]\nR : Type u_1\nα : Type u_2\nx : Finset α\nh0 : Finset.Nonempty x\n⊢ ∑ m in powerset x, (-1) ^ card m = 0\n[PROOFSTEP]\nclassical\nrw [sum_powerset_neg_one_pow_card, if_neg]\nrw [← Ne.def, ← nonempty_iff_ne_empty]\napply h0\n[GOAL]\nR : Type u_1\nα : Type u_2\nx : Finset α\nh0 : Finset.Nonempty x\n⊢ ∑ m in powerset x, (-1) ^ card m = 0\n[PROOFSTEP]\nrw [sum_powerset_neg_one_pow_card, if_neg]\n[GOAL]\ncase hnc\nR : Type u_1\nα : Type u_2\nx : Finset α\nh0 : Finset.Nonempty x\n⊢ ¬x = ∅\n[PROOFSTEP]\nrw [← Ne.def, ← nonempty_iff_ne_empty]\n[GOAL]\ncase hnc\nR : Type u_1\nα : Type u_2\nx : Finset α\nh0 : Finset.Nonempty x\n⊢ Finset.Nonempty x\n[PROOFSTEP]\napply h0\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\n⊢ ∏ i in range (n + 2), f i (n + 1 - i) ^ Nat.choose (n + 1) i =\n (∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i) * ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i\n[PROOFSTEP]\nhave A :\n (∏ i in range (n + 1), f (i + 1) (n - i) ^ (n.choose (i + 1))) * f 0 (n + 1) =\n ∏ i in range (n + 1), f i (n + 1 - i) ^ (n.choose i)\n[GOAL]\ncase A\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\n⊢ (∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n (i + 1)) * f 0 (n + 1) =\n ∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i\n[PROOFSTEP]\nrw [prod_range_succ, prod_range_succ']\n[GOAL]\ncase A\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\n⊢ (∏ x in range n, f (x + 1) (n - x) ^ Nat.choose n (x + 1)) * f (n + 1) (n - n) ^ Nat.choose n (n + 1) * f 0 (n + 1) =\n (∏ k in range n, f (k + 1) (n + 1 - (k + 1)) ^ Nat.choose n (k + 1)) * f 0 (n + 1 - 0) ^ Nat.choose n 0\n[PROOFSTEP]\nsimp\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nA :\n (∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n (i + 1)) * f 0 (n + 1) =\n ∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i\n⊢ ∏ i in range (n + 2), f i (n + 1 - i) ^ Nat.choose (n + 1) i =\n (∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i) * ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i\n[PROOFSTEP]\nrw [prod_range_succ']\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nA :\n (∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n (i + 1)) * f 0 (n + 1) =\n ∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i\n⊢ (∏ k in range (n + 1), f (k + 1) (n + 1 - (k + 1)) ^ Nat.choose (n + 1) (k + 1)) *\n f 0 (n + 1 - 0) ^ Nat.choose (n + 1) 0 =\n (∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i) * ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i\n[PROOFSTEP]\nsimpa [Nat.choose_succ_succ, pow_add, prod_mul_distrib, A, mul_assoc] using\n mul_comm _\n _\n -- porting note: new lemma\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\n⊢ ∏ ij in Nat.antidiagonal (n + 1), f ij.fst ij.snd ^ Nat.choose (n + 1) ij.fst =\n (∏ ij in Nat.antidiagonal n, f ij.fst (ij.snd + 1) ^ Nat.choose n ij.fst) *\n ∏ ij in Nat.antidiagonal n, f (ij.fst + 1) ij.snd ^ Nat.choose n ij.snd\n[PROOFSTEP]\nsimp only [Nat.prod_antidiagonal_eq_prod_range_succ_mk, prod_pow_choose_succ]\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\n⊢ (∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i) * ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i =\n (∏ x in range (succ n), f x (n - x + 1) ^ Nat.choose n x) *\n ∏ x in range (succ n), f (x + 1) (n - x) ^ Nat.choose n (n - x)\n[PROOFSTEP]\nhave : ∀ i ∈ range (n + 1), i ≤ n := fun i hi ↦ by simpa [Nat.lt_succ_iff] using hi\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn i : ℕ\nhi : i ∈ range (n + 1)\n⊢ i ≤ n\n[PROOFSTEP]\nsimpa [Nat.lt_succ_iff] using hi\n[GOAL]\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nthis : ∀ (i : ℕ), i ∈ range (n + 1) → i ≤ n\n⊢ (∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i) * ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i =\n (∏ x in range (succ n), f x (n - x + 1) ^ Nat.choose n x) *\n ∏ x in range (succ n), f (x + 1) (n - x) ^ Nat.choose n (n - x)\n[PROOFSTEP]\ncongr 1\n[GOAL]\ncase e_a\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nthis : ∀ (i : ℕ), i ∈ range (n + 1) → i ≤ n\n⊢ ∏ i in range (n + 1), f i (n + 1 - i) ^ Nat.choose n i = ∏ x in range (succ n), f x (n - x + 1) ^ Nat.choose n x\n[PROOFSTEP]\nrefine prod_congr rfl fun i hi ↦ ?_\n[GOAL]\ncase e_a\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nthis : ∀ (i : ℕ), i ∈ range (n + 1) → i ≤ n\ni : ℕ\nhi : i ∈ range (succ n)\n⊢ f i (n + 1 - i) ^ Nat.choose n i = f i (n - i + 1) ^ Nat.choose n i\n[PROOFSTEP]\nrw [tsub_add_eq_add_tsub (this _ hi)]\n[GOAL]\ncase e_a\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nthis : ∀ (i : ℕ), i ∈ range (n + 1) → i ≤ n\n⊢ ∏ i in range (n + 1), f (i + 1) (n - i) ^ Nat.choose n i =\n ∏ x in range (succ n), f (x + 1) (n - x) ^ Nat.choose n (n - x)\n[PROOFSTEP]\nrefine prod_congr rfl fun i hi ↦ ?_\n[GOAL]\ncase e_a\nR✝ : Type u_1\nM✝ : Type u_2\nR : Type u_3\ninst✝² : CommMonoid M✝\ninst✝¹ : NonAssocSemiring R\nM : Type u_4\ninst✝ : CommMonoid M\nf : ℕ → ℕ → M\nn : ℕ\nthis : ∀ (i : ℕ), i ∈ range (n + 1) → i ≤ n\ni : ℕ\nhi : i ∈ range (succ n)\n⊢ f (i + 1) (n - i) ^ Nat.choose n i = f (i + 1) (n - i) ^ Nat.choose n (n - i)\n[PROOFSTEP]\nrw [Nat.choose_symm (this _ hi)]\n -- porting note: moved from `Mathlib.Analysis.Calculus.ContDiff`\n[GOAL]\nR✝ : Type u_1\nM : Type u_2\nR : Type u_3\ninst✝¹ : CommMonoid M\ninst✝ : NonAssocSemiring R\nf : ℕ → ℕ → R\nn : ℕ\n⊢ ∑ i in range (n + 2), ↑(Nat.choose (n + 1) i) * f i (n + 1 - i) =\n ∑ i in range (n + 1), ↑(Nat.choose n i) * f i (n + 1 - i) +\n ∑ i in range (n + 1), ↑(Nat.choose n i) * f (i + 1) (n - i)\n[PROOFSTEP]\nsimpa only [nsmul_eq_mul] using sum_choose_succ_nsmul f n\n[GOAL]\nR✝ : Type u_1\nM : Type u_2\nR : Type u_3\ninst✝¹ : CommMonoid M\ninst✝ : NonAssocSemiring R\nf : ℕ → ℕ → R\nn : ℕ\n⊢ ∑ ij in Nat.antidiagonal (n + 1), ↑(Nat.choose (n + 1) ij.fst) * f ij.fst ij.snd =\n ∑ ij in Nat.antidiagonal n, ↑(Nat.choose n ij.fst) * f ij.fst (ij.snd + 1) +\n ∑ ij in Nat.antidiagonal n, ↑(Nat.choose n ij.snd) * f (ij.fst + 1) ij.snd\n[PROOFSTEP]\nsimpa only [nsmul_eq_mul] using sum_antidiagonal_choose_succ_nsmul f n\n", "meta": {"mathlib_filename": "Mathlib.Data.Nat.Choose.Sum", "llama_tokens": 15790, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8774767906859264, "lm_q2_score": 0.746138993030751, "lm_q1q2_score": 0.6547196490102523}} {"text": "[GOAL]\nx y r : ℕ\nhr : y * y + r = x\nhle : Nat.ble r (2 * y) = true\n⊢ Nat.sqrt x = y\n[PROOFSTEP]\nrw [← hr, ← pow_two]\n[GOAL]\nx y r : ℕ\nhr : y * y + r = x\nhle : Nat.ble r (2 * y) = true\n⊢ Nat.sqrt (y ^ 2 + r) = y\n[PROOFSTEP]\nrw [two_mul] at hle \n[GOAL]\nx y r : ℕ\nhr : y * y + r = x\nhle : Nat.ble r (y + y) = true\n⊢ Nat.sqrt (y ^ 2 + r) = y\n[PROOFSTEP]\nexact Nat.sqrt_add_eq' _ (Nat.le_of_ble_eq_true hle)\n", "meta": {"mathlib_filename": "Mathlib.Tactic.NormNum.NatSqrt", "llama_tokens": 221, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8872045817875223, "lm_q2_score": 0.7371581684030623, "lm_q1q2_score": 0.6540101045092948}} {"text": "[GOAL]\nn : ℕ\n⊢ IsReduced (ZMod n) ↔ Squarefree n ∨ n = 0\n[PROOFSTEP]\nrw [← RingHom.ker_isRadical_iff_reduced_of_surjective (ZMod.ringHom_surjective <| Int.castRingHom <| ZMod n),\n ZMod.ker_int_castRingHom, ← isRadical_iff_span_singleton, isRadical_iff_squarefree_or_zero, Int.squarefree_coe_nat,\n Nat.cast_eq_zero]\n", "meta": {"mathlib_filename": "Mathlib.RingTheory.ZMod", "llama_tokens": 144, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.9032942119105695, "lm_q2_score": 0.7217432122827968, "lm_q1q2_score": 0.6519464661407918}} {"text": "[GOAL]\nx y : ℤ\n⊢ |x| < |y| ↔ natAbs x < natAbs y\n[PROOFSTEP]\nrw [abs_eq_natAbs, abs_eq_natAbs, ofNat_lt]\n", "meta": {"mathlib_filename": "Mathlib.Algebra.Order.EuclideanAbsoluteValue", "llama_tokens": 63, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES\n\n", "lm_q1_score": 0.9136765163620469, "lm_q2_score": 0.7122321842389469, "lm_q1q2_score": 0.6507498209363726}} {"text": "[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ inner (↑(Equiv.pointReflection c) p₁ -ᵥ p₂) (p₂ -ᵥ p₁) = 0\n[PROOFSTEP]\nrw [mem_perpBisector_iff_inner_eq_zero, Equiv.pointReflection_apply, vsub_midpoint, invOf_eq_inv, ← smul_add,\n real_inner_smul_left, vadd_vsub_assoc]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ 2⁻¹ * inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0 ↔ inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0\n[PROOFSTEP]\nsimp\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ (↑(Equiv.pointReflection p₂) p₁) ↔ inner (c -ᵥ p₂) (p₁ -ᵥ p₂) = 0\n[PROOFSTEP]\nrw [mem_perpBisector_iff_inner_eq_zero, midpoint_pointReflection_right, Equiv.pointReflection_apply, vadd_vsub_assoc,\n inner_add_right, add_self_eq_zero, ← neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P\n⊢ midpoint ℝ p₁ p₂ ∈ perpBisector p₁ p₂\n[PROOFSTEP]\nsimp [mem_perpBisector_iff_inner_eq_zero]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P\n⊢ direction (perpBisector p₁ p₂) = (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ\n[PROOFSTEP]\nerw [perpBisector, comap_symm, map_direction, Submodule.map_id, Submodule.toAffineSubspace_direction]\n[GOAL]\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P\n⊢ LinearMap.ker (↑(innerₛₗ ℝ) (p₂ -ᵥ p₁)) = (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ\n[PROOFSTEP]\next x\n[GOAL]\ncase h\nV : Type u_1\nP : Type u_2\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P\nx : V\n⊢ x ∈ LinearMap.ker (↑(innerₛₗ ℝ) (p₂ -ᵥ p₁)) ↔ x ∈ (Submodule.span ℝ {p₂ -ᵥ p₁})ᗮ\n[PROOFSTEP]\nexact Submodule.mem_orthogonal_singleton_iff_inner_right.symm\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ inner (c -ᵥ p₁) (p₂ -ᵥ p₁) = inner (c -ᵥ p₂) (p₁ -ᵥ p₂)\n[PROOFSTEP]\nrw [Iff.comm, mem_perpBisector_iff_inner_eq_zero, ← add_neg_eq_zero, ← inner_neg_right, neg_vsub_eq_vsub_rev, ←\n inner_add_left, vsub_midpoint, invOf_eq_inv, ← smul_add, real_inner_smul_left]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0 ↔ 2⁻¹ * inner (c -ᵥ p₁ + (c -ᵥ p₂)) (p₂ -ᵥ p₁) = 0\n[PROOFSTEP]\nsimp\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ inner (c -ᵥ p₁) (p₂ -ᵥ p₁) = dist p₁ p₂ ^ 2 / 2\n[PROOFSTEP]\nrw [mem_perpBisector_iff_inner_eq_zero, ← vsub_sub_vsub_cancel_right _ _ p₁, inner_sub_left, sub_eq_zero,\n midpoint_vsub_left, invOf_eq_inv, real_inner_smul_left, real_inner_self_eq_norm_sq, dist_eq_norm_vsub' V,\n div_eq_inv_mul]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ dist c p₁ = dist c p₂\n[PROOFSTEP]\nrw [dist_eq_norm_vsub V, dist_eq_norm_vsub V, ← real_inner_add_sub_eq_zero_iff, vsub_sub_vsub_cancel_left,\n inner_add_left, add_eq_zero_iff_eq_neg, ← inner_neg_right, neg_vsub_eq_vsub_rev, mem_perpBisector_iff_inner_eq_inner]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ dist p₁ c = dist p₂ c\n[PROOFSTEP]\nsimp only [mem_perpBisector_iff_dist_eq, dist_comm]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁✝ p₂✝ p₁ p₂ : P\n⊢ perpBisector p₁ p₂ = perpBisector p₂ p₁\n[PROOFSTEP]\next c\n[GOAL]\ncase h\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc✝ c₁ c₂ p₁✝ p₂✝ p₁ p₂ c : P\n⊢ c ∈ perpBisector p₁ p₂ ↔ c ∈ perpBisector p₂ p₁\n[PROOFSTEP]\nsimp only [mem_perpBisector_iff_dist_eq, eq_comm]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ p₂ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂\n[PROOFSTEP]\nsimpa [mem_perpBisector_iff_inner_eq_inner] using eq_comm\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ p₁ ∈ perpBisector p₁ p₂ ↔ p₁ = p₂\n[PROOFSTEP]\nrw [perpBisector_comm, right_mem_perpBisector, eq_comm]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ p x✝ : P\n⊢ x✝ ∈ ↑⊤ → x✝ ∈ ↑(perpBisector p p)\n[PROOFSTEP]\nsimp [mem_perpBisector_iff_inner_eq_inner]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ perpBisector p₁ p₂ = ⊤ ↔ p₁ = p₂\n[PROOFSTEP]\nrefine ⟨fun h ↦ ?_, fun h ↦ h ▸ perpBisector_self _⟩\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\nh : perpBisector p₁ p₂ = ⊤\n⊢ p₁ = p₂\n[PROOFSTEP]\nrw [← left_mem_perpBisector, h]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\nh : perpBisector p₁ p₂ = ⊤\n⊢ p₁ ∈ ⊤\n[PROOFSTEP]\ntrivial\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ perpBisector p₁ p₂ ≠ ⊥\n[PROOFSTEP]\nrw [← nonempty_iff_ne_bot]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc c₁ c₂ p₁ p₂ : P\n⊢ Set.Nonempty ↑(perpBisector p₁ p₂)\n[PROOFSTEP]\nexact perpBisector_nonempty\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc₁ c₂ p₁ p₂ : P\nhc₁ : dist p₁ c₁ = dist p₂ c₁\nhc₂ : dist p₁ c₂ = dist p₂ c₂\n⊢ inner (c₂ -ᵥ c₁) (p₂ -ᵥ p₁) = 0\n[PROOFSTEP]\nrw [← Submodule.mem_orthogonal_singleton_iff_inner_left, ← direction_perpBisector]\n[GOAL]\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc₁ c₂ p₁ p₂ : P\nhc₁ : dist p₁ c₁ = dist p₂ c₁\nhc₂ : dist p₁ c₂ = dist p₂ c₂\n⊢ c₂ -ᵥ c₁ ∈ direction (perpBisector p₁ p₂)\n[PROOFSTEP]\napply vsub_mem_direction\n[GOAL]\ncase hp1\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc₁ c₂ p₁ p₂ : P\nhc₁ : dist p₁ c₁ = dist p₂ c₁\nhc₂ : dist p₁ c₂ = dist p₂ c₂\n⊢ c₂ ∈ perpBisector p₁ p₂\n[PROOFSTEP]\nrwa [mem_perpBisector_iff_dist_eq']\n[GOAL]\ncase hp2\nV : Type u_2\nP : Type u_1\ninst✝³ : NormedAddCommGroup V\ninst✝² : InnerProductSpace ℝ V\ninst✝¹ : MetricSpace P\ninst✝ : NormedAddTorsor V P\nc₁ c₂ p₁ p₂ : P\nhc₁ : dist p₁ c₁ = dist p₂ c₁\nhc₂ : dist p₁ c₂ = dist p₂ c₂\n⊢ c₁ ∈ perpBisector p₁ p₂\n[PROOFSTEP]\nrwa [mem_perpBisector_iff_dist_eq']\n[GOAL]\nV : Type u_4\nP : Type u_1\nV' : Type u_3\nP' : Type u_2\ninst✝⁷ : NormedAddCommGroup V\ninst✝⁶ : InnerProductSpace ℝ V\ninst✝⁵ : MetricSpace P\ninst✝⁴ : NormedAddTorsor V P\ninst✝³ : NormedAddCommGroup V'\ninst✝² : InnerProductSpace ℝ V'\ninst✝¹ : MetricSpace P'\ninst✝ : NormedAddTorsor V' P'\nf : P → P'\nh : Isometry f\np₁ p₂ : P\n⊢ f ⁻¹' ↑(perpBisector (f p₁) (f p₂)) = ↑(perpBisector p₁ p₂)\n[PROOFSTEP]\next x\n[GOAL]\ncase h\nV : Type u_4\nP : Type u_1\nV' : Type u_3\nP' : Type u_2\ninst✝⁷ : NormedAddCommGroup V\ninst✝⁶ : InnerProductSpace ℝ V\ninst✝⁵ : MetricSpace P\ninst✝⁴ : NormedAddTorsor V P\ninst✝³ : NormedAddCommGroup V'\ninst✝² : InnerProductSpace ℝ V'\ninst✝¹ : MetricSpace P'\ninst✝ : NormedAddTorsor V' P'\nf : P → P'\nh : Isometry f\np₁ p₂ x : P\n⊢ x ∈ f ⁻¹' ↑(perpBisector (f p₁) (f p₂)) ↔ x ∈ ↑(perpBisector p₁ p₂)\n[PROOFSTEP]\nsimp [mem_perpBisector_iff_dist_eq, h.dist_eq]\n", "meta": {"mathlib_filename": "Mathlib.Geometry.Euclidean.PerpBisector", "llama_tokens": 4634, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8311430353105598, "lm_q2_score": 0.7826624789529375, "lm_q1q2_score": 0.6505044683806316}} {"text": "[GOAL]\nX : Type u_1\ninst✝ : TopologicalSpace X\n⊢ SimplyConnectedSpace X ↔ Nonempty X ∧ ∀ (x y : X), Nonempty (Unique (Path.Homotopic.Quotient x y))\n[PROOFSTEP]\nrw [simply_connected_def, equiv_punit_iff_unique]\n[GOAL]\nX : Type u_1\ninst✝ : TopologicalSpace X\n⊢ (Nonempty (FundamentalGroupoid X) ∧ ∀ (x y : FundamentalGroupoid X), Nonempty (Unique (x ⟶ y))) ↔\n Nonempty X ∧ ∀ (x y : X), Nonempty (Unique (Path.Homotopic.Quotient x y))\n[PROOFSTEP]\nrfl\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : SimplyConnectedSpace X\nx y : X\n⊢ Nonempty (Unique (Path.Homotopic.Quotient x y))\n[PROOFSTEP]\nrw [simply_connected_iff_unique_homotopic] at *\n[GOAL]\nX : Type u_1\ninst✝¹ : TopologicalSpace X\ninst✝ : Nonempty X ∧ ∀ (x y : X), Nonempty (Unique (Path.Homotopic.Quotient x y))\nx y : X\n⊢ Nonempty (Unique (Path.Homotopic.Quotient x y))\n[PROOFSTEP]\ntauto\n[GOAL]\nY : Type u_1\ninst✝ : TopologicalSpace Y\n⊢ SimplyConnectedSpace Y → PathConnectedSpace Y ∧ ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n[PROOFSTEP]\nintro\n[GOAL]\nY : Type u_1\ninst✝ : TopologicalSpace Y\na✝ : SimplyConnectedSpace Y\n⊢ PathConnectedSpace Y ∧ ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n[PROOFSTEP]\nconstructor\n[GOAL]\ncase left\nY : Type u_1\ninst✝ : TopologicalSpace Y\na✝ : SimplyConnectedSpace Y\n⊢ PathConnectedSpace Y\n[PROOFSTEP]\ninfer_instance\n[GOAL]\ncase right\nY : Type u_1\ninst✝ : TopologicalSpace Y\na✝ : SimplyConnectedSpace Y\n⊢ ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n[PROOFSTEP]\ninfer_instance\n[GOAL]\nY : Type u_1\ninst✝ : TopologicalSpace Y\nh : PathConnectedSpace Y ∧ ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n⊢ SimplyConnectedSpace Y\n[PROOFSTEP]\ncases h\n[GOAL]\ncase intro\nY : Type u_1\ninst✝ : TopologicalSpace Y\nleft✝ : PathConnectedSpace Y\nright✝ : ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n⊢ SimplyConnectedSpace Y\n[PROOFSTEP]\nrw [simply_connected_iff_unique_homotopic]\n[GOAL]\ncase intro\nY : Type u_1\ninst✝ : TopologicalSpace Y\nleft✝ : PathConnectedSpace Y\nright✝ : ∀ (x y : Y), Subsingleton (Path.Homotopic.Quotient x y)\n⊢ Nonempty Y ∧ ∀ (x y : Y), Nonempty (Unique (Path.Homotopic.Quotient x y))\n[PROOFSTEP]\nexact ⟨inferInstance, fun x y => ⟨uniqueOfSubsingleton ⟦PathConnectedSpace.somePath x y⟧⟩⟩\n[GOAL]\nY : Type u_1\ninst✝ : TopologicalSpace Y\n⊢ SimplyConnectedSpace Y ↔ PathConnectedSpace Y ∧ ∀ {x y : Y} (p₁ p₂ : Path x y), Path.Homotopic p₁ p₂\n[PROOFSTEP]\nconvert simply_connected_iff_paths_homotopic (Y := Y)\n[GOAL]\ncase h.e'_2.h.e'_2.h.h.a\nY : Type u_1\ninst✝ : TopologicalSpace Y\na✝¹ a✝ : Y\n⊢ (∀ (p₁ p₂ : Path a✝¹ a✝), Path.Homotopic p₁ p₂) ↔ Subsingleton (Path.Homotopic.Quotient a✝¹ a✝)\n[PROOFSTEP]\nsimp [Path.Homotopic.Quotient, Setoid.eq_top_iff]\n[GOAL]\ncase h.e'_2.h.e'_2.h.h.a\nY : Type u_1\ninst✝ : TopologicalSpace Y\na✝¹ a✝ : Y\n⊢ (∀ (p₁ p₂ : Path a✝¹ a✝), Path.Homotopic p₁ p₂) ↔ ∀ (x y : Path a✝¹ a✝), Setoid.Rel (Path.Homotopic.setoid a✝¹ a✝) x y\n[PROOFSTEP]\nrfl\n", "meta": {"mathlib_filename": "Mathlib.AlgebraicTopology.FundamentalGroupoid.SimplyConnected", "llama_tokens": 1360, "lm_name": "Qwen/Qwen-72B", "lm_label": "1. YES\n2. YES", "lm_q1_score": 0.8933094117351309, "lm_q2_score": 0.7279754607093178, "lm_q1q2_score": 0.6503073305638516}}