(* Title: Archimedes_Zone.thy Author: Carles Marín Copyright (c) 2026 Carles Marín. All rights reserved. License: BSD Archimedes' hat-box theorem: the area of the zone of a sphere of radius r between heights a and b is 2 pi r (b - a)*) theory Archimedes_Zone imports "HOL-Analysis.Analysis"begin section \<open>Archimedes' hat-box theorem: area of a spherical zone\<close> text \<open> Theorem of the Day, "Archimedes' Equiareal Map Theorem" (sphere to circumscribed cylinder). We formalize ONLY its zone-area form. DEFINITION (not derived from a surface measure): the area of the surface of revolution generated by a function f >= 0, C^1 on [a,b], is taken to be \<open>2 pi \<int>_a^b f(x) sqrt(1 + f'(x)^2) dx\<close>. The theorem then says that for the half circle \<open>f x = sqrt(r^2 - x^2)\<close> this area equals \<open>2 pi r (b - a)\<close>: the area of the cylinder of radius r between heights a and b. NOT formalized: the surface measure itself, and the projection as an area-preserving map in general (first fundamental form, E G - F^2).\<close> definition revolution_area :: "(real \<Rightarrow> real) \<Rightarrow> real \<Rightarrow> real \<Rightarrow> real" where "revolution_area f a b = integral {a..b} (\<lambda>x. 2 * pi * f x * sqrt (1 + (deriv f x)^2))" lemma deriv_half_circle: assumes "x^2 < r^2" shows "DERIV (\<lambda>x. sqrt (r^2 - x^2)) x :> - x / sqrt (r^2 - x^2)"proof - have pos: "0 < r^2 - x^2" using assms by simp have "DERIV (\<lambda>x. sqrt (r^2 - x^2)) x :> (- (2 * x)) / (2 * sqrt (r^2 - x^2))" proof - have h1: "DERIV (\<lambda>x::real. r^2 - x^2) x :> - (2 * x)" by (auto intro!: derivative_eq_intros) have h2: "DERIV (\<lambda>x. sqrt (r^2 - x^2)) x :> inverse (sqrt (r^2 - x^2)) / 2 * (- (2 * x))" using DERIV_chain2[where f = sqrt and g = "\<lambda>x. r^2 - x^2" and x = x, OF DERIV_real_sqrt[OF pos] h1] by simp have "inverse (sqrt (r^2 - x^2)) / 2 * (- (2 * x)) = (- (2 * x)) / (2 * sqrt (r^2 - x^2))" by (simp add: field_simps) then show ?thesis using h2 by simp qed moreover have "(- (2 * x)) / (2 * sqrt (r^2 - x^2)) = - x / sqrt (r^2 - x^2)" by simp ultimately show ?thesis by simpqed text \<open>Key identity: the integrand is the constant \<open>2 pi r\<close> inside \<open>(-r, r)\<close>.\<close> lemma integrand_const: assumes "0 < r" "x^2 < r^2" shows "2 * pi * sqrt (r^2 - x^2) * sqrt (1 + (deriv (\<lambda>x. sqrt (r^2 - x^2)) x)^2) = 2 * pi * r"proof - define s where "s = sqrt (r^2 - x^2)" have pos: "0 < r^2 - x^2" using assms by simp have s0: "0 < s" unfolding s_def using pos by simp have s2: "s^2 = r^2 - x^2" unfolding s_def using pos by simp have d: "deriv (\<lambda>x. sqrt (r^2 - x^2)) x = - x / s" unfolding s_def by (rule DERIV_imp_deriv[OF deriv_half_circle[OF assms(2)]]) have "1 + (- x / s)^2 = (r / s)^2" using s0 s2 by (simp add: power_divide field_simps) then have "sqrt (1 + (- x / s)^2) = r / s" using assms(1) s0 by (simp add: real_sqrt_abs) then show ?thesis using d s0 unfolding s_def[symmetric] by simpqed theorem archimedes_zone: assumes "0 < r" "-r < a" "a \<le> b" "b < r" shows "((\<lambda>x. 2 * pi * sqrt (r^2 - x^2) * sqrt (1 + (deriv (\<lambda>x. sqrt (r^2 - x^2)) x)^2)) has_integral 2 * pi * r * (b - a)) {a..b}"proof - have c: "((\<lambda>x::real. 2 * pi * r) has_integral (2 * pi * r * (b - a))) {a..b}" using has_integral_const_real[of "2 * pi * r" a b] assms by (simp add: algebra_simps) have eq: "2 * pi * sqrt (r^2 - x^2) * sqrt (1 + (deriv (\<lambda>x. sqrt (r^2 - x^2)) x)^2) = 2 * pi * r" if x: "x \<in> {a..b}" for x proof (rule integrand_const[OF assms(1)]) have "\<bar>x\<bar> < r" using x assms by (simp add: abs_less_iff) then have "\<bar>x\<bar>^2 < r^2" by (intro power_strict_mono) auto then show "x^2 < r^2" by simp qed show ?thesis by (subst has_integral_cong[OF eq]) (use c in auto)qed corollary archimedes_zone_area: assumes "0 < r" "-r < a" "a \<le> b" "b < r" shows "revolution_area (\<lambda>x. sqrt (r^2 - x^2)) a b = 2 * pi * r * (b - a)" unfolding revolution_area_def using archimedes_zone[OF assms] by (rule integral_unique) text \<open>The hypotheses \<open>-r < a\<close>, \<open>b < r\<close> are needed for the derivative (infinite at \<open>+-r\<close>). The total area \<open>4 pi r^2\<close> (improper integral, limit \<open>a -> -r\<close>, \<open>b -> r\<close>) is NOT formalized here.\<close> end